mirror of
https://github.com/python/cpython.git
synced 2025-10-13 10:23:28 +00:00
M PyShell.py
M RemoteDebugger.py M rpc.py Fix the incorrect shell exception tracebacks generated when running under debugger control: 1. Use rpc.SocketIO.asynccall() instead of remotecall() to handle the IdbProxy.run() command. 2. Add a 'shell' attribute to RemoteDebugger.IdbProxy to allow setting of ModifiedInterpreter's active_seq attribute from RemoteDebugger code. 3. Cleanup PyShell.ModifiedInterpreter.runcode() and remove ambiguity regarding use of begin/endexecuting(). 4. In runcode() and cleanup_traceback() use 'console' instead of 'file' to denote the entity to which the exception traceback is printed. 5. Enhance cleanup_traceback() so if the traceback is pruned entirely away (the error is in IDLE internals) it will be displayed in its entirety instead. 6. ModifiedInterpreter.runcode() now prints ERROR RPC returns to both console and __stderr__. 7. Make a small tweak to the rpc.py debug messages.
This commit is contained in:
parent
cd5c8c2120
commit
bc2861313c
3 changed files with 45 additions and 40 deletions
|
@ -287,19 +287,21 @@ class GUIAdapter:
|
|||
|
||||
class IdbProxy:
|
||||
|
||||
def __init__(self, conn, oid):
|
||||
def __init__(self, conn, shell, oid):
|
||||
self.oid = oid
|
||||
self.conn = conn
|
||||
self.shell = shell
|
||||
|
||||
def call(self, methodname, *args, **kwargs):
|
||||
##print "call %s %s %s" % (methodname, args, kwargs)
|
||||
##print "**IdbProxy.call %s %s %s" % (methodname, args, kwargs)
|
||||
value = self.conn.remotecall(self.oid, methodname, args, kwargs)
|
||||
##print "return %s" % `value`
|
||||
##print "**IdbProxy.call %s returns %s" % (methodname, `value`)
|
||||
return value
|
||||
|
||||
def run(self, cmd, locals):
|
||||
# Ignores locals on purpose!
|
||||
self.call("run", cmd)
|
||||
seq = self.conn.asynccall(self.oid, "run", (cmd,), {})
|
||||
self.shell.interp.active_seq = seq
|
||||
|
||||
def get_stack(self, frame, tbid):
|
||||
# passing frame and traceback IDs, not the objects themselves
|
||||
|
@ -352,7 +354,7 @@ def start_remote_debugger(rpcclt, pyshell):
|
|||
|
||||
idb_adap_oid = rpcclt.remotecall("exec", "start_the_debugger",\
|
||||
(gui_adap_oid,), {})
|
||||
idb_proxy = IdbProxy(rpcclt, idb_adap_oid)
|
||||
idb_proxy = IdbProxy(rpcclt, pyshell, idb_adap_oid)
|
||||
gui = Debugger.Debugger(pyshell, idb_proxy)
|
||||
gui_adap = GUIAdapter(rpcclt, gui)
|
||||
rpcclt.register(gui_adap_oid, gui_adap)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue