Thu, 25 Apr 2013 19:52:40 +0200
Extended the Python debugger backends to report the call arguments and values of the frames.
DebugClients/Python/DebugBase.py | file | annotate | diff | comparison | revisions | |
DebugClients/Python3/DebugBase.py | file | annotate | diff | comparison | revisions |
--- a/DebugClients/Python/DebugBase.py Wed Apr 24 19:14:22 2013 +0200 +++ b/DebugClients/Python/DebugBase.py Thu Apr 25 19:52:40 2013 +0200 @@ -530,13 +530,21 @@ stack = [] while fr is not None: fname = self._dbgClient.absPath(self.fix_frame_filename(fr)) - fline = fr.f_lineno - ffunc = fr.f_code.co_name + if not fname.startswith("<"): + fline = fr.f_lineno + ffunc = fr.f_code.co_name + + if ffunc == '?': + ffunc = '' - if ffunc == '?': - ffunc = '' - - stack.append([fname, fline, ffunc]) + if ffunc and not ffunc.startswith("<"): + argInfo = inspect.getargvalues(fr) + fargs = inspect.formatargvalues(argInfo[0], argInfo[1], + argInfo[2], argInfo[3]) + else: + fargs = "" + + stack.append([fname, fline, ffunc, fargs]) if fr == self._dbgClient.mainFrame: fr = None @@ -579,13 +587,21 @@ # return from dispatch_call fr.f_trace = self.trace_dispatch fname = self._dbgClient.absPath(self.fix_frame_filename(fr)) - fline = fr.f_lineno - ffunc = fr.f_code.co_name - - if ffunc == '?': - ffunc = '' - - stack.append([fname, fline, ffunc]) + if not fname.startswith("<"): + fline = fr.f_lineno + ffunc = fr.f_code.co_name + + if ffunc == '?': + ffunc = '' + + if ffunc and not ffunc.startswith("<"): + argInfo = inspect.getargvalues(fr) + fargs = inspect.formatargvalues(argInfo[0], argInfo[1], + argInfo[2], argInfo[3]) + else: + fargs = "" + + stack.append([fname, fline, ffunc, fargs]) if fr == self._dbgClient.mainFrame: fr = None
--- a/DebugClients/Python3/DebugBase.py Wed Apr 24 19:14:22 2013 +0200 +++ b/DebugClients/Python3/DebugBase.py Thu Apr 25 19:52:40 2013 +0200 @@ -539,13 +539,21 @@ stack = [] while fr is not None: fname = self._dbgClient.absPath(self.fix_frame_filename(fr)) - fline = fr.f_lineno - ffunc = fr.f_code.co_name - - if ffunc == '?': - ffunc = '' - - stack.append([fname, fline, ffunc]) + if not fname.startswith("<"): + fline = fr.f_lineno + ffunc = fr.f_code.co_name + + if ffunc == '?': + ffunc = '' + + if ffunc and not ffunc.startswith("<"): + argInfo = inspect.getargvalues(fr) + fargs = inspect.formatargvalues(argInfo.args, argInfo.varargs, + argInfo.keywords, argInfo.locals) + else: + fargs = "" + + stack.append([fname, fline, ffunc, fargs]) if fr == self._dbgClient.mainFrame: fr = None @@ -588,13 +596,21 @@ # return from dispatch_call fr.f_trace = self.trace_dispatch fname = self._dbgClient.absPath(self.fix_frame_filename(fr)) - fline = fr.f_lineno - ffunc = fr.f_code.co_name - - if ffunc == '?': - ffunc = '' - - stack.append([fname, fline, ffunc]) + if not fname.startswith("<"): + fline = fr.f_lineno + ffunc = fr.f_code.co_name + + if ffunc == '?': + ffunc = '' + + if ffunc and not ffunc.startswith("<"): + argInfo = inspect.getargvalues(fr) + fargs = inspect.formatargvalues(argInfo.args, argInfo.varargs, + argInfo.keywords, argInfo.locals) + else: + fargs = "" + + stack.append([fname, fline, ffunc, fargs]) if fr == self._dbgClient.mainFrame: fr = None