summaryrefslogtreecommitdiff
path: root/Lib/bdb.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-07-30 10:29:19 +0000
committerGeorg Brandl <georg@python.org>2010-07-30 10:29:19 +0000
commit3f94089a77d95792c3adc087bbb0309ff9d592dc (patch)
tree369beca901c97541bcca79785bfbc8139c8f97db /Lib/bdb.py
parentd72e043bddf965ce1cdc7a85baef1d3e929df070 (diff)
downloadcpython-git-3f94089a77d95792c3adc087bbb0309ff9d592dc.tar.gz
#5294: Fix the behavior of pdb "continue" command when called in the top-level debugged frame.
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r--Lib/bdb.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/bdb.py b/Lib/bdb.py
index 572e5913d4..460f0d4585 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -109,6 +109,8 @@ class Bdb:
self.is_skipped_module(frame.f_globals.get('__name__')):
return False
if frame is self.stopframe:
+ if self.stoplineno == -1:
+ return False
return frame.f_lineno >= self.stoplineno
while frame is not None and frame is not self.stopframe:
if frame is self.botframe:
@@ -165,10 +167,12 @@ class Bdb:
but only if we are to stop at or just below this level."""
pass
- def _set_stopinfo(self, stopframe, returnframe, stoplineno=-1):
+ def _set_stopinfo(self, stopframe, returnframe, stoplineno=0):
self.stopframe = stopframe
self.returnframe = returnframe
self.quitting = 0
+ # stoplineno >= 0 means: stop at line >= the stoplineno
+ # stoplineno -1 means: don't stop at all
self.stoplineno = stoplineno
# Derived classes and clients can call the following methods
@@ -184,7 +188,7 @@ class Bdb:
def set_step(self):
"""Stop after one line of code."""
- self._set_stopinfo(None,None)
+ self._set_stopinfo(None, None)
def set_next(self, frame):
"""Stop on the next line in or below the given frame."""
@@ -211,7 +215,7 @@ class Bdb:
def set_continue(self):
# Don't stop except at breakpoints or when finished
- self._set_stopinfo(self.botframe, None)
+ self._set_stopinfo(self.botframe, None, -1)
if not self.breaks:
# no breakpoints; run without debugger overhead
sys.settrace(None)