Index: dist/src/Lib/bdb.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bdb.py,v retrieving revision 1.42 diff -c -c -r1.42 bdb.py *** dist/src/Lib/bdb.py 27 Feb 2003 20:14:32 -0000 1.42 --- dist/src/Lib/bdb.py 14 Apr 2003 22:20:12 -0000 *************** *** 454,460 **** def disable(self): self.enabled = 0 ! def bpprint(self): if self.temporary: disp = 'del ' else: --- 454,460 ---- def disable(self): self.enabled = 0 ! def bpprint(self, outfd=sys.stdout): if self.temporary: disp = 'del ' else: *************** *** 463,479 **** disp = disp + 'yes' else: disp = disp + 'no ' ! print '%-4dbreakpoint %s at %s:%d' % (self.number, disp, ! self.file, self.line) if self.cond: ! print '\tstop only if %s' % (self.cond,) if self.ignore: ! print '\tignore next %d hits' % (self.ignore) if (self.hits): if (self.hits > 1): ss = 's' else: ss = '' ! print ('\tbreakpoint already hit %d time%s' % ! (self.hits, ss)) # -----------end of Breakpoint class---------- --- 463,479 ---- disp = disp + 'yes' else: disp = disp + 'no ' ! outfd.write('%-4dbreakpoint %s at %s:%d\n'%(self.number, disp, ! self.file, self.line)) if self.cond: ! outfd.write('\tstop only if %s\n'%(self.cond)) if self.ignore: ! outfd.write('\tignore next %d hits\n'%(self.ignore)) if (self.hits): if (self.hits > 1): ss = 's' else: ss = '' ! outfd.write('\tbreakpoint already hit %d time%s\n'% ! (self.hits, ss)) # -----------end of Breakpoint class---------- Index: dist/src/Lib/pdb.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pdb.py,v retrieving revision 1.64 diff -c -c -r1.64 pdb.py *** dist/src/Lib/pdb.py 9 Apr 2003 19:36:34 -0000 1.64 --- dist/src/Lib/pdb.py 14 Apr 2003 22:20:14 -0000 *************** *** 52,60 **** class Pdb(bdb.Bdb, cmd.Cmd): ! def __init__(self): bdb.Bdb.__init__(self) ! cmd.Cmd.__init__(self) self.prompt = '(Pdb) ' self.aliases = {} # Try to load readline if it exists --- 52,62 ---- class Pdb(bdb.Bdb, cmd.Cmd): ! def __init__(self, completekey='tab', stdin=None, stdout=None): bdb.Bdb.__init__(self) ! cmd.Cmd.__init__(self, completekey, stdin, stdout) ! if stdout: ! self.use_rawinput = 0 self.prompt = '(Pdb) ' self.aliases = {} # Try to load readline if it exists *************** *** 118,124 **** """This method is called when there is the remote possibility that we ever need to stop in this function.""" if self.stop_here(frame): ! print '--Call--' self.interaction(frame, None) def user_line(self, frame): --- 120,126 ---- """This method is called when there is the remote possibility that we ever need to stop in this function.""" if self.stop_here(frame): ! self.stdout.write('--Call--\n') self.interaction(frame, None) def user_line(self, frame): *************** *** 128,134 **** def user_return(self, frame, return_value): """This function is called when a return trap is set here.""" frame.f_locals['__return__'] = return_value ! print '--Return--' self.interaction(frame, None) def user_exception(self, frame, (exc_type, exc_value, exc_traceback)): --- 130,136 ---- def user_return(self, frame, return_value): """This function is called when a return trap is set here.""" frame.f_locals['__return__'] = return_value ! self.stdout.write('--Return--\n') self.interaction(frame, None) def user_exception(self, frame, (exc_type, exc_value, exc_traceback)): *************** *** 138,144 **** if type(exc_type) == type(''): exc_type_name = exc_type else: exc_type_name = exc_type.__name__ ! print exc_type_name + ':', _saferepr(exc_value) self.interaction(frame, exc_traceback) # General interaction function --- 140,146 ---- if type(exc_type) == type(''): exc_type_name = exc_type else: exc_type_name = exc_type.__name__ ! self.stdout.write('%s: %s\n'%(exc_type_name, _saferepr(exc_value))) self.interaction(frame, exc_traceback) # General interaction function *************** *** 161,167 **** if type(t) == type(''): exc_type_name = t else: exc_type_name = t.__name__ ! print '***', exc_type_name + ':', v def precmd(self, line): """Handle alias expansion and ';;' separator.""" --- 163,169 ---- if type(t) == type(''): exc_type_name = t else: exc_type_name = t.__name__ ! self.stdout.write('*** %s: %s\n'%(exc_type_name, v)) def precmd(self, line): """Handle alias expansion and ';;' separator.""" *************** *** 198,207 **** # break [ ([filename:]lineno | function) [, "condition"] ] if not arg: if self.breaks: # There's at least one ! print "Num Type Disp Enb Where" for bp in bdb.Breakpoint.bpbynumber: if bp: ! bp.bpprint() return # parse arguments; comma has lowest precedence # and cannot occur in filename --- 200,209 ---- # break [ ([filename:]lineno | function) [, "condition"] ] if not arg: if self.breaks: # There's at least one ! self.stdout.write("Num Type Disp Enb Where\n") for bp in bdb.Breakpoint.bpbynumber: if bp: ! bp.bpprint(self.stdout) return # parse arguments; comma has lowest precedence # and cannot occur in filename *************** *** 219,226 **** filename = arg[:colon].rstrip() f = self.lookupmodule(filename) if not f: ! print '*** ', `filename`, ! print 'not found from sys.path' return else: filename = f --- 221,228 ---- filename = arg[:colon].rstrip() f = self.lookupmodule(filename) if not f: ! self.stdout.writelines(('*** ', `filename`, ! ' not found from sys.path\n')) return else: filename = f *************** *** 228,234 **** try: lineno = int(arg) except ValueError, msg: ! print '*** Bad lineno:', arg return else: # no colon; can be lineno or function --- 230,236 ---- try: lineno = int(arg) except ValueError, msg: ! self.stdout.write('*** Bad lineno: %s\n'%(arg)) return else: # no colon; can be lineno or function *************** *** 251,261 **** # last thing to try (ok, filename, ln) = self.lineinfo(arg) if not ok: ! print '*** The specified object', ! print `arg`, ! print 'is not a function' ! print ('or was not found ' ! 'along sys.path.') return lineno = int(ln) if not filename: --- 253,263 ---- # last thing to try (ok, filename, ln) = self.lineinfo(arg) if not ok: ! self.stdout.writelines(('*** The specified', ! ' object ', `arg`, ! ' is not a function', ! ' or was not found', ! ' along sys.path.\n')) return lineno = int(ln) if not filename: *************** *** 265,276 **** if line: # now set the break point err = self.set_break(filename, line, temporary, cond) ! if err: print '***', err else: bp = self.get_breaks(filename, line)[-1] ! print "Breakpoint %d at %s:%d" % (bp.number, ! bp.file, ! bp.line) # To be overridden in derived debuggers def defaultFile(self): --- 267,278 ---- if line: # now set the break point err = self.set_break(filename, line, temporary, cond) ! if err: self.stdout.write('*** %s\n'%(err)) else: bp = self.get_breaks(filename, line)[-1] ! self.stdout.write("Breakpoint %d at %s:%d\n"%(bp.number, ! bp.file, ! bp.line)) # To be overridden in derived debuggers def defaultFile(self): *************** *** 328,340 **** line = linecache.getline(filename, lineno) if not line: ! print 'End of file' return 0 line = line.strip() # Don't allow setting breakpoint at a blank line if (not line or (line[0] == '#') or (line[:3] == '"""') or line[:3] == "'''"): ! print '*** Blank or comment' return 0 # When a file is read in and a breakpoint is at # the 'def' statement, the system stops there at --- 330,342 ---- line = linecache.getline(filename, lineno) if not line: ! self.stdout.write('End of file\n') return 0 line = line.strip() # Don't allow setting breakpoint at a blank line if (not line or (line[0] == '#') or (line[:3] == '"""') or line[:3] == "'''"): ! self.stdout.write('*** Blank or comment\n') return 0 # When a file is read in and a breakpoint is at # the 'def' statement, the system stops there at *************** *** 364,370 **** lineno = lineno+1 line = linecache.getline(filename, lineno) if not line: ! print 'end of file' return 0 line = line.strip() if not line: continue # Blank line --- 366,372 ---- lineno = lineno+1 line = linecache.getline(filename, lineno) if not line: ! self.stdout.write('end of file\n') return 0 line = line.strip() if not line: continue # Blank line *************** *** 398,405 **** if bp: bp.cond = cond if not cond: ! print 'Breakpoint', bpnum, ! print 'is now unconditional.' def do_ignore(self,arg): """arg is bp number followed by ignore count.""" --- 400,407 ---- if bp: bp.cond = cond if not cond: ! self.stdout.writelines(('Breakpoint ', `bpnum`, ! ' is now unconditional.\n')) def do_ignore(self,arg): """arg is bp number followed by ignore count.""" *************** *** 418,427 **** reply = reply + '%d crossings' % count else: reply = reply + '1 crossing' ! print reply + ' of breakpoint %d.' % bpnum else: ! print 'Will stop next time breakpoint', ! print bpnum, 'is reached.' def do_clear(self, arg): """Three possibilities, tried in this order: --- 420,429 ---- reply = reply + '%d crossings' % count else: reply = reply + '1 crossing' ! self.stdout.write('%s of breakpoint %d.\n'%(reply, bpnum)) else: ! self.stdout.writelines(('Will stop next time breakpoint ', ! `bpnum`, ' is reached.\n')) def do_clear(self, arg): """Three possibilities, tried in this order: *************** *** 448,462 **** err = "Invalid line number (%s)" % arg else: err = self.clear_break(filename, lineno) ! if err: print '***', err return numberlist = arg.split() for i in numberlist: err = self.clear_bpbynumber(i) if err: ! print '***', err else: ! print 'Deleted breakpoint %s ' % (i,) do_cl = do_clear # 'c' is already an abbreviation for 'continue' def do_where(self, arg): --- 450,464 ---- err = "Invalid line number (%s)" % arg else: err = self.clear_break(filename, lineno) ! if err: self.stdout.write('*** %s\n'%(err)) return numberlist = arg.split() for i in numberlist: err = self.clear_bpbynumber(i) if err: ! self.stdout.write('*** %s\n'%(err)) else: ! self.stdout.write('Deleted breakpoint %s\n'%(i)) do_cl = do_clear # 'c' is already an abbreviation for 'continue' def do_where(self, arg): *************** *** 466,472 **** def do_up(self, arg): if self.curindex == 0: ! print '*** Oldest frame' else: self.curindex = self.curindex - 1 self.curframe = self.stack[self.curindex][0] --- 468,474 ---- def do_up(self, arg): if self.curindex == 0: ! self.stdout.write('*** Oldest frame\n') else: self.curindex = self.curindex - 1 self.curframe = self.stack[self.curindex][0] *************** *** 476,482 **** def do_down(self, arg): if self.curindex + 1 == len(self.stack): ! print '*** Newest frame' else: self.curindex = self.curindex + 1 self.curframe = self.stack[self.curindex][0] --- 478,484 ---- def do_down(self, arg): if self.curindex + 1 == len(self.stack): ! self.stdout.write('*** Newest frame\n') else: self.curindex = self.curindex + 1 self.curframe = self.stack[self.curindex][0] *************** *** 506,517 **** 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 --- 508,521 ---- def do_jump(self, arg): if self.curindex + 1 != len(self.stack): ! self.stdout.writelines(("*** You can only jump within ", ! "the bottom frame\n")) return try: arg = int(arg) except ValueError: ! self.stdout.writelines(("*** The 'jump' command ", ! "requires a line number.\n")) else: try: # Do the jump, fix up our copy of the stack, and display the *************** *** 520,526 **** 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_debug(self, arg): --- 524,530 ---- self.stack[self.curindex] = self.stack[self.curindex][0], arg self.print_stack_entry(self.stack[self.curindex]) except ValueError, e: ! self.stdout.write('*** Jump failed: %s\n'%(e)) do_j = do_jump def do_debug(self, arg): *************** *** 529,537 **** locals = self.curframe.f_locals p = Pdb() p.prompt = "(%s) " % self.prompt.strip() ! print "ENTERING RECURSIVE DEBUGGER" sys.call_tracing(p.run, (arg, globals, locals)) ! print "LEAVING RECURSIVE DEBUGGER" sys.settrace(self.trace_dispatch) self.lastcmd = p.lastcmd --- 533,541 ---- locals = self.curframe.f_locals p = Pdb() p.prompt = "(%s) " % self.prompt.strip() ! self.stdout.write("ENTERING RECURSIVE DEBUGGER\n") sys.call_tracing(p.run, (arg, globals, locals)) ! self.stdout.write("LEAVING RECURSIVE DEBUGGER\n") sys.settrace(self.trace_dispatch) self.lastcmd = p.lastcmd *************** *** 542,548 **** do_exit = do_quit def do_EOF(self, arg): ! print self.set_quit() return 1 --- 546,552 ---- do_exit = do_quit def do_EOF(self, arg): ! self.stdout.write('\n') self.set_quit() return 1 *************** *** 555,570 **** if co.co_flags & 8: n = n+1 for i in range(n): name = co.co_varnames[i] ! print name, '=', ! if name in dict: print dict[name] ! else: print "*** undefined ***" do_a = do_args def do_retval(self, arg): if '__return__' in self.curframe.f_locals: ! print self.curframe.f_locals['__return__'] else: ! print '*** Not yet returned!' do_rv = do_retval def _getval(self, arg): --- 559,574 ---- if co.co_flags & 8: n = n+1 for i in range(n): name = co.co_varnames[i] ! self.stdout.write('%s='%(name)) ! if name in dict: self.stdout.write('%s\n'%(dict[name])) ! else: self.stdout.write("*** undefined ***\n") do_a = do_args def do_retval(self, arg): if '__return__' in self.curframe.f_locals: ! self.stdout.write('%s\n'%(self.curframe.f_locals['__return__'])) else: ! self.stdout.write('*** Not yet returned!\n') do_rv = do_retval def _getval(self, arg): *************** *** 576,593 **** if isinstance(t, str): exc_type_name = t else: exc_type_name = t.__name__ ! print '***', exc_type_name + ':', `v` raise def do_p(self, arg): try: ! print repr(self._getval(arg)) except: pass def do_pp(self, arg): try: ! pprint.pprint(self._getval(arg)) except: pass --- 580,597 ---- if isinstance(t, str): exc_type_name = t else: exc_type_name = t.__name__ ! self.stdout.write('*** %s: %s\n'%(exc_type_name, `v`)) raise def do_p(self, arg): try: ! self.stdout.write('%s\n'%(repr(self._getval(arg)))) except: pass def do_pp(self, arg): try: ! pprint.pprint(self._getval(arg), self.stdout) except: pass *************** *** 607,613 **** else: first = max(1, int(x) - 5) except: ! print '*** Error in argument:', `arg` return elif self.lineno is None: first = max(1, self.curframe.f_lineno - 5) --- 611,617 ---- else: first = max(1, int(x) - 5) except: ! self.stdout.write('*** Error in argument: %s\n'%(`arg`)) return elif self.lineno is None: first = max(1, self.curframe.f_lineno - 5) *************** *** 621,627 **** for lineno in range(first, last+1): line = linecache.getline(filename, lineno) if not line: ! print '[EOF]' break else: s = `lineno`.rjust(3) --- 625,631 ---- for lineno in range(first, last+1): line = linecache.getline(filename, lineno) if not line: ! self.stdout.write('[EOF]\n') break else: s = `lineno`.rjust(3) *************** *** 630,636 **** else: s = s + ' ' if lineno == self.curframe.f_lineno: s = s + '->' ! print s + '\t' + line, self.lineno = lineno except KeyboardInterrupt: pass --- 634,640 ---- else: s = s + ' ' if lineno == self.curframe.f_lineno: s = s + '->' ! self.stdout.write('%s\t%s'%(s, line)) self.lineno = lineno except KeyboardInterrupt: pass *************** *** 645,667 **** if type(t) == type(''): exc_type_name = t else: exc_type_name = t.__name__ ! print '***', exc_type_name + ':', `v` return code = None # Is it a function? try: code = value.func_code except: pass if code: ! print 'Function', code.co_name return # Is it an instance method? try: code = value.im_func.func_code except: pass if code: ! print 'Method', code.co_name return # None of the above... ! print type(value) def do_alias(self, arg): args = arg.split() --- 649,671 ---- if type(t) == type(''): exc_type_name = t else: exc_type_name = t.__name__ ! self.stdout.write('*** %s: %s\n'%(exc_type_name, `v`)) return code = None # Is it a function? try: code = value.func_code except: pass if code: ! self.stdout.write('Function %s\n'%(code.co_name)) return # Is it an instance method? try: code = value.im_func.func_code except: pass if code: ! self.stdout.write('Method %s\n'%(code.co_name)) return # None of the above... ! self.stdout.write('%s\n'%(type(value))) def do_alias(self, arg): args = arg.split() *************** *** 669,678 **** keys = self.aliases.keys() keys.sort() for alias in keys: ! print "%s = %s" % (alias, self.aliases[alias]) return if args[0] in self.aliases and len(args) == 1: ! print "%s = %s" % (args[0], self.aliases[args[0]]) else: self.aliases[args[0]] = ' '.join(args[1:]) --- 673,682 ---- keys = self.aliases.keys() keys.sort() for alias in keys: ! self.stdout.write("%s = %s\n"%(alias, self.aliases[alias])) return if args[0] in self.aliases and len(args) == 1: ! self.stdout.write("%s = %s\n"%(args[0], self.aliases[args[0]])) else: self.aliases[args[0]] = ' '.join(args[1:]) *************** *** 700,709 **** def print_stack_entry(self, frame_lineno, prompt_prefix=line_prefix): frame, lineno = frame_lineno if frame is self.curframe: ! print '>', else: ! print ' ', ! print self.format_stack_entry(frame_lineno, prompt_prefix) # Help methods (derived from pdb.doc) --- 704,714 ---- def print_stack_entry(self, frame_lineno, prompt_prefix=line_prefix): frame, lineno = frame_lineno if frame is self.curframe: ! self.stdout.write('> ') else: ! self.stdout.write(' ') ! self.stdout.write('%s\n'%(self.format_stack_entry(frame_lineno, ! prompt_prefix))) # Help methods (derived from pdb.doc) *************** *** 712,731 **** self.help_h() def help_h(self): ! print """h(elp) Without argument, print the list of available commands. With a command name as argument, print help about that command "help pdb" pipes the full documentation file to the $PAGER ! "help exec" gives help on the ! command""" def help_where(self): self.help_w() def help_w(self): ! print """w(here) Print a stack trace, with the most recent frame at the bottom. An arrow indicates the "current frame", which determines the ! context of most commands. 'bt' is an alias for this command.""" help_bt = help_w --- 717,736 ---- self.help_h() def help_h(self): ! self.stdout.write("""h(elp) Without argument, print the list of available commands. With a command name as argument, print help about that command "help pdb" pipes the full documentation file to the $PAGER ! "help exec" gives help on the ! command\n""") def help_where(self): self.help_w() def help_w(self): ! self.stdout.write("""w(here) Print a stack trace, with the most recent frame at the bottom. An arrow indicates the "current frame", which determines the ! context of most commands. 'bt' is an alias for this command.\n""") help_bt = help_w *************** *** 733,755 **** self.help_d() def help_d(self): ! print """d(own) Move the current frame one level down in the stack trace ! (to an older frame).""" def help_up(self): self.help_u() def help_u(self): ! print """u(p) Move the current frame one level up in the stack trace ! (to a newer frame).""" def help_break(self): self.help_b() def help_b(self): ! print """b(reak) ([file:]lineno | function) [, condition] With a line number argument, set a break there in the current file. With a function name, set a break at first executable line of that function. Without argument, list all breaks. If a second --- 738,760 ---- self.help_d() def help_d(self): ! self.stdout.write("""d(own) Move the current frame one level down in the stack trace ! (to an older frame).\n""") def help_up(self): self.help_u() def help_u(self): ! self.stdout.write("""u(p) Move the current frame one level up in the stack trace ! (to a newer frame).\n""") def help_break(self): self.help_b() def help_b(self): ! self.stdout.write("""b(reak) ([file:]lineno | function) [, condition] With a line number argument, set a break there in the current file. With a function name, set a break at first executable line of that function. Without argument, list all breaks. If a second *************** *** 759,772 **** The line number may be prefixed with a filename and a colon, to specify a breakpoint in another file (probably one that hasn't been loaded yet). The file is searched for on sys.path; ! the .py suffix may be omitted.""" def help_clear(self): self.help_cl() def help_cl(self): ! print "cl(ear) filename:lineno" ! print """cl(ear) [bpnumber [bpnumber...]] With a space separated list of breakpoint numbers, clear those breakpoints. Without argument, clear all breaks (but first ask confirmation). With a filename:lineno argument, --- 764,777 ---- The line number may be prefixed with a filename and a colon, to specify a breakpoint in another file (probably one that hasn't been loaded yet). The file is searched for on sys.path; ! the .py suffix may be omitted.\n""") def help_clear(self): self.help_cl() def help_cl(self): ! self.stdout.write("cl(ear) filename:lineno\n") ! self.stdout.write("""cl(ear) [bpnumber [bpnumber...]] With a space separated list of breakpoint numbers, clear those breakpoints. Without argument, clear all breaks (but first ask confirmation). With a filename:lineno argument, *************** *** 775,833 **** Note that the argument is different from previous versions of the debugger (in python distributions 1.5.1 and before) where a linenumber was used instead of either filename:lineno or ! breakpoint numbers.""" def help_tbreak(self): ! print """tbreak same arguments as break, but breakpoint is ! removed when first hit.""" def help_enable(self): ! print """enable bpnumber [bpnumber ...] Enables the breakpoints given as a space separated list of ! bp numbers.""" def help_disable(self): ! print """disable bpnumber [bpnumber ...] Disables the breakpoints given as a space separated list of ! bp numbers.""" def help_ignore(self): ! print """ignore bpnumber count Sets the ignore count for the given breakpoint number. A breakpoint becomes active when the ignore count is zero. When non-zero, the count is decremented each time the breakpoint is reached and the breakpoint is not disabled and any associated condition evaluates ! to true.""" def help_condition(self): ! print """condition bpnumber str_condition str_condition is a string specifying an expression which must evaluate to true before the breakpoint is honored. If str_condition is absent, any existing condition is removed; ! i.e., the breakpoint is made unconditional.""" def help_step(self): self.help_s() def help_s(self): ! print """s(tep) Execute the current line, stop at the first possible occasion ! (either in a function that is called or in the current function).""" def help_next(self): self.help_n() def help_n(self): ! print """n(ext) Continue execution until the next line in the current function ! is reached or it returns.""" def help_return(self): self.help_r() def help_r(self): ! print """r(eturn) ! Continue execution until the current function returns.""" def help_continue(self): self.help_c() --- 780,838 ---- Note that the argument is different from previous versions of the debugger (in python distributions 1.5.1 and before) where a linenumber was used instead of either filename:lineno or ! breakpoint numbers.\n""") def help_tbreak(self): ! self.stdout.write("""tbreak same arguments as break, but ! breakpoint is removed when first hit.\n""") def help_enable(self): ! self.stdout.write("""enable bpnumber [bpnumber ...] Enables the breakpoints given as a space separated list of ! bp numbers.\n""") def help_disable(self): ! self.stdout.write("""disable bpnumber [bpnumber ...] Disables the breakpoints given as a space separated list of ! bp numbers.\n""") def help_ignore(self): ! self.stdout.write("""ignore bpnumber count Sets the ignore count for the given breakpoint number. A breakpoint becomes active when the ignore count is zero. When non-zero, the count is decremented each time the breakpoint is reached and the breakpoint is not disabled and any associated condition evaluates ! to true.\n""") def help_condition(self): ! self.stdout.write("""condition bpnumber str_condition str_condition is a string specifying an expression which must evaluate to true before the breakpoint is honored. If str_condition is absent, any existing condition is removed; ! i.e., the breakpoint is made unconditional.\n""") def help_step(self): self.help_s() def help_s(self): ! self.stdout.write("""s(tep) Execute the current line, stop at the first possible occasion ! (either in a function that is called or in the current function).\n""") def help_next(self): self.help_n() def help_n(self): ! self.stdout.write("""n(ext) Continue execution until the next line in the current function ! is reached or it returns.\n""") def help_return(self): self.help_r() def help_r(self): ! self.stdout.write("""r(eturn) ! Continue execution until the current function returns.\n""") def help_continue(self): self.help_c() *************** *** 836,886 **** self.help_c() def help_c(self): ! 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_debug(self): ! print """debug code Enter a recursive debugger that steps through the code argument (which is an arbitrary expression or statement to be executed ! in the current environment).""" def help_list(self): self.help_l() def help_l(self): ! print """l(ist) [first [,last]] List source code for the current file. Without arguments, list 11 lines around the current line or continue the previous listing. With one argument, list 11 lines starting at that line. With two arguments, list the given range; ! if the second argument is less than the first, it is a count.""" def help_args(self): self.help_a() def help_a(self): ! print """a(rgs) ! Print the arguments of the current function.""" def help_p(self): ! print """p expression ! Print the value of the expression.""" def help_pp(self): ! print """pp expression ! Pretty-print the value of the expression.""" def help_exec(self): ! print """(!) statement Execute the (one-line) statement in the context of the current stack frame. The exclamation point can be omitted unless the first word --- 841,891 ---- self.help_c() def help_c(self): ! self.stdout.write("""c(ont(inue)) ! Continue execution, only stop when a breakpoint is encountered.\n""") def help_jump(self): self.help_j() def help_j(self): ! self.stdout.write("""j(ump) lineno ! Set the next line that will be executed.\n""") def help_debug(self): ! self.stdout.write("""debug code Enter a recursive debugger that steps through the code argument (which is an arbitrary expression or statement to be executed ! in the current environment).\n""") def help_list(self): self.help_l() def help_l(self): ! self.stdout.write("""l(ist) [first [,last]] List source code for the current file. Without arguments, list 11 lines around the current line or continue the previous listing. With one argument, list 11 lines starting at that line. With two arguments, list the given range; ! if the second argument is less than the first, it is a count.\n""") def help_args(self): self.help_a() def help_a(self): ! self.stdout.write("""a(rgs) ! Print the arguments of the current function.\n""") def help_p(self): ! self.stdout.write("""p expression ! Print the value of the expression.\n""") def help_pp(self): ! self.stdout.write("""pp expression ! Pretty-print the value of the expression.\n""") def help_exec(self): ! self.stdout.write("""(!) statement Execute the (one-line) statement in the context of the current stack frame. The exclamation point can be omitted unless the first word *************** *** 888,914 **** To assign to a global variable you must always prefix the command with a 'global' command, e.g.: (Pdb) global list_options; list_options = ['-l'] ! (Pdb)""" def help_quit(self): self.help_q() def help_q(self): ! print """q(uit) or exit - Quit from the debugger. ! The program being executed is aborted.""" help_exit = help_q def help_whatis(self): ! print """whatis arg ! Prints the type of the argument.""" def help_EOF(self): ! print """EOF ! Handles the receipt of EOF as a command.""" def help_alias(self): ! print """alias [name [command [parameter parameter ...] ]] Creates an alias called 'name' the executes 'command'. The command must *not* be enclosed in quotes. Replaceable parameters are indicated by %1, %2, and so on, while %* is replaced by all the --- 893,919 ---- To assign to a global variable you must always prefix the command with a 'global' command, e.g.: (Pdb) global list_options; list_options = ['-l'] ! (Pdb)\n""") def help_quit(self): self.help_q() def help_q(self): ! self.stdout.write("""q(uit) or exit - Quit from the debugger. ! The program being executed is aborted.\n""") help_exit = help_q def help_whatis(self): ! self.stdout.write("""whatis arg ! Prints the type of the argument.\n""") def help_EOF(self): ! self.stdout.write("""EOF ! Handles the receipt of EOF as a command.\n""") def help_alias(self): ! self.stdout.write("""alias [name [command [parameter parameter ...] ]] Creates an alias called 'name' the executes 'command'. The command must *not* be enclosed in quotes. Replaceable parameters are indicated by %1, %2, and so on, while %* is replaced by all the *************** *** 929,939 **** #Print instance variables in self alias ps pi self ! """ def help_unalias(self): ! print """unalias name ! Deletes the specified alias.""" def help_pdb(self): help() --- 934,944 ---- #Print instance variables in self alias ps pi self ! \n""") def help_unalias(self): ! self.stdout.write("""unalias name ! Deletes the specified alias.\n""") def help_pdb(self): help()