Your IP : 18.191.198.245


Current Path : /opt/alt/python27/lib64/python2.7/idlelib/
Upload File :
Current File : //opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyo

�
^
bc@sdZddlZddlmZdZdadZiZiZiZ	iZ
d�Zd�Zd	dd
��YZ
ddd��YZd
�Zddd��YZddd��YZdd d��YZdd!d��YZdd"d��YZd�Zd�Zd�Zd�ZdS(#s�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.

i����N(tDebuggeritidb_adaptertgui_adaptercCst|�}|t|<|S(N(tidt
frametable(tframetfid((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyt
wrap_frame(s
cCsO|dkrdS|d}t|�}|t|<|d|d|f}|SdS(s0replace info[2], a traceback instance, by its IDiiiN(tNoneRttracebacktable(tinfot	tracebackttraceback_idt
modified_info((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyt	wrap_info-s

tGUIProxycBseZd�Zdd�ZRS(cCs||_||_dS(N(tconntoid(tselfRtgui_adap_oid((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyt__init__;s	cCs5|jj|jd|t|�t|�fi�dS(Ntinteraction(Rt
remotecallRRR(RtmessageRR
((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR?sN(t__name__t
__module__RRR(((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR9s	t
IdbAdaptercBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�ZRS(cCs
||_dS(N(tidb(RR((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRHscCs|jj�dS(N(Rtset_step(R((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRMscCs|jj�dS(N(Rtset_quit(R((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRPscCs|jj�dS(N(Rtset_continue(R((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRSscCst|}|jj|�dS(N(RRtset_next(RRR((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRVs
cCst|}|jj|�dS(N(RRt
set_return(RRR((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR Zs
c	Csyt|}|dkrd}n
t|}|jj||�\}}g|D]\}}t|�|f^qK}||fS(N(RRR	Rt	get_stackR(	RRttbidRttbtstacktitframe2tk((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR!^s
	
+cCs&ddl}|jj||j�dS(Ni����(t__main__Rtrunt__dict__(RtcmdR(((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR)kscCs|jj||�}|S(N(Rt	set_break(Rtfilenametlinenotmsg((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR,oscCs|jj||�}|S(N(Rtclear_break(RR-R.R/((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR0sscCs|jj|�}|S(N(Rtclear_all_file_breaks(RR-R/((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR1wscCst|}t||�S(N(Rtgetattr(RRtnameR((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyt
frame_attr}s
cCs-t|}|j}t|�}|t|<|S(N(Rt	f_globalsRt	dicttable(RRRtdicttdid((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyt
frame_globals�s

	
cCs-t|}|j}t|�}|t|<|S(N(Rtf_localsRR6(RRRR7R8((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pytframe_locals�s

	
cCs-t|}|j}t|�}|t|<|S(N(Rtf_codeRt	codetable(RRRtcodetcid((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyt
frame_code�s

	
cCst|}|jS(N(R=tco_name(RR?R>((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyt	code_name�s
cCst|}|jS(N(R=tco_filename(RR?R>((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyt
code_filename�s
cCst|}|j�S(N(R6tkeys(RR8R7((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyt	dict_keys�s
cCs$t|}||}t|�}|S(N(R6trepr(RR8tkeyR7tvalue((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyt	dict_item�s

(RRRRRRRR R!R)R,R0R1R4R9R;R@RBRDRFRJ(((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRFs&							
												cCs>t||�}tj|�}t|�}|jt|�tS(s|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.

    (RRtIdbRtregistertidb_adap_oid(t
rpchandlerRt	gui_proxyRtidb_adap((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pytstart_debugger�s

t
FrameProxycBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs(||_||_d|_i|_dS(NR(t_connt_fidt_oidt
_dictcache(RRR((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR�s			cCs�|d dkrt|�n|dkr2|j�S|dkrH|j�S|dkr^|j�S|jj|jd|j|fi�S(Nit_R<R5R:R4(tAttributeErrort_get_f_codet_get_f_globalst
_get_f_localsRSRRURT(RR3((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyt__getattr__�s


cCs:|jj|jd|jfi�}t|j|j|�S(NR@(RSRRURTt	CodeProxy(RR?((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRY�s$cCs1|jj|jd|jfi�}|j|�S(NR9(RSRRURTt_get_dict_proxy(RR8((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRZ�scCs1|jj|jd|jfi�}|j|�S(NR;(RSRRURTR^(RR8((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR[�scCsC||jkr|j|St|j|j|�}||j|<|S(N(RVt	DictProxyRSRU(RR8tdp((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR^�s

(RRRR\RYRZR[R^(((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRR�s					R]cBseZd�Zd�ZRS(cCs||_||_||_dS(N(RSRUt_cid(RRRR?((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR�s		cCs`|dkr.|jj|jd|jfi�S|dkr\|jj|jd|jfi�SdS(NRARBRCRD(RSRRURa(RR3((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR\�s(RRRR\(((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR]�s	R_cBs,eZd�Zd�Zd�Zd�ZRS(cCs||_||_||_dS(N(RSRUt_did(RRRR8((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRs		cCs"|jj|jd|jfi�S(NRF(RSRRURb(R((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyREscCs%|jj|jd|j|fi�S(NRJ(RSRRURb(RRH((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyt__getitem__	scCs
t|�dS(N(RX(RR3((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR\
s(RRRRERcR\(((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR_�s			t
GUIAdaptercBseZd�Zd�ZRS(cCs||_||_dS(N(Rtgui(RRRe((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRs	cCs,t|j|�}|jj|||�dS(N(RRRReR(RRRR
R((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRs(RRRR(((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRds	tIdbProxycBsteZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
RS(cCs||_||_||_dS(N(RRtshell(RRRgR((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR s		cOs"|jj|j|||�}|S(N(RRR(Rt
methodnametargstkwargsRI((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pytcall%scCs4|jj|jd|fi�}||jj_dS(NR)(Rt
asyncqueueRRgtinterpt
active_seq(RR+tlocalstseq((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR)+s!cCsY|jd|j|�\}}g|D]$\}}t|j|�|f^q%}||fS(NR!(RkRTRRR(RRR"R$R%RR'((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR!0s1cCs|jd�dS(NR(Rk(R((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR6scCs|jd�dS(NR(Rk(R((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR9scCs|jd|j�dS(NR(RkRT(RR((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR<scCs|jd|j�dS(NR (RkRT(RR((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR ?scCs|jd�dS(NR(Rk(R((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRBscCs|jd||�}|S(NR,(Rk(RR-R.R/((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR,EscCs|jd||�}|S(NR0(Rk(RR-R.R/((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR0IscCs|jd|�}|S(NR1(Rk(RR-R/((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyR1Ms(RRRRkR)R!RRRR RR,R0R1(((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRfs											cCsb|jddtfi�at||t�}tj||�}t||�}|jt|�|S(s]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.

    texectstart_the_debugger(RRRMRfRRdRL(trpcclttpyshellt	idb_proxyRetgui_adap((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pytstart_remote_debuggerQscCst|�|jt�dS(s]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().)

    N(tclose_subprocess_debuggert
unregisterR(Rs((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pytclose_remote_debuggeris	
cCs|jddtfi�dS(NRqtstop_the_debugger(RRM(Rs((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyRxuscCs|jddtfi�}dS(NRqRr(RR(Rstidb_adap_oid_ret((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pytrestart_subprocess_debuggerxs((((((((t__doc__ttypestidlelibRt	debuggingRMRRR6R=R	RRRRRQRRR]R_RdRfRwRzRxR}(((s;/opt/alt/python27/lib64/python2.7/idlelib/RemoteDebugger.pyt<module>s.		
i	*3			

?>