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.
diff --git a/Lib/idlelib/RemoteDebugger.py b/Lib/idlelib/RemoteDebugger.py
index 84e94df..f9430d0 100644
--- a/Lib/idlelib/RemoteDebugger.py
+++ b/Lib/idlelib/RemoteDebugger.py
@@ -27,6 +27,9 @@
debugging = 0
+idb_adap_oid = "idb_adapter"
+gui_adap_oid = "gui_adapter"
+
#=======================================
#
# In the PYTHON subprocess:
@@ -113,6 +116,7 @@
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 @@
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 @@
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 @@
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 @@
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'
+