This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pdb sometimes sets breakpoints in the wrong location
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jlgijsbers Nosy List: isandler, jlgijsbers
Priority: normal Keywords:

Created on 2004-03-31 00:22 by isandler, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg20387 - (view) Author: Ilya Sandler (isandler) Date: 2004-03-31 00:22
If one attempts to set a breakpoint in one line function:
e.g for this code:

def f(x): return x*x

z=23

pdb silently sets a breakpoint on the line right after
the function definition (i.e. outside the function body!):

../python pdb.py.v1.66 pdb_one_line_func 
> <string>(1)?()
(Pdb) b f
Breakpoint 1   /src/Lib/pdb_one_line_func:3
(Pdb) c
> /src/Lib/pdb_one_line_func(3)?()
-> z=23

It's probably acceptable to limit pdb breakpoints to
multiline functions, but i don't think, it's acceptable
to create wrong breakpoints.

Note: that anyone attempting to fix this should also
take a look at bug 875404 (global statment causes
breakpoints..), as both bugs are caused by
pdb.checkline() logic
msg20388 - (view) Author: Ilya Sandler (isandler) Date: 2004-08-04 23:25
Logged In: YES 
user_id=971153

Patch 1003640 should fix this problem
msg20389 - (view) Author: Johannes Gijsbers (jlgijsbers) * (Python triager) Date: 2004-08-30 13:38
Logged In: YES 
user_id=469548

Fixed by checking in patch 1003640.
History
Date User Action Args
2022-04-11 14:56:03adminsetgithub: 40104
2004-03-31 00:22:33isandlercreate