Mailing List Archive

python/dist/src/Lib pdb.py,1.58,1.59
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv23499/Lib

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



Index: pdb.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pdb.py,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** pdb.py 5 Nov 2002 22:40:20 -0000 1.58
--- pdb.py 17 Dec 2002 16:15:19 -0000 1.59
***************
*** 507,510 ****
--- 507,529 ----
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()
***************
*** 805,808 ****
--- 824,834 ----
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):