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)
| 1097 | do_j = do_jump |
| 1098 | |
| 1099 | def do_debug(self, arg): |
| 1100 | """debug code |
| 1101 | Enter a recursive debugger that steps through the code |
| 1102 | argument (which is an arbitrary expression or statement to be |
| 1103 | executed in the current environment). |
| 1104 | """ |
| 1105 | sys.settrace(None) |
| 1106 | globals = self.curframe.f_globals |
| 1107 | locals = self.curframe_locals |
| 1108 | p = Pdb(self.completekey, self.stdin, self.stdout) |
| 1109 | p.prompt = "(%s) " % self.prompt.strip() |
| 1110 | self.message("ENTERING RECURSIVE DEBUGGER") |
| 1111 | try: |
| 1112 | sys.call_tracing(p.run, (arg, globals, locals)) |
| 1113 | except Exception: |
| 1114 | exc_info = sys.exc_info()[:2] |
| 1115 | self.error(traceback.format_exception_only(*exc_info)[-1].strip()) |
| 1116 | self.message("LEAVING RECURSIVE DEBUGGER") |
| 1117 | sys.settrace(self.trace_dispatch) |
| 1118 | self.lastcmd = p.lastcmd |
| 1119 | |
| 1120 | complete_debug = _complete_expression |
| 1121 |
nothing calls this directly
no test coverage detected