summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-07-30 08:43:32 (GMT)
committerGeorg Brandl <georg@python.org>2010-07-30 08:43:32 (GMT)
commit2dfec552fe6a8884e0dd37be382e2454d701f5d9 (patch)
treeb0c1a83475467ca9f49d2a0e3ddb11a733d6a64f /Lib/pdb.py
parente023091815e4946e42c1af102be1f258b2f47cb8 (diff)
downloadcpython-2dfec552fe6a8884e0dd37be382e2454d701f5d9.zip
cpython-2dfec552fe6a8884e0dd37be382e2454d701f5d9.tar.gz
cpython-2dfec552fe6a8884e0dd37be382e2454d701f5d9.tar.bz2
Allow giving an explicit line number to "until".
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py31
1 files changed, 23 insertions, 8 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index c16cde6..7c6b848 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -71,11 +71,11 @@ w(here)
An arrow indicates the "current frame", which determines the
context of most commands.
-d(own) [ count ]
+d(own) [count]
Move the current frame count (default one) levels down in the
stack trace (to a newer frame).
-u(p) [ count ]
+u(p) [count]
Move the current frame count (default one) levels up in the
stack trace (to an older frame).
@@ -140,9 +140,12 @@ n(ext)
Continue execution until the next line in the current function
is reached or it returns.
-unt(il)
- Continue execution until the line with a number greater than
- the current one is reached or until the current frame returns.
+unt(il) [lineno]
+ Without argument, continue execution until the line with a
+ number greater than the current one is reached. With a line
+ number, continue execution until a line with a number greater
+ or equal to that is reached. In both cases, also stop when
+ the current frame returns.
r(eturn)
Continue execution until the current function returns.
@@ -883,7 +886,19 @@ class Pdb(bdb.Bdb, cmd.Cmd):
do_d = do_down
def do_until(self, arg):
- self.set_until(self.curframe)
+ if arg:
+ try:
+ lineno = int(arg)
+ except ValueError:
+ print('*** Error in argument:', repr(arg), file=self.stdout)
+ return
+ if lineno <= self.curframe.f_lineno:
+ print('*** "until" line number is smaller than current '
+ 'line number', file=self.stdout)
+ return
+ else:
+ lineno = None
+ self.set_until(self.curframe, lineno)
return 1
do_unt = do_until
@@ -1518,8 +1533,8 @@ and in the current directory, if they exist. Commands supplied with
-c are executed after commands from .pdbrc files.
To let the script run until an exception occurs, use "-c continue".
-To let the script run until a given line X in the debugged file, use
-"-c 'break X' -c continue"."""
+To let the script run up to a given line X in the debugged file, use
+"-c 'until X'"."""
def main():
import getopt