[Python-checkins] python/dist/src/Lib bdb.py, 1.46, 1.47 pdb.py, 1.72, 1.73

jlgijsbers at users.sourceforge.net jlgijsbers at users.sourceforge.net
Sun Nov 7 12:35:33 CET 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25401

Modified Files:
	bdb.py pdb.py 
Log Message:
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().


Index: bdb.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/bdb.py,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- bdb.py	24 Oct 2004 00:32:24 -0000	1.46
+++ bdb.py	7 Nov 2004 11:35:30 -0000	1.47
@@ -178,9 +178,13 @@
         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

Index: pdb.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pdb.py,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- pdb.py	24 Oct 2004 00:32:24 -0000	1.72
+++ pdb.py	7 Nov 2004 11:35:30 -0000	1.73
@@ -997,7 +997,7 @@
     return Pdb().runcall(*args, **kwds)
 
 def set_trace():
-    Pdb().set_trace()
+    Pdb().set_trace(sys._getframe().f_back)
 
 # Post-Mortem interface
 



More information about the Python-checkins mailing list