summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/RemoteDebugger.py
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2002-09-05 02:31:20 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2002-09-05 02:31:20 (GMT)
commit63857a454d85fda475264575b7c1a031970219a0 (patch)
tree1b957ef7888fe190e287eeb34dc2bd6922a81a7c /Lib/idlelib/RemoteDebugger.py
parent342456d5d25be692c3ddd43d0446b52555251ccc (diff)
downloadcpython-63857a454d85fda475264575b7c1a031970219a0.zip
cpython-63857a454d85fda475264575b7c1a031970219a0.tar.gz
cpython-63857a454d85fda475264575b7c1a031970219a0.tar.bz2
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.
Diffstat (limited to 'Lib/idlelib/RemoteDebugger.py')
-rw-r--r--Lib/idlelib/RemoteDebugger.py22
1 files changed, 17 insertions, 5 deletions
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 @@ 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'
+