mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
M PyShell.py
M RemoteDebugger.py M ScriptBinding.py Restart the execution server with a clean environment and execute the active module from scratch upon activation of Run/F5. Add functionality to PyShell.py to restart the execution server in a new subprocess. The server makes a connection to the Idle client which sends a block of code to be executed. Modify ScriptBinding.py to restart the subprocess upon Run/F5, assuming that an execution is not currently in progress. Remove Import Module functionality, not required now that the code is executed in a clean environment. If the Debugger is active, also restart the subprocess side of the split debugger. Add functionality to RemoteDebugger.py to support this. At this time breakpoints will be lost in the subprocess if Run/F5 is activated. A subsequent checkin of PyShell.py will implement reloading of the breakpoints into the subprocess debugger. I'm keeping this separate as the design may change.
This commit is contained in:
parent
342456d5d2
commit
63857a454d
3 changed files with 55 additions and 57 deletions
|
@ -27,6 +27,9 @@ import Debugger
|
|||
|
||||
debugging = 0
|
||||
|
||||
idb_adap_oid = "idb_adapter"
|
||||
gui_adap_oid = "gui_adapter"
|
||||
|
||||
#=======================================
|
||||
#
|
||||
# In the PYTHON subprocess:
|
||||
|
@ -113,6 +116,7 @@ class IdbAdapter:
|
|||
|
||||
def clear_break(self, filename, lineno):
|
||||
msg = self.idb.clear_break(filename, lineno)
|
||||
return msg
|
||||
|
||||
def clear_all_file_breaks(self, filename):
|
||||
msg = self.idb.clear_all_file_breaks(filename)
|
||||
|
@ -183,7 +187,6 @@ def start_debugger(rpchandler, gui_adap_oid):
|
|||
gui_proxy = GUIProxy(rpchandler, gui_adap_oid)
|
||||
idb = Debugger.Idb(gui_proxy)
|
||||
idb_adap = IdbAdapter(idb)
|
||||
idb_adap_oid = "idb_adapter"
|
||||
rpchandler.register(idb_adap_oid, idb_adap)
|
||||
return idb_adap_oid
|
||||
|
||||
|
@ -325,6 +328,7 @@ class IdbProxy:
|
|||
|
||||
def clear_break(self, filename, lineno):
|
||||
msg = self.call("clear_break", filename, lineno)
|
||||
return msg
|
||||
|
||||
def clear_all_file_breaks(self, filename):
|
||||
msg = self.call("clear_all_file_breaks", filename)
|
||||
|
@ -344,7 +348,8 @@ def start_remote_debugger(rpcclt, pyshell):
|
|||
Idle debugger GUI to the subprocess debugger via the IdbProxy.
|
||||
|
||||
"""
|
||||
gui_adap_oid = "gui_adapter"
|
||||
global idb_adap_oid
|
||||
|
||||
idb_adap_oid = rpcclt.remotecall("exec", "start_the_debugger",\
|
||||
(gui_adap_oid,), {})
|
||||
idb_proxy = IdbProxy(rpcclt, idb_adap_oid)
|
||||
|
@ -362,7 +367,14 @@ def close_remote_debugger(rpcclt):
|
|||
is deleted in PyShell.close_remote_debugger().)
|
||||
|
||||
"""
|
||||
idb_adap_oid = "idb_adapter"
|
||||
rpcclt.remotecall("exec", "stop_the_debugger", (idb_adap_oid,), {})
|
||||
gui_adap_oid = "gui_adapter"
|
||||
close_subprocess_debugger(rpcclt)
|
||||
rpcclt.unregister(gui_adap_oid)
|
||||
|
||||
def close_subprocess_debugger(rpcclt):
|
||||
rpcclt.remotecall("exec", "stop_the_debugger", (idb_adap_oid,), {})
|
||||
|
||||
def restart_subprocess_debugger(rpcclt):
|
||||
idb_adap_oid_ret = rpcclt.remotecall("exec", "start_the_debugger",\
|
||||
(gui_adap_oid,), {})
|
||||
assert idb_adap_oid_ret == idb_adap_oid, 'Idb restarted with different oid'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue