[issue14792] setting a bp on current function, Pdb stops at next line although no bp

2012-05-25 Thread Xavier de Gaye

Xavier de Gaye xdeg...@gmail.com added the comment:

Parsing the modules source seems a better way to fix this problem, see issue 
14913.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14792] setting a bp on current function, Pdb stops at next line although no bp

2012-05-18 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
nosy: +georg.brandl

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14792] setting a bp on current function, Pdb stops at next line although no bp

2012-05-12 Thread Xavier de Gaye

New submission from Xavier de Gaye xdeg...@gmail.com:

Setting a breakpoint on a function from within that functions makes
pdb to stop at the following line (where no breakpoint is set) after a
continue command. In the following test pdb stops at line 3 where
there is no breakpoint.


===   main.py   =
def foo():
x = 1
x = 2

foo()
=
$ python -m pdb main.py
 /path_to/main.py(1)module()
- def foo():
(Pdb) import sys; print(sys.version)
3.3.0a3+ (default:4e9680570be8, May 11 2012, 12:09:15) 
[GCC 4.3.2]
(Pdb) break 2
Breakpoint 1 at /path_to/main.py:2
(Pdb) continue
 /path_to/main.py(2)foo()
- x = 1
(Pdb) break foo
Breakpoint 2 at /path_to/main.py:1
(Pdb) continue
 /path_to/main.py(3)foo()
- x = 2
(Pdb) where
  /home/xavier/src/cpython/cpython-hg-default/Lib/bdb.py(405)run()
- exec(cmd, globals, locals)
  string(1)module()
  /path_to/main.py(5)module()
- foo()
 /path_to/main.py(3)foo()
- x = 2
(Pdb) quit
=

The attached patch fixes the problem. The patch includes a test case.

--
components: Library (Lib)
files: pdb_default.patch
keywords: patch
messages: 160489
nosy: xdegaye
priority: normal
severity: normal
status: open
title: setting a bp on current function, Pdb stops at next line although no bp
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file25553/pdb_default.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com