Your IP : 3.141.14.210
�
��f�.c@s9dZddlZddlmZddlmZdZdadZiZiZ iZ
iZdd�Zd d
�Z
Gdd�d�ZGd
d�d�Zdd�ZGdd�d�ZGdd�d�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�Zdd�Zdd �Zd!d"�ZdS(#u�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.
iN(urpc(uDebuggeruidb_adapterugui_adaptercCst|�}|t|<|S(N(uidu
frametable(uframeufid((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu
wrap_frame)s
u
wrap_framecCsg|dkrdS|d}t|tj�s2t�t|�}|t|<|d|d|f}|SdS(u0replace info[2], a traceback instance, by its IDiiiN(uNoneu
isinstanceutypesu
TracebackTypeuAssertionErroruidutracebacktable(uinfou tracebackutraceback_idu
modified_info((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu wrap_info.s
u wrap_infocBs/|EeZdZdd�Zddd�ZdS(uGUIProxycCs||_||_dS(N(uconnuoid(uselfuconnugui_adap_oid((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu__init__<s uGUIProxy.__init__cCs5|jj|jd|t|�t|�fi�dS(Nuinteraction(uconnu
remotecalluoidu
wrap_frameu wrap_info(uselfumessageuframeuinfo((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuinteraction@suGUIProxy.interactionN(u__name__u
__module__u__qualname__u__init__uNoneuinteraction(u
__locals__((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuGUIProxy:suGUIProxycBs|EeZdZdd�Zdd�Zdd�Zdd�Zd d
�Zdd�Zd
d�Z dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S(*u
IdbAdaptercCs
||_dS(N(uidb(uselfuidb((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu__init__IsuIdbAdapter.__init__cCs|jj�dS(N(uidbuset_step(uself((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuset_stepNsuIdbAdapter.set_stepcCs|jj�dS(N(uidbuset_quit(uself((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuset_quitQsuIdbAdapter.set_quitcCs|jj�dS(N(uidbuset_continue(uself((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuset_continueTsuIdbAdapter.set_continuecCst|}|jj|�dS(N(u
frametableuidbuset_next(uselfufiduframe((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuset_nextWs
uIdbAdapter.set_nextcCst|}|jj|�dS(N(u
frametableuidbu
set_return(uselfufiduframe((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu
set_return[s
uIdbAdapter.set_returncCsat|}|dkrd}n
t|}|jj||�\}}dd�|D�}||fS(NcSs(g|]\}}t|�|f�qS((u
wrap_frame(u.0uframeuk((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu
<listcomp>fs u(IdbAdapter.get_stack.<locals>.<listcomp>(u
frametableuNoneutracebacktableuidbu get_stack(uselfufidutbiduframeutbustackui((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu get_stack_s
uIdbAdapter.get_stackcCs&ddl}|jj||j�dS(Ni(u__main__uidburunu__dict__(uselfucmdu__main__((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyurunisuIdbAdapter.runcCs|jj||�}|S(N(uidbu set_break(uselfufilenameulinenoumsg((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu set_breakmsuIdbAdapter.set_breakcCs|jj||�}|S(N(uidbuclear_break(uselfufilenameulinenoumsg((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuclear_breakqsuIdbAdapter.clear_breakcCs|jj|�}|S(N(uidbuclear_all_file_breaks(uselfufilenameumsg((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuclear_all_file_breaksusu IdbAdapter.clear_all_file_breakscCst|}t||�S(N(u
frametableugetattr(uselfufidunameuframe((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu
frame_attr{s
uIdbAdapter.frame_attrcCs-t|}|j}t|�}|t|<|S(N(u
frametableu f_globalsuidu dicttable(uselfufiduframeudictudid((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu
frame_globalss
uIdbAdapter.frame_globalscCs-t|}|j}t|�}|t|<|S(N(u
frametableuf_localsuidu dicttable(uselfufiduframeudictudid((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuframe_locals�s
uIdbAdapter.frame_localscCs-t|}|j}t|�}|t|<|S(N(u
frametableuf_codeuidu codetable(uselfufiduframeucodeucid((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu
frame_code�s
uIdbAdapter.frame_codecCst|}|jS(N(u codetableuco_name(uselfuciducode((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu code_name�s
uIdbAdapter.code_namecCst|}|jS(N(u codetableuco_filename(uselfuciducode((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu
code_filename�s
uIdbAdapter.code_filenamecCstd��dS(Nu"dict_keys not public or pickleable(uNotImplemented(uselfudid((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu dict_keys�suIdbAdapter.dict_keyscCst|}t|j��S(N(u dicttableulistukeys(uselfudidudict((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyudict_keys_list�s
uIdbAdapter.dict_keys_listcCs$t|}||}t|�}|S(N(u dicttableurepr(uselfudidukeyudictuvalue((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu dict_item�s
uIdbAdapter.dict_itemN(u__name__u
__module__u__qualname__u__init__uset_stepuset_quituset_continueuset_nextu
set_returnu get_stackurunu set_breakuclear_breakuclear_all_file_breaksu
frame_attru
frame_globalsuframe_localsu
frame_codeu code_nameu
code_filenameu dict_keysudict_keys_listu dict_item(u
__locals__((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu
IdbAdapterGs(
u
IdbAdaptercCs>t||�}tj|�}t|�}|jt|�tS(u|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.
(uGUIProxyuDebuggeruIdbu
IdbAdapteruregisteruidb_adap_oid(u
rpchandlerugui_adap_oidu gui_proxyuidbuidb_adap((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyustart_debugger�s
ustart_debuggercBs\|EeZdZdd�Zdd�Zdd�Zdd�Zd d
�Zdd�Zd
S(u
FrameProxycCs(||_||_d|_i|_dS(Nuidb_adapter(u_connu_fidu_oidu
_dictcache(uselfuconnufid((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu__init__�s uFrameProxy.__init__cCs�|dd�dkr%t|��n|dkr;|j�S|dkrQ|j�S|dkrg|j�S|jj|jd|j|fi�S(Niu_uf_codeu f_globalsuf_localsu
frame_attr(uAttributeErroru_get_f_codeu_get_f_globalsu
_get_f_localsu_connu
remotecallu_oidu_fid(uselfuname((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu__getattr__�s
uFrameProxy.__getattr__cCs:|jj|jd|jfi�}t|j|j|�S(Nu
frame_code(u_connu
remotecallu_oidu_fidu CodeProxy(uselfucid((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu_get_f_code�s$uFrameProxy._get_f_codecCs1|jj|jd|jfi�}|j|�S(Nu
frame_globals(u_connu
remotecallu_oidu_fidu_get_dict_proxy(uselfudid((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu_get_f_globals�suFrameProxy._get_f_globalscCs1|jj|jd|jfi�}|j|�S(Nuframe_locals(u_connu
remotecallu_oidu_fidu_get_dict_proxy(uselfudid((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu
_get_f_locals�suFrameProxy._get_f_localscCsC||jkr|j|St|j|j|�}||j|<|S(N(u
_dictcacheu DictProxyu_connu_oid(uselfudidudp((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu_get_dict_proxy�s
uFrameProxy._get_dict_proxyN( u__name__u
__module__u__qualname__u__init__u__getattr__u_get_f_codeu_get_f_globalsu
_get_f_localsu_get_dict_proxy(u
__locals__((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu
FrameProxy�su
FrameProxycBs,|EeZdZdd�Zdd�ZdS(u CodeProxycCs||_||_||_dS(N(u_connu_oidu_cid(uselfuconnuoiducid((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu__init__�s uCodeProxy.__init__cCs`|dkr.|jj|jd|jfi�S|dkr\|jj|jd|jfi�SdS(Nuco_nameu code_nameuco_filenameu
code_filename(u_connu
remotecallu_oidu_cid(uselfuname((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu__getattr__�suCodeProxy.__getattr__N(u__name__u
__module__u__qualname__u__init__u__getattr__(u
__locals__((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu CodeProxy�su CodeProxycBsD|EeZdZdd�Zdd�Zdd�Zdd�Zd S(
u DictProxycCs||_||_||_dS(N(u_connu_oidu_did(uselfuconnuoidudid((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu__init__s uDictProxy.__init__cCs"|jj|jd|jfi�S(Nudict_keys_list(u_connu
remotecallu_oidu_did(uself((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyukeyssuDictProxy.keyscCs%|jj|jd|j|fi�S(Nu dict_item(u_connu
remotecallu_oidu_did(uselfukey((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu__getitem__suDictProxy.__getitem__cCst|��dS(N(uAttributeError(uselfuname((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu__getattr__suDictProxy.__getattr__N(u__name__u
__module__u__qualname__u__init__ukeysu__getitem__u__getattr__(u
__locals__((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu DictProxys u DictProxycBs,|EeZdZdd�Zdd�ZdS(u
GUIAdaptercCs||_||_dS(N(uconnugui(uselfuconnugui((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu__init__s uGUIAdapter.__init__cCs,t|j|�}|jj|||�dS(N(u
FrameProxyuconnuguiuinteraction(uselfumessageufidu
modified_infouframe((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuinteraction"suGUIAdapter.interactionN(u__name__u
__module__u__qualname__u__init__uinteraction(u
__locals__((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu
GUIAdaptersu
GUIAdaptercBs�|EeZdZdd�Zdd�Zdd�Zdd�Zd d
�Zdd�Zd
d�Z dd�Z
dd�Zdd�Zdd�Z
dd�ZdS(uIdbProxycCs||_||_||_dS(N(uoiduconnushell(uselfuconnushelluoid((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu__init__*s uIdbProxy.__init__cOs"|jj|j|||�}|S(N(uconnu
remotecalluoid(uselfu
methodnameuargsukwargsuvalue((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyucall/su
IdbProxy.callcCs4|jj|jd|fi�}||jj_dS(Nurun(uconnu
asyncqueueuoidushelluinterpu
active_seq(uselfucmdulocalsuseq((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyurun5s!uIdbProxy.runcsA�jd|j|�\}}�fdd�|D�}||fS(Nu get_stackcs.g|]$\}}t�j|�|f�qS((u
FrameProxyuconn(u.0ufiduk(uself(u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu
<listcomp>=s u&IdbProxy.get_stack.<locals>.<listcomp>(ucallu_fid(uselfuframeutbidustackui((uselfu;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu get_stack:suIdbProxy.get_stackcCs|jd�dS(Nuset_continue(ucall(uself((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuset_continue@suIdbProxy.set_continuecCs|jd�dS(Nuset_step(ucall(uself((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuset_stepCsuIdbProxy.set_stepcCs|jd|j�dS(Nuset_next(ucallu_fid(uselfuframe((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuset_nextFsuIdbProxy.set_nextcCs|jd|j�dS(Nu
set_return(ucallu_fid(uselfuframe((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu
set_returnIsuIdbProxy.set_returncCs|jd�dS(Nuset_quit(ucall(uself((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuset_quitLsuIdbProxy.set_quitcCs|jd||�}|S(Nu set_break(ucall(uselfufilenameulinenoumsg((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu set_breakOsuIdbProxy.set_breakcCs|jd||�}|S(Nuclear_break(ucall(uselfufilenameulinenoumsg((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuclear_breakSsuIdbProxy.clear_breakcCs|jd|�}|S(Nuclear_all_file_breaks(ucall(uselfufilenameumsg((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuclear_all_file_breaksWsuIdbProxy.clear_all_file_breaksN(u__name__u
__module__u__qualname__u__init__ucallurunu get_stackuset_continueuset_stepuset_nextu
set_returnuset_quitu set_breakuclear_breakuclear_all_file_breaks(u
__locals__((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuIdbProxy(suIdbProxycCsb|jddtfi�at||t�}tj||�}t||�}|jt|�|S(u]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.
uexecustart_the_debugger(u
remotecallugui_adap_oiduidb_adap_oiduIdbProxyuDebuggeru
GUIAdapteruregister(urpccltupyshellu idb_proxyuguiugui_adap((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyustart_remote_debugger[sustart_remote_debuggercCst|�|jt�dS(u]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(uclose_subprocess_debuggeru
unregisterugui_adap_oid(urpcclt((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuclose_remote_debuggerss
uclose_remote_debuggercCs|jddtfi�dS(Nuexecustop_the_debugger(u
remotecalluidb_adap_oid(urpcclt((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyuclose_subprocess_debuggersuclose_subprocess_debuggercCs7|jddtfi�}|tks3td��dS(Nuexecustart_the_debuggeru Idb restarted with different oid(u
remotecallugui_adap_oiduidb_adap_oiduAssertionError(urpccltuidb_adap_oid_ret((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyurestart_subprocess_debugger�surestart_subprocess_debugger(u__doc__utypesuidleliburpcuDebuggeru debugginguidb_adap_oidugui_adap_oidu
frametableu dicttableu codetableutracebacktableu
wrap_frameu wrap_infouGUIProxyu
IdbAdapterustart_debuggeru
FrameProxyu CodeProxyu DictProxyu
GUIAdapteruIdbProxyustart_remote_debuggeruclose_remote_debuggeruclose_subprocess_debuggerurestart_subprocess_debugger(((u;/opt/alt/python33/lib64/python3.3/idlelib/RemoteDebugger.pyu<module>s0
m*3
?>