Back to index

python3.2  3.2.2
Classes | Functions | Variables
idlelib.RemoteDebugger Namespace Reference

Classes

class  GUIProxy
class  IdbAdapter
class  FrameProxy
class  CodeProxy
class  DictProxy
class  GUIAdapter
class  IdbProxy

Functions

def wrap_frame
def wrap_info
def dict_keys_list
 dict = dicttable[did] return dict.keys()
def dict_item
def start_debugger
def keys
 def keys(self): return self._conn.remotecall(self._oid, "dict_keys", (self._did,), {})
def __getitem__
def __getattr__
def start_remote_debugger
def close_remote_debugger
def close_subprocess_debugger
def restart_subprocess_debugger

Variables

int debugging = 0
string idb_adap_oid = "idb_adapter"
string gui_adap_oid = "gui_adapter"
dictionary frametable = {}
dictionary dicttable = {}
dictionary codetable = {}
dictionary tracebacktable = {}

Detailed Description

Support for remote Python debugging.

Some ASCII art to describe the structure:

       IN PYTHON SUBPROCESS          #             IN IDLE PROCESS
                             #
                             #        oid='gui_adapter'
         +----------+        #       +------------+          +-----+
         | GUIProxy |--remote#call-->| GUIAdapter |--calls-->| GUI |
+-----+--calls-->+----------+        #       +------------+          +-----+
| Idb |                               #                             /
+-----+<-calls--+------------+         #      +----------+<--calls-/
        | IdbAdapter |<--remote#call--| IdbProxy |
        +------------+         #      +----------+
        oid='idb_adapter'      #

The purpose of the Proxy and Adapter classes is to translate certain
arguments and return values that cannot be transported through the RPC
barrier, in particular frame and traceback objects.

Function Documentation

def idlelib.RemoteDebugger.__getattr__ (   self,
  name 
)

Definition at line 279 of file RemoteDebugger.py.

00279 
00280     def __getattr__(self, name):
00281         ##print("*** Failed DictProxy.__getattr__:", name)
00282         raise AttributeError(name)
00283 

def idlelib.RemoteDebugger.__getitem__ (   self,
  key 
)

Definition at line 275 of file RemoteDebugger.py.

00275 
00276     def __getitem__(self, key):
00277         return self._conn.remotecall(self._oid, "dict_item",
00278                                      (self._did, key), {})

Here is the caller graph for this function:

Shut down subprocess debugger and Idle side of debugger RPC link

Request that the RPCServer shut down the subprocess debugger and link.
Unregister the GUIAdapter, which will cause a GC on the Idle process
debugger and RPC link objects.  (The second reference to the debugger GUI
is deleted in PyShell.close_remote_debugger().)

Definition at line 371 of file RemoteDebugger.py.

00371 
00372 def close_remote_debugger(rpcclt):
00373     """Shut down subprocess debugger and Idle side of debugger RPC link
00374 
00375     Request that the RPCServer shut down the subprocess debugger and link.
00376     Unregister the GUIAdapter, which will cause a GC on the Idle process
00377     debugger and RPC link objects.  (The second reference to the debugger GUI
00378     is deleted in PyShell.close_remote_debugger().)
00379 
00380     """
00381     close_subprocess_debugger(rpcclt)
00382     rpcclt.unregister(gui_adap_oid)

Here is the call graph for this function:

Definition at line 383 of file RemoteDebugger.py.

00383 
00384 def close_subprocess_debugger(rpcclt):
00385     rpcclt.remotecall("exec", "stop_the_debugger", (idb_adap_oid,), {})

Here is the caller graph for this function:

def idlelib.RemoteDebugger.dict_item (   self,
  did,
  key 
)

Definition at line 171 of file RemoteDebugger.py.

00171 
00172     def dict_item(self, did, key):
00173         dict = dicttable[did]
00174         value = dict[key]
00175         value = repr(value) ### can't pickle module 'builtins'
00176         return value
00177 
00178 #----------end class IdbAdapter----------
00179 

def idlelib.RemoteDebugger.dict_keys_list (   self,
  did 
)

dict = dicttable[did] return dict.keys()

Needed until dict_keys is type is finished and pickealable. Will probably need to extend rpc.py:SocketIO._proxify at that time.

Definition at line 167 of file RemoteDebugger.py.

00167 
00168     def dict_keys_list(self, did):
00169         dict = dicttable[did]
00170         return list(dict.keys())

def keys(self): return self._conn.remotecall(self._oid, "dict_keys", (self._did,), {})

Definition at line 271 of file RemoteDebugger.py.

00271 
00272     def keys(self):
00273         return self._conn.remotecall(self._oid,
00274                                      "dict_keys_list", (self._did,), {})

Here is the caller graph for this function:

Definition at line 386 of file RemoteDebugger.py.

00386 
00387 def restart_subprocess_debugger(rpcclt):
00388     idb_adap_oid_ret = rpcclt.remotecall("exec", "start_the_debugger",\
00389                                          (gui_adap_oid,), {})
00390     assert idb_adap_oid_ret == idb_adap_oid, 'Idb restarted with different oid'
def idlelib.RemoteDebugger.start_debugger (   rpchandler,
  gui_adap_oid 
)
Start the debugger and its RPC link in the Python subprocess

Start the subprocess side of the split debugger and set up that side of the
RPC link by instantiating the GUIProxy, Idb debugger, and IdbAdapter
objects and linking them together.  Register the IdbAdapter with the
RPCServer to handle RPC requests from the split debugger GUI via the
IdbProxy.

Definition at line 180 of file RemoteDebugger.py.

00180 
00181 def start_debugger(rpchandler, gui_adap_oid):
00182     """Start the debugger and its RPC link in the Python subprocess
00183 
00184     Start the subprocess side of the split debugger and set up that side of the
00185     RPC link by instantiating the GUIProxy, Idb debugger, and IdbAdapter
00186     objects and linking them together.  Register the IdbAdapter with the
00187     RPCServer to handle RPC requests from the split debugger GUI via the
00188     IdbProxy.
00189 
00190     """
00191     gui_proxy = GUIProxy(rpchandler, gui_adap_oid)
00192     idb = Debugger.Idb(gui_proxy)
00193     idb_adap = IdbAdapter(idb)
00194     rpchandler.register(idb_adap_oid, idb_adap)
00195     return idb_adap_oid
00196 
00197 
00198 #=======================================
00199 #
00200 # In the IDLE process:
00201 

def idlelib.RemoteDebugger.start_remote_debugger (   rpcclt,
  pyshell 
)
Start the subprocess debugger, initialize the debugger GUI and RPC link

Request the RPCServer start the Python subprocess debugger and link.  Set
up the Idle side of the split debugger by instantiating the IdbProxy,
debugger GUI, and debugger GUIAdapter objects and linking them together.

Register the GUIAdapter with the RPCClient to handle debugger GUI
interaction requests coming from the subprocess debugger via the GUIProxy.

The IdbAdapter will pass execution and environment requests coming from the
Idle debugger GUI to the subprocess debugger via the IdbProxy.

Definition at line 347 of file RemoteDebugger.py.

00347 
00348 def start_remote_debugger(rpcclt, pyshell):
00349     """Start the subprocess debugger, initialize the debugger GUI and RPC link
00350 
00351     Request the RPCServer start the Python subprocess debugger and link.  Set
00352     up the Idle side of the split debugger by instantiating the IdbProxy,
00353     debugger GUI, and debugger GUIAdapter objects and linking them together.
00354 
00355     Register the GUIAdapter with the RPCClient to handle debugger GUI
00356     interaction requests coming from the subprocess debugger via the GUIProxy.
00357 
00358     The IdbAdapter will pass execution and environment requests coming from the
00359     Idle debugger GUI to the subprocess debugger via the IdbProxy.
00360 
00361     """
00362     global idb_adap_oid
00363 
00364     idb_adap_oid = rpcclt.remotecall("exec", "start_the_debugger",\
00365                                    (gui_adap_oid,), {})
00366     idb_proxy = IdbProxy(rpcclt, pyshell, idb_adap_oid)
00367     gui = Debugger.Debugger(pyshell, idb_proxy)
00368     gui_adap = GUIAdapter(rpcclt, gui)
00369     rpcclt.register(gui_adap_oid, gui_adap)
00370     return gui

Definition at line 41 of file RemoteDebugger.py.

00041 
00042 def wrap_frame(frame):
00043     fid = id(frame)
00044     frametable[fid] = frame
00045     return fid

Here is the caller graph for this function:

Definition at line 46 of file RemoteDebugger.py.

00046 
00047 def wrap_info(info):
00048     "replace info[2], a traceback instance, by its ID"
00049     if info is None:
00050         return None
00051     else:
00052         traceback = info[2]
00053         assert isinstance(traceback, types.TracebackType)
00054         traceback_id = id(traceback)
00055         tracebacktable[traceback_id] = traceback
00056         modified_info = (info[0], info[1], traceback_id)
00057         return modified_info

Here is the caller graph for this function:


Variable Documentation

Definition at line 38 of file RemoteDebugger.py.

Definition at line 27 of file RemoteDebugger.py.

Definition at line 37 of file RemoteDebugger.py.

Definition at line 36 of file RemoteDebugger.py.

Definition at line 30 of file RemoteDebugger.py.

Definition at line 29 of file RemoteDebugger.py.

Definition at line 39 of file RemoteDebugger.py.