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: fix for bug 1055168 (pdb not entering the right frame)
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: isandler, jlgijsbers
Priority: normal Keywords: patch

Created on 2004-11-07 04:26 by isandler, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pdb.patch3 isandler, 2004-11-07 04:26
Messages (3)
msg47219 - (view) Author: Ilya Sandler (isandler) Date: 2004-11-07 04:26
Bdb.set_trace()  assumed that the frame which needs to
be debugged is the caller's frame. This assumption
fails if Bdb_set_trace() is called from inside a
debugger (say from inside of a pdb's set_trace). So now
Bdb.set_trace() accepts an optional parameter
frame_to_debug which allows the caller to specify which
frame needs to be debugged, and pdb is modified to use it..
msg47220 - (view) Author: Ilya Sandler (isandler) Date: 2004-11-07 04:42
Logged In: YES 
user_id=971153


The original bug report gives an example where the code to
debug was specified from python's shell. I am not quite  how
pdb is supposed to behave in this case.. With the patch, it
does seem to enter in the right frame, but it can't list the
code.

The patch does work when the code comes from a file.
 
.def foo():
     import pdb 
     pdb.set_trace()
     print "tracing 1"
     print "tracing 2"
 foo()
msg47221 - (view) Author: Johannes Gijsbers (jlgijsbers) * (Python triager) Date: 2004-11-07 11:37
Logged In: YES 
user_id=469548

That's normal: pdb can never list code that was input on a
console. A coworker of mine (Jeroen Vloothuis) and I
beautified the code a bit, and I checked it in as rev 1.73
of pdb.py and rev 1.47 of bdb.py. Thanks for the patch!
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 41131
2004-11-07 04:26:18isandlercreate