tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
[\¬Qc@s$dZddlZddlmZddlmZdZdadZiZiZ    iZ
iZ d„Z d    „Z d
dd „ƒYZd dd „ƒYZd„Zddd„ƒYZdd d„ƒ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(trpc(tDebuggerit idb_adaptert gui_adaptercCst|ƒ}|t|<|S(N(tidt
frametable(tframetfid((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt
wrap_frame)s 
cCsg|dkrdS|d}t|tjƒs2t‚t|ƒ}|t|<|d|d|f}|SdS(s0replace info[2], a traceback instance, by its IDiiiN(tNonet
isinstancettypest TracebackTypetAssertionErrorRttracebacktable(tinfot    tracebackt traceback_idt modified_info((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt    wrap_info.s 
 
tGUIProxycBseZd„Zdd„ZRS(cCs||_||_dS(N(tconntoid(tselfRt gui_adap_oid((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt__init__<s    cCs5|jj|jd|t|ƒt|ƒfiƒdS(Nt interaction(Rt
remotecallRRR(RtmessageRR((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR@sN(t__name__t
__module__RR    R(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR:s    t
IdbAdaptercBs³eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z d
„Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„ZRS(cCs ||_dS(N(tidb(RR ((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyRIscCs|jjƒdS(N(R tset_step(R((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR!NscCs|jjƒdS(N(R tset_quit(R((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR"QscCs|jjƒdS(N(R t set_continue(R((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR#TscCst|}|jj|ƒdS(N(RR tset_next(RRR((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR$Ws
cCst|}|jj|ƒdS(N(RR t
set_return(RRR((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR%[s
cCsyt|}|dkrd}n
t|}|jj||ƒ\}}g|D]\}}t|ƒ|f^qK}||fS(N(RR    RR t    get_stackR(RRttbidRttbtstacktitk((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR&_s
     
+cCs&ddl}|jj||jƒdS(Niÿÿÿÿ(t__main__R trunt__dict__(RtcmdR,((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR-ls cCs|jj||ƒ}|S(N(R t    set_break(Rtfilenametlinenotmsg((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR0pscCs|jj||ƒ}|S(N(R t clear_break(RR1R2R3((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR4tscCs|jj|ƒ}|S(N(R tclear_all_file_breaks(RR1R3((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR5xscCst|}t||ƒS(N(Rtgetattr(RRtnameR((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt
frame_attr~s
cCs-t|}|j}t|ƒ}|t|<|S(N(Rt    f_globalsRt    dicttable(RRRtdicttdid((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt frame_globals‚s
 
     
cCs-t|}|j}t|ƒ}|t|<|S(N(Rtf_localsRR:(RRRR;R<((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt frame_locals‰s
 
     
cCs-t|}|j}t|ƒ}|t|<|S(N(Rtf_codeRt    codetable(RRRtcodetcid((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt
frame_codes
 
     
cCst|}|jS(N(RAtco_name(RRCRB((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt    code_name™s
cCst|}|jS(N(RAt co_filename(RRCRB((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt code_filenames
cCst|}|jƒS(N(R:tkeys(RR<R;((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt    dict_keys£s
cCs$t|}||}t|ƒ}|S(N(R:trepr(RR<tkeyR;tvalue((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt    dict_item§s
 
 (RRRR!R"R#R$R%R&R-R0R4R5R8R=R?RDRFRHRJRN(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyRGs&                                                                            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_proxyR tidb_adap((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/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^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/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@R9R>R8(tAttributeErrort _get_f_codet_get_f_globalst _get_f_localsRWRRYRX(RR7((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt __getattr__Îs  
 
 
cCs:|jj|jd|jfiƒ}t|j|j|ƒS(NRD(RWRRYRXt    CodeProxy(RRC((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR]Ús$cCs1|jj|jd|jfiƒ}|j|ƒS(NR=(RWRRYRXt_get_dict_proxy(RR<((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR^ÞscCs1|jj|jd|jfiƒ}|j|ƒS(NR?(RWRRYRXRb(RR<((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR_ãscCsC||jkr|j|St|j|j|ƒ}||j|<|S(N(RZt    DictProxyRWRY(RR<tdp((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyRbès
  (RRRR`R]R^R_Rb(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyRVÆs                     RacBseZd„Zd„ZRS(cCs||_||_||_dS(N(RWRYt_cid(RRRRC((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyRòs        cCs`|dkr.|jj|jd|jfiƒS|dkr\|jj|jd|jfiƒSdS(NRERFRGRH(RWRRYRe(RR7((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR`÷s   (RRRR`(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyRaðs    RccBs,eZd„Zd„Zd„Zd„ZRS(cCs||_||_||_dS(N(RWRYt_did(RRRR<((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyRs        cCs"|jj|jd|jfiƒS(NRJ(RWRRYRf(R((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyRIscCs%|jj|jd|j|fiƒS(NRN(RWRRYRf(RRL((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt __getitem__
scCs t|‚dS(N(R\(RR7((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR`s(RRRRIRgR`(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyRcs            t
GUIAdaptercBseZd„Zd„ZRS(cCs||_||_dS(N(Rtgui(RRRi((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyRs    cCs,t|j|ƒ}|jj|||ƒdS(N(RVRRiR(RRRRR((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyRs(RRRR(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyRhs    tIdbProxycBsteZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z d
„Z d „Z RS( cCs||_||_||_dS(N(RRtshell(RRRkR((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR!s        cOs"|jj|j|||ƒ}|S(N(RRR(Rt
methodnametargstkwargsRM((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pytcall&scCs4|jj|jd|fiƒ}||jj_dS(NR-(Rt
asyncqueueRRktinterpt
active_seq(RR/tlocalstseq((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR-,s!cCsY|jd|j|ƒ\}}g|D]$\}}t|j|ƒ|f^q%}||fS(NR&(RoRXRVR(RRR'R)R*RR+((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR&1s1cCs|jdƒdS(NR#(Ro(R((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR#7scCs|jdƒdS(NR!(Ro(R((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR!:scCs|jd|jƒdS(NR$(RoRX(RR((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR$=scCs|jd|jƒdS(NR%(RoRX(RR((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR%@scCs|jdƒdS(NR"(Ro(R((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR"CscCs|jd||ƒ}|S(NR0(Ro(RR1R2R3((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR0FscCs|jd||ƒ}|S(NR4(Ro(RR1R2R3((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR4JscCs|jd|ƒ}|S(NR5(Ro(RR1R3((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR5Ns(RRRRoR-R&R#R!R$R%R"R0R4R5(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyRjs                                            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(RRRQRjRRhRP(trpcclttpyshellt    idb_proxyRitgui_adap((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pytstart_remote_debuggerRs 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(Rw((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pytclose_remote_debuggerjs    
cCs|jddtfiƒdS(NRutstop_the_debugger(RRQ(Rw((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyR|vscCs7|jddtfiƒ}|tks3tdƒ‚dS(NRuRvs Idb restarted with different oid(RRRQR (Rwtidb_adap_oid_ret((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pytrestart_subprocess_debuggerys ((((((((t__doc__R tidlelibRRt    debuggingRQRRR:RARRRRRRURVRaRcRhRjR{R~R|R(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/RemoteDebugger.pyt<module>s0           i    * 3