diff options
author | Michael W. Hudson <mwh@python.net> | 2002-12-17 16:15:34 +0000 |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2002-12-17 16:15:34 +0000 |
commit | c7b53eb548cb44e0cea0c638e412f22421cf7869 (patch) | |
tree | a1ae0ee6a415ae07bb56400282885dc28a8cfb88 /Lib/pdb.py | |
parent | ae2fec0439c0182b86d9beab10833f04f2c7697d (diff) | |
download | cpython-c7b53eb548cb44e0cea0c638e412f22421cf7869.tar.gz |
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-x | Lib/pdb.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py index 94518aebf6..fffd0ad3b8 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() |