MCPcopy Create free account
hub / github.com/RustPython/RustPython / do_debug

Method do_debug

Lib/pdb.py:1099–1118  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

messageMethod · 0.95
errorMethod · 0.95
PdbClass · 0.85
format_exception_onlyMethod · 0.80
stripMethod · 0.45

Tested by

no test coverage detected