summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-12-17 16:15:34 (GMT)
committerMichael W. Hudson <mwh@python.net>2002-12-17 16:15:34 (GMT)
commitcfd3884882bd7fbcadb7d89508c4af70569f87a0 (patch)
tree8634f770b3d214fb0952bdde8c0f2aeb6c512ecb /Lib/pdb.py
parentf680cc460c06d87e9cc1beafafb4a017712f8868 (diff)
downloadcpython-cfd3884882bd7fbcadb7d89508c4af70569f87a0.zip
cpython-cfd3884882bd7fbcadb7d89508c4af70569f87a0.tar.gz
cpython-cfd3884882bd7fbcadb7d89508c4af70569f87a0.tar.bz2
This is Richie Hindle's patch
[ 643835 ] Set Next Statement for Python debuggers with a few tweaks by me: adding an unsigned or two, mentioning that not all jumps are allowed in the doc for pdb, adding a NEWS item and a note to whatsnew, and AuCTeX doing something cosmetic to libpdb.tex.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index 94518ae..fffd0ad 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -506,6 +506,25 @@ class Pdb(bdb.Bdb, cmd.Cmd):
return 1
do_c = do_cont = do_continue
+ def do_jump(self, arg):
+ if self.curindex + 1 != len(self.stack):
+ print "*** You can only jump within the bottom frame"
+ return
+ try:
+ arg = int(arg)
+ except ValueError:
+ print "*** The 'jump' command requires a line number."
+ else:
+ try:
+ # Do the jump, fix up our copy of the stack, and display the
+ # new position
+ self.curframe.f_lineno = arg
+ self.stack[self.curindex] = self.stack[self.curindex][0], arg
+ self.print_stack_entry(self.stack[self.curindex])
+ except ValueError, e:
+ print '*** Jump failed:', e
+ do_j = do_jump
+
def do_quit(self, arg):
self.set_quit()
return 1
@@ -805,6 +824,13 @@ Continue execution until the current function returns."""
print """c(ont(inue))
Continue execution, only stop when a breakpoint is encountered."""
+ def help_jump(self):
+ self.help_j()
+
+ def help_j(self):
+ print """j(ump) lineno
+Set the next line that will be executed."""
+
def help_list(self):
self.help_l()