diff options
author | Johannes Gijsbers <jlg@dds.nl> | 2004-11-07 11:35:30 (GMT) |
---|---|---|
committer | Johannes Gijsbers <jlg@dds.nl> | 2004-11-07 11:35:30 (GMT) |
commit | 84a6c205e3582b5a8705baf9720124c22f74ae4c (patch) | |
tree | a4715077668df4e7afc3075a52c7e9329e6f5ade /Lib/bdb.py | |
parent | e174ae9a1d7d57f406fa3c25de32dfffcd950ea2 (diff) | |
download | cpython-84a6c205e3582b5a8705baf9720124c22f74ae4c.zip cpython-84a6c205e3582b5a8705baf9720124c22f74ae4c.tar.gz cpython-84a6c205e3582b5a8705baf9720124c22f74ae4c.tar.bz2 |
Bug #1055168: calling pdb.set_trace() calls Bdb.set_trace, which made
the debugger enter inside pdb.set_trace.
Patch #1061767: make pdb.set_trace enter enter at the stack frame
calling pdb.set_trace().
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r-- | Lib/bdb.py | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -178,9 +178,13 @@ class Bdb: self.returnframe = frame self.quitting = 0 - def set_trace(self): - """Start debugging from here.""" - frame = sys._getframe().f_back + def set_trace(self, frame=None): + """Start debugging from `frame`. + + If frame is not specified, debugging starts from caller's frame. + """ + if frame is None: + frame = sys._getframe().f_back self.reset() while frame: frame.f_trace = self.trace_dispatch |