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).
(self, arg)
| 585 | do_ll = do_longlist |
| 586 | |
| 587 | def do_debug(self, arg): |
| 588 | """debug code |
| 589 | Enter a recursive debugger that steps through the code |
| 590 | argument (which is an arbitrary expression or statement to be |
| 591 | executed in the current environment). |
| 592 | """ |
| 593 | sys.settrace(None) |
| 594 | globals = self.curframe.f_globals |
| 595 | locals = self.curframe_locals |
| 596 | p = self.__class__(completekey=self.completekey, |
| 597 | stdin=self.stdin, stdout=self.stdout) |
| 598 | p.use_rawinput = self.use_rawinput |
| 599 | p.prompt = "(%s) " % self.prompt.strip() |
| 600 | self.message("ENTERING RECURSIVE DEBUGGER") |
| 601 | sys.call_tracing(p.run, (arg, globals, locals)) |
| 602 | self.message("LEAVING RECURSIVE DEBUGGER") |
| 603 | sys.settrace(self.trace_dispatch) |
| 604 | self.lastcmd = p.lastcmd |
| 605 | |
| 606 | def do_pdef(self, arg): |
| 607 | """Print the call signature for any callable object. |