
TAIHc        D   @   sH  d  Z  d Z d Z d Z d Z d e j o e d   n d d k Z d d k Z d d k	 Z	 d d k
 Z
 d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k  Z  d d k! Z! d d k" Z" d d k# Z# d d k$ Z$ d d k% Z% d d k& Z& d d k' Z' d d k( Z( d d k) Z) d d k* Z* d d k Z d d k+ Z+ y d d k, Z, e, i- Z. Wn d d k- Z- e- Z. n Xy d d k/ Z/ d d k0 Z0 Wn n Xy d d k1 Z1 Wn n Xy d d	 k2 l3 Z3 Wn e j
 o n Xy d d
 k4 l5 Z5 Wn e j
 o n Xd d Z6 e7 e8 e6 e9 e8 d  Z: e7 e8 e6 e9 e8 e( i; e( i< d  Z= d   Z> d   Z? d d d d d f Z@ d ZA d ZB d   ZC d   ZD d f  d     YZE d f  d     YZF d f  d     YZG d eH f d      YZI d! eI f d"     YZJ d# eI f d$     YZK d% eI f d&     YZL d' eI f d(     YZM d) eI f d*     YZN d+ eI f d,     YZO d- eI f d.     YZP d/ eI f d0     YZQ d1 eI f d2     YZR d3 eI f d4     YZS d5 eI f d6     YZT d7 eT f d8     YZU d9 eT f d:     YZV d; eT f d<     YZW d= eT f d>     YZX d? eT f d@     YZY dA eT f dB     YZZ dC eT f dD     YZ[ dE eT f dF     YZ\ dG e\ f dH     YZ] dI e\ f dJ     YZ^ dK e\ f dL     YZ_ dM e\ f dN     YZ` dO e\ f dP     YZa dQ e\ f dR     YZb dS e\ f dT     YZc dU   Zd dV   Ze dW e8 dX  Zf dW e8 dY  Zg dW e7 dZ  Zh d Zi d[ Zj d\ Zk d] Zl d^ Zm d_ Zn d` Zo h  da eC   db dc <da eC   db ek <dd eo <de df <dg ej <dh em <dh en <di el <Zp dj Zq dk Zr dl Zs dm Zt dn Zu do Zv dp Zw dq Zx dr Zy e iz i{ ey ds  Z| e iz i{ ey dt  Z} du Z~ dv Z dw Z dx Z dy Z dz Z d{ Z dw Z d Z d| Z d{ Z d| Z d Z d} Z d~ Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d eA Z d Z d Z d Z d Z d Z d Z e Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d Zd Zd Zd Zd Zd ZdZdZdZdZdZdZdZdZd	Zddd
ddd	g ZdZdZef d Zef d Zd ZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+d Z,dZ-dZ.dZ/d Z0dZ1dt Z2d!Z3d"Z4d#Z5d$Z6d%Z7d&Z8d'Z9d(Z:d)Z;d*Z<d+Z=d,Z>d-Z?ef d. Z@d/ZAd0ZBd1ZCd2ZDef d ZEef d3 ZFef d4 ZGd5d6ZHd6ZId5d6ZJd7ZKh  e
e8<e
e9<ee:<e8 e;<ee<<d e><ZLd8ZMd9ZNd:ZOdv ZPd;ZQd<d=d>d?d@dAdBdCdDdEg
 ZRdFdGdHdIg ZSdJeB ZTdKZUdLZVef dM ZWeh dM ZXdNZYe
 iZ  Z[e9 a\e9 a]e8 a^e7 a_e8 a`e
 iZ  Zae9 abh  Zcg  adh  e e ie<e eT <e eU <e eV <e eW <e eZ <e e[ <e e] <e e^ <e e_ <e e` <e ea <e eb <e eJ <e eX <e eY <e eQ <e eO <e eS <Zfe9 age9 ahe8 aie9 aje9 ake8 ale9 amg  Zne8 aod aph  Zqh  Zrh  Zsg  Zte7 aue iveh dO eh dP  Zwe iveh dP eh dO  Zxh  Zye( izi{dQe( izi{dR  Z|dS  Z}dT  Z~e9 dU Ze9 dV ZdWf  dX    YZdY  Zee|d@ o
 eZn ee|dB o
 eZn ee|d? o
 eZn ee|d< o
 eZn ee|d= o eZee|_n ed   o dZf  d[    YZ0 n e( id  d d f j o e0 iZn d\  Ze( i< e7 d] Zd^  Zd_  Zd`  ZeVda Zdb  Zdc  Zdd  Zde  Zdf  Zdg  Zdh  Zdi  Zdj  Zdk  Zdl  Zdm  Ze7 g dn Zdo  Ze8 dp Zdqf  dr    YZe8 ds Zdt  Zdu  Ze7 dv Zdw  Zdx  Zdy  Zdz  Zd{  Zd|  Zd}  Zd~  Ze7 d Zd  Zd  Zg  e8 e7 d Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zd  Zdf  d    YZd  Zd  Zd  Zd  Zd  Zdf  d    YZde
 if d    YZdf  d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdef d    YZdf  d    YZ df  d    YZdf  d    YZdf  d    YZd  Zd  Zdf  d    YZdf  d    YZdf  d    YZd  Z	def d     YZ
df  d    YZdf  d    YZdf  d    YZdf  d    YZd	f  d
    YZdef d    YZdf  d    YZde if d    YZd  Zdee i f d    YZdf  d    YZdf  d    YZdef d    YZdef d    YZed   o de if d    YZdef d    YZd e if d!    YZd"e if d#    YZd$e	 i f d%    YZ!d&e	 i f d'    YZ"n3 d$e	 i f d(    YZ!d&e	 i f d)    YZ"d*e	 i f d+    YZ#d,f  d-    YZ$d.f  d/    YZ%d0f  d1    YZ&d2e) i'e
 if d3    YZ(d4  Z)e9 Z*e d5j o e|i+e)j o e|i+Z*e)e|_+n d6  Z,d7  Z-e9 Z.e d5j o  d8e/e(  j o e( i0e-j o e( i0Z.e-e( _0n d9  Z1d:f  d;    YZ2d<  Z3d=  Z4e9 Z5e d5j o  d>e/e!  j o e! i6e4j o e! i6Z5e4e! _6n d?  Z7e9 Z8e d5j o  d@e/e!  j o e! i! e7j o e! i! Z8e7e! _! n dA  Z9e9 Z:e d5j o  dBe/e  j o e i;e9j o e i;Z:e9e _;n dC  Z<e9 Z=e d5j o  dDe/e  j o e i>e<j o e i>Z=e<e _>n dE  Z?e9 Z@e d5j o  dFe/e  j o e iAe?j o e iAZ@e?e _An dG  ZBe9 ZCe d5j o  dHe/e  j o e iDeBj o e iDZCeBe _Dn dI  ZEh  dJ ZFe9 ZGe d5j o  dKe/e  j o e iHeFj o e iHZGeFe _Hn d dL ZIdM  ZJe8 dN ZKdO  ZLdP  ZMdQ  ZNdR  ZOdS  ZPe8 dT ZQePdU ZRe dVj o& d d kSZSeSiR  ZTeSi?   n d S(W  s=  
    rpdb2.py - version 2.3.4

    A remote Python debugger for CPython

    Copyright (C) 2005-2008 Nir Aides

    This program is free software; you can redistribute it and/or modify it 
    under the terms of the GNU General Public License as published by the 
    Free Software Foundation; either version 2 of the License, or any later 
    version.

    This program is distributed in the hope that it will be useful, 
    but WITHOUT ANY WARRANTY; without even the implied warranty of 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
    See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along 
    with this program; if not, write to the Free Software Foundation, Inc., 
    51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA    
s!   Copyright (C) 2005-2008 Nir Aidess*   Jurjen N.E. Bos - Compatibility with OS X.s=  
This program is free software; you can redistribute it and/or modify it 
under the terms of the GNU General Public License as published by the 
Free Software Foundation; either version 2 of the License, or any later 
version.

This program is distributed in the hope that it will be useful, 
but WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
See the GNU General Public License for more details.

A copy of the GPL with the precise terms and conditions for 
copying, distribution and modification follow:
s0  
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. 
This License applies to any program or other work which contains a notice 
placed by the copyright holder saying it may be distributed under the terms 
of this General Public License. The "Program", below, refers to any such 
program or work, and a "work based on the Program" means either the Program 
or any derivative work under copyright law: that is to say, a work containing 
the Program or a portion of it, either verbatim or with modifications and/or 
translated into another language. (Hereinafter, translation is included 
without limitation in the term "modification".) Each licensee is addressed 
as "you".

Activities other than copying, distribution and modification are not covered 
by this License; they are outside its scope. The act of running the Program 
is not restricted, and the output from the Program is covered only if its 
contents constitute a work based on the Program (independent of having been 
made by running the Program). Whether that is true depends on what the 
Program does.

1. 
You may copy and distribute verbatim copies of the Program's source code as 
you receive it, in any medium, provided that you conspicuously and 
appropriately publish on each copy an appropriate copyright notice and 
disclaimer of warranty; keep intact all the notices that refer to this 
License and to the absence of any warranty; and give any other recipients of 
the Program a copy of this License along with the Program.

You may charge a fee for the physical act of transferring a copy, and you 
may at your option offer warranty protection in exchange for a fee.

2. 
You may modify your copy or copies of the Program or any portion of it, thus 
forming a work based on the Program, and copy and distribute such modifications 
or work under the terms of Section 1 above, provided that you also meet all 
of these conditions:

    a) You must cause the modified files to carry prominent notices stating 
    that you changed the files and the date of any change.

    b) You must cause any work that you distribute or publish, that in whole 
    or in part contains or is derived from the Program or any part thereof, 
    to be licensed as a whole at no charge to all third parties under the 
    terms of this License.

    c) If the modified program normally reads commands interactively when 
    run, you must cause it, when started running for such interactive use in 
    the most ordinary way, to print or display an announcement including an 
    appropriate copyright notice and a notice that there is no warranty (or 
    else, saying that you provide a warranty) and that users may redistribute 
    the program under these conditions, and telling the user how to view a 
    copy of this License. (Exception: if the Program itself is interactive 
    but does not normally print such an announcement, your work based on the 
    Program is not required to print an announcement.)

These requirements apply to the modified work as a whole. If identifiable 
sections of that work are not derived from the Program, and can be reasonably 
considered independent and separate works in themselves, then this License, 
and its terms, do not apply to those sections when you distribute them as 
separate works. But when you distribute the same sections as part of a whole 
which is a work based on the Program, the distribution of the whole must be 
on the terms of this License, whose permissions for other licensees extend to 
the entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest your 
rights to work written entirely by you; rather, the intent is to exercise the 
right to control the distribution of derivative or collective works based on 
the Program.

In addition, mere aggregation of another work not based on the Program with 
the Program (or with a work based on the Program) on a volume of a storage or 
distribution medium does not bring the other work under the scope of this 
License.

3. You may copy and distribute the Program (or a work based on it, under 
Section 2) in object code or executable form under the terms of Sections 1 
and 2 above provided that you also do one of the following:

    a) Accompany it with the complete corresponding machine-readable source 
    code, which must be distributed under the terms of Sections 1 and 2 above 
    on a medium customarily used for software interchange; or,

    b) Accompany it with a written offer, valid for at least three years, to 
    give any third party, for a charge no more than your cost of physically 
    performing source distribution, a complete machine-readable copy of the 
    corresponding source code, to be distributed under the terms of Sections 
    1 and 2 above on a medium customarily used for software interchange; or,

    c) Accompany it with the information you received as to the offer to 
    distribute corresponding source code. (This alternative is allowed only 
    for noncommercial distribution and only if you received the program in 
    object code or executable form with such an offer, in accord with 
    Subsection b above.)

The source code for a work means the preferred form of the work for making 
modifications to it. For an executable work, complete source code means all 
the source code for all modules it contains, plus any associated interface 
definition files, plus the scripts used to control compilation and 
installation of the executable. However, as a special exception, the source 
code distributed need not include anything that is normally distributed (in 
either source or binary form) with the major components (compiler, kernel, 
and so on) of the operating system on which the executable runs, unless that 
component itself accompanies the executable.

If distribution of executable or object code is made by offering access to 
copy from a designated place, then offering equivalent access to copy the 
source code from the same place counts as distribution of the source code, 
even though third parties are not compelled to copy the source along with 
the object code.

4. You may not copy, modify, sublicense, or distribute the Program except as 
expressly provided under this License. Any attempt otherwise to copy, modify, 
sublicense or distribute the Program is void, and will automatically 
terminate your rights under this License. However, parties who have received 
copies, or rights, from you under this License will not have their licenses 
terminated so long as such parties remain in full compliance.

5. You are not required to accept this License, since you have not signed it. 
However, nothing else grants you permission to modify or distribute the 
Program or its derivative works. These actions are prohibited by law if you 
do not accept this License. Therefore, by modifying or distributing the 
Program (or any work based on the Program), you indicate your acceptance of 
this License to do so, and all its terms and conditions for copying, 
distributing or modifying the Program or works based on it.

6. Each time you redistribute the Program (or any work based on the Program), 
the recipient automatically receives a license from the original licensor to 
copy, distribute or modify the Program subject to these terms and conditions. 
You may not impose any further restrictions on the recipients' exercise of 
the rights granted herein. You are not responsible for enforcing compliance 
by third parties to this License.

7. If, as a consequence of a court judgment or allegation of patent 
infringement or for any other reason (not limited to patent issues), 
conditions are imposed on you (whether by court order, agreement or otherwise) 
that contradict the conditions of this License, they do not excuse you from 
the conditions of this License. If you cannot distribute so as to satisfy 
simultaneously your obligations under this License and any other pertinent 
obligations, then as a consequence you may not distribute the Program at all. 
For example, if a patent license would not permit royalty-free redistribution 
of the Program by all those who receive copies directly or indirectly through 
you, then the only way you could satisfy both it and this License would be to 
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under any 
particular circumstance, the balance of the section is intended to apply and 
the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any patents 
or other property right claims or to contest validity of any such claims; 
this section has the sole purpose of protecting the integrity of the free 
software distribution system, which is implemented by public license 
practices. Many people have made generous contributions to the wide range of 
software distributed through that system in reliance on consistent 
application of that system; it is up to the author/donor to decide if he or 
she is willing to distribute software through any other system and a licensee 
cannot impose that choice.

This section is intended to make thoroughly clear what is believed to be a 
consequence of the rest of this License.

8. If the distribution and/or use of the Program is restricted in certain 
countries either by patents or by copyrighted interfaces, the original 
copyright holder who places the Program under this License may add an 
explicit geographical distribution limitation excluding those countries, 
so that distribution is permitted only in or among countries not thus 
excluded. In such case, this License incorporates the limitation as if 
written in the body of this License.

9. The Free Software Foundation may publish revised and/or new versions of 
the General Public License from time to time. Such new versions will be 
similar in spirit to the present version, but may differ in detail to 
address new problems or concerns.

Each version is given a distinguishing version number. If the Program 
specifies a version number of this License which applies to it and 
"any later version", you have the option of following the terms and 
conditions either of that version or of any later version published by the 
Free Software Foundation. If the Program does not specify a version number 
of this License, you may choose any version ever published by the 
Free Software Foundation.

10. If you wish to incorporate parts of the Program into other free programs 
whose distribution conditions are different, write to the author to ask for 
permission. For software which is copyrighted by the Free Software 
Foundation, write to the Free Software Foundation; we sometimes make 
exceptions for this. Our decision will be guided by the two goals of 
preserving the free status of all derivatives of our free software and of 
promoting the sharing and reuse of software generally.

NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR 
THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE 
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE 
PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, 
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND 
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, 
YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO 
LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR 
THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 
POSSIBILITY OF SUCH DAMAGES.

END OF TERMS AND CONDITIONS
t   .s0   rpdb2 must not be imported as part of a package!iN(   t   DES(   t   _getfullpathnamei   g      N@c         C   s   t  |  | | | | |  S(   s  
    Use 'start_embedded_debugger' to invoke the debugger engine in embedded 
    scripts. put the following line as the first line in your script:

    import rpdb2; rpdb2.start_embedded_debugger(<some-password-string>)

    This will cause the script to freeze until a debugger console attaches.

    _rpdb2_pwd - The password that governs security of client/server communication
    fAllowUnencrypted - Allow unencrypted communications. Communication will
        be authenticated but encrypted only if possible.
    fAllowRemote - Allow debugger consoles from remote machines to connect.
    timeout - Seconds to wait for attachment before giving up. If None, 
        never give up. Once the timeout period expires, the debuggee will
        resume execution.
    source_provider - When script source is not available on file system it is
        possible to specify a function that receives a "filename" and returns
        its source. If filename specifies a file that does not fall under
        the jurisdiction of this function it should raise IOError. If this
        function is responsible for the specified file but the source is
        not available it should raise IOError(SOURCE_NOT_AVAILABLE). You can
        study the way source_provider_blender() works. Note that a misbehaving 
        function can break the debugger.
    fDebug  - debug output.

    IMPORTNAT SECURITY NOTE:
    USING A HARDCODED PASSWORD MAY BE UNSECURE SINCE ANYONE WITH READ
    PERMISSION TO THE SCRIPT WILL BE ABLE TO READ THE PASSWORD AND CONNECT TO 
    THE DEBUGGER AND DO WHATEVER THEY WISH VIA THE 'EXEC' DEBUGGER COMMAND.

    It is safer to use: start_embedded_debugger_interactive_password()    
    (   t   __start_embedded_debugger(   t
   _rpdb2_pwdt   fAllowUnencryptedt   fAllowRemotet   timeoutt   source_providert   fDebug(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   start_embedded_debuggerq  s    *c      
   C   s   t  d  j	 o d  Sn x t o | d  j	 o | i d  n | i   i d  } t | t |  d t } y t | |  | | | |  SWq t	 j
 o | i t
  q Xq Wd  S(   Ns   Please type password:s   
t   fstrict(   t   g_servert   Nonet   Truet   writet   readlinet   rstript
   as_unicodet   detect_encodingR   t   BadArgumentt   STR_PASSWORD_BAD(   R   R   R   R   R	   t   stdint   stdoutR   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt,   start_embedded_debugger_interactive_password  s$    
 c           C   s   t    S(   sg  
    Trace threads that were created with thread.start_new_thread()
    To trace, call this function from the thread target function.
    
    NOTE: The main thread and any threads created with the threading module 
    are automatically traced, and there is no need to invoke this function 
    for them. 

    Note: This call does not pause the script.
    (   t
   __settrace(    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   settrace  s    c           C   s   t    S(   sC   
    Pause the script for inspection at next script statement.
    (   t
   __setbreak(    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   setbreak  s    i   i   i   i    t    t
   RPDB_2_3_4c           C   s   t  S(   N(   t   RPDB_VERSION(    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   get_version  s    c           C   s   t  S(   N(   t   RPDB_COMPATIBILITY_VERSION(    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt#   get_interface_compatibility_version  s    t   CSimpleSessionManagerc           B   s   e  Z d  Z e d  Z d   Z d e d  Z d   Z d   Z	 d   Z
 d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z RS(   s   
    This is a wrapper class that simplifies launching and controlling of a 
    debuggee from within another program. For example, an IDE that launches 
    a script for debugging puposes can use this class to launch, debug and 
    stop a script.
    c      	   C   s   t  d d  d | d t d t  |  _ t |  _ h  h  t <} |  i i |  i | d t h  h  t	 <} |  i i |  i
 | d t h  h  t <} |  i i |  i | d t d  S(   NR   R   R   t   hostt
   fSingleUse(   t   CSessionManagerInternalR   t   Falset	   LOCALHOSTt   _CSimpleSessionManager__smt
   m_fRunningt   CEventUnhandledExceptiont   register_callbackt+   _CSimpleSessionManager__unhandled_exceptiont   CEventStatet%   _CSimpleSessionManager__state_calbackt
   CEventExitt,   _CSimpleSessionManager__termination_callback(   t   selfR   t   event_type_dict(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __init__   s    	c         C   s   |  i  i   d  S(   N(   R)   t   shutdown(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR5     s    s   utf-8c         C   s8   t  | | d t } t |  _ |  i i | | |  d  S(   NR   (   R   R   R'   R*   R)   t   launch(   R2   t   fchdirt   command_linet   encodingt   fload_breakpoints(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR6     s    	c         C   s   |  i  i   d  S(   N(   R)   t
   request_go(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR;      s    c         C   s   |  i  i   d  S(   N(   R)   t   detach(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR<   $  s    c         C   s   |  i  i   d  S(   N(   R)   t   stop_debuggee(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR=   (  s    c         C   s   |  i  S(   N(   R)   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   get_session_manager,  s    c         C   sX   |  i  i   } |  i  i   } | i } t i d j o t | |  d } n | | f S(   sl   
        Use this method to attach a debugger to the debuggee after an
        exception is caught.
        t   posixN(   R)   t   get_passwordt   get_server_infot   m_ridt   ost   namet   create_pwd_fileR   (   R2   R   t   sit   rid(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   prepare_attach0  s    	
c         C   s   t  d  |  i   d  S(   Nt   unhandled_exception_callback(   t   _printR;   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRI   J  s    
c         C   s   t  d  |  i   d  S(   Nt   script_paused(   RJ   R;   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRK   O  s    
c         C   s   t  d  d  S(   Nt   script_terminated_callback(   RJ   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRL   T  s    c         C   s   |  i    d  S(   N(   RI   (   R2   t   event(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __unhandled_exception\  s    c         C   s   |  i    d  S(   N(   RL   (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __termination_callback`  s    c         C   s7  | i  t j o d Sn |  i p% t d  t |  _ |  i   d Sn |  i i   o d Sn |  i i d g  d t	  } t
 |  d j o |  i   d Sn | d } | i t g   } t
 |  d j o |  i   d Sn | d } | d } t i i | d  } | t j o |  i   d Sn |  i   d S(   sE   
        Handle state change notifications from the debugge.
        Ns0   Simple session manager continues on first break.t   tid_listt   fAlli    ii   (   t   m_statet   STATE_BROKENR*   t   print_debugR   R;   R)   t   is_unhandled_exceptiont	   get_stackR'   t   lent   gett   DICT_KEY_STACKRC   t   patht   basenamet   DEBUGGER_FILENAMERK   (   R2   RM   t   slt   stt   st   et   function_namet   filename(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __state_calbackd  s4    

	







(   t   __name__t
   __module__t   __doc__R   R4   R5   R'   R6   R;   R<   R=   R>   RH   RI   RK   RL   R-   R1   R/   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR#     s   											t   CSessionManagerc           B   s<  e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d e
 d	  Z d
   Z d   Z d@ d d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d d  Z d d  Z d   Z d   Z  d   Z! d    Z" d!   Z# d"   Z$ d#   Z% d$   Z& d%   Z' d&   Z( d'   Z) d(   Z* d)   Z+ d*   Z, d+ d, d-  Z- d.   Z. d/   Z/ d0   Z0 e1 d1  Z2 d2   Z3 d3   Z4 d4   Z5 d5   Z6 d6   Z7 d7   Z8 d8   Z9 d9   Z: d:   Z; d;   Z< d<   Z= d=   Z> d>   Z? d?   Z@ RS(A   sa  
    Interface to the session manager.
    This is the interface through which the debugger controls and 
    communicates with the debuggee.

    Accepted strings are either utf-8 or Unicode unless specified otherwise.
    Returned strings are Unicode (also when embedded in data structures).

    You can study the way it is used in StartClient()
    c         C   sS   | d  j o* t |  p t  t | d t } n t | | | |  |  _ d  S(   NR   (   R   t   is_valid_pwdt   AssertionErrorR   R   R&   t   _CSessionManager__smi(   R2   R   R   R   R$   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    c         C   s   |  i  i   S(   N(   Rj   R5   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR5     s    c         C   s   |  i  i |  S(   s   
        'printer' is a function that takes one argument and prints it.
        You can study CConsoleInternal.printer() as example for use
        and rational.
        (   Rj   t   set_printer(   R2   t   printer(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRk     s    c         C   s   |  i  i | | |  S(   s=   
        Sends exception information to the printer.
        (   Rj   t   report_exception(   R2   t   typet   valuet   tb(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRm     s    c         C   s   |  i  i | | |  S(   s	  
        Receive events from the session manager. 
        The session manager communicates it state mainly by firing events.
        You can study CConsoleInternal.__init__() as example for use.
        For details see CEventDispatcher.register_callback()
        (   Rj   R,   (   R2   t   callbackR3   R%   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR,     s    	c         C   s   |  i  i |  S(   N(   Rj   t   remove_callback(   R2   Rq   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRr     s    c         C   s   |  i  i   S(   sW   
        Fire again all relevant events needed to establish the current state.
        (   Rj   t   refresh(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRs     s    s   utf-8c         C   s+   t  | | d t } |  i i | | |  S(   s~  
        Launch debuggee in a new process and attach.
        fchdir - Change current directory to that of the debuggee.
        command_line - command line arguments pass to the script as a string.
        fload_breakpoints - Load breakpoints of last session.

        if command line is not a unicode string it will be decoded into unicode
        with the given encoding
        R   (   R   R   Rj   R6   (   R2   R7   R8   R9   R:   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR6     s    c         C   s   |  i  i   S(   s{   
        Restart debug session with same command_line and fchdir arguments
        which were used in last launch.
        (   Rj   t   restart(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRt     s    c         C   s   |  i  i   S(   s   
        Return command_line and fchdir arguments which were used in last 
        launch as (last_fchdir, last_command_line).
        Returns (None, None) if there is no info.
        (   Rj   t   get_launch_args(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRu     s    c         C   s(   t  | | d t } |  i i | |  S(   s  
        Attach to a debuggee (establish communication with the debuggee-server)
        key - a string specifying part of the filename or PID of the debuggee.

        if key is not a unicode string it will be decoded into unicode
        with the given encoding
        R   (   R   R   Rj   t   attach(   R2   t   keyRD   R9   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRv     s    	c         C   s   |  i  i   S(   s(   
        Let the debuggee go...
        (   Rj   R<   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR<     s    c         C   s   |  i  i   S(   N(   Rj   t   request_break(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRx     s    c         C   s   |  i  i   S(   N(   Rj   R;   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR;     s    c         C   s:   t  | d t } t  | d t } |  i i | | |  S(   sC   
        Go (run) until the specified location is reached.
        R   (   R   R   Rj   t   request_go_breakpoint(   R2   Rb   t   scopet   lineno(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRy   #  s    c         C   s   |  i  i   S(   s<   
        Go until the next line of code is reached.
        (   Rj   t   request_step(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR|   .  s    c         C   s   |  i  i   S(   sN   
        Go until the next line of code in the same scope is reached.
        (   Rj   t   request_next(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR}   6  s    c         C   s   |  i  i   S(   s3   
        Go until end of scope is reached.
        (   Rj   t   request_return(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR~   >  s    c         C   s   |  i  i |  S(   sF   
        Jump to the specified line number in the same scope.
        (   Rj   t   request_jump(   R2   R{   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   F  s    c         C   sR   t  | d t } t  | d t } t  | d t } |  i i | | | | |  S(   s[  
        Set a breakpoint.
        
            filename - (Optional) can be either a file name or a module name, 
                       full path, relative path or no path at all. 
                       If filname is None or '', then the current module is 
                       used.
            scope    - (Optional) Specifies a dot delimited scope for the 
                       breakpoint, such as: foo or myClass.foo
            lineno   - (Optional) Specify a line within the selected file or 
                       if a scope is specified, an zero-based offset from the 
                       start of the scope.
            expr     - (Optional) A Python expression that will be evaluated 
                       locally when the breakpoint is hit. The break will 
                       occur only if the expression evaluates to true.
        R   (   R   R   Rj   t   set_breakpoint(   R2   Rb   Rz   R{   t   fEnabledt   expr(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   Q  s    	c         C   s   |  i  i | |  S(   s   
        Disable breakpoints

            id_list - (Optional) A list of breakpoint ids.
            fAll    - disable all breakpoints regardless of id_list.
        (   Rj   t   disable_breakpoint(   R2   t   id_listRQ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   p  s    c         C   s   |  i  i | |  S(   s   
        Enable breakpoints

            id_list - (Optional) A list of breakpoint ids.
            fAll    - disable all breakpoints regardless of id_list.
        (   Rj   t   enable_breakpoint(   R2   R   RQ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   {  s    c         C   s   |  i  i | |  S(   s   
        Delete breakpoints

            id_list - (Optional) A list of breakpoint ids.
            fAll    - disable all breakpoints regardless of id_list.
        (   Rj   t   delete_breakpoint(   R2   R   RQ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i   S(   sU   
        Return breakpoints in a dictionary of id keys to CBreakPoint values
        (   Rj   t   get_breakpoints(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    R   c         C   s   |  i  i |  S(   sH   
        Save breakpoints to file, locally (on the client side)
        (   Rj   t   save_breakpoints(   R2   t	   _filename(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i |  S(   sJ   
        Load breakpoints from file, locally (on the client side)
        (   Rj   t   load_breakpoints(   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i |  S(   s   
        Set trap-unhandled-exceptions mode.
        ftrap with a value of False means unhandled exceptions will be ignored.
        The session manager default is True.
        (   Rj   t   set_trap_unhandled_exceptions(   R2   t   ftrap(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i   S(   s5   
        Get trap-unhandled-exceptions mode.
        (   Rj   t   get_trap_unhandled_exceptions(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i | |  S(   s  
        Determine how to handle os.fork().
        
        ffork_into_child - True|False - If True, the debugger will debug the 
            child process after a fork, otherwise the debugger will continue
            to debug the parent process.

        ffork_auto - True|False - If True, the debugger will not pause before
            a fork and will automatically make a decision based on the 
            value of the ffork_into_child flag.
        (   Rj   t   set_fork_mode(   R2   t   ffork_into_childt
   ffork_auto(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i   S(   sl   
        Return the fork mode in the form of a (ffork_into_child, ffork_auto) 
        flags tuple.
        (   Rj   t   get_fork_mode(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i | |  S(   N(   Rj   RV   (   R2   RP   RQ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRV     s    c         C   s(   t  | d t } |  i i | | |  S(   NR   (   R   R   Rj   t   get_source_file(   R2   Rb   R{   t   nlines(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i | |  S(   N(   Rj   t   get_source_lines(   R2   R   RQ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i |  S(   st   
        Set frame index. 0 is the current executing frame, and 1, 2, 3,
        are deeper into the stack.
        (   Rj   t   set_frame_index(   R2   t   frame_index(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i   S(   st   
        Get frame index. 0 is the current executing frame, and 1, 2, 3,
        are deeper into the stack.
        (   Rj   t   get_frame_index(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i |  S(   sy   
        Toggle analyze mode. In analyze mode the stack switches to the
        exception stack for examination.
        (   Rj   t   set_analyze(   R2   t   fAnalyze(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i |  S(   s   
        Set host to specified host (string) for attaching to debuggies on 
        specified host. host can be a host name or ip address in string form.
        (   Rj   t   set_host(   R2   R$   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i   S(   N(   Rj   t   get_host(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i   S(   s  
        Calc servers (debuggable scripts) list on specified host. 
        Returns a tuple of a list and a dictionary.
        The list is a list of CServerInfo objects sorted by their age
        ordered oldest last.
        The dictionary is a dictionary of errors that were encountered 
        during the building of the list. The dictionary has error (exception)
        type as keys and number of occurances as values.
        (   Rj   t   calc_server_list(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   
  s    c         C   s   |  i  i   S(   s   
        Return CServerInfo server info object that corresponds to the 
        server (debugged script) to which the session manager is 
        attached.
        (   Rj   RA   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRA     s    i   t
   DEPRECATEDc         C   s9   | d j o
 | } n t  |  } |  i i | | |  S(   s  
        get_namespace is designed for locals/globals panes that let 
        the user inspect a namespace tree in GUI debuggers such as Winpdb.
        You can study the way it is used in Winpdb.

        nl - List of tuples, where each tuple is made of a python expression 
             as string and a flag that controls whether to "expand" the 
             value, that is, to return its children as well in case it has 
             children e.g. lists, dictionaries, etc...
             
        filter_level - 0, 1, or 2. Filter out methods and functions from
            classes and objects. (0 - None, 1 - Medium, 2 - Maximum).

        repr_limit - Length limit (approximated) to be imposed repr() of 
             returned items.
        
        examples of expression lists: 

          [('x', false), ('y', false)]
          [('locals()', true)]
          [('a.b.c', false), ('my_object.foo', false), ('another_object', true)]

        Return value is a list of dictionaries, where every element
        in the list corresponds to an element in the input list 'nl'.

        Each dictionary has the following keys and values:
          DICT_KEY_EXPR - the original expression string.
          DICT_KEY_REPR - A repr of the evaluated value of the expression.
          DICT_KEY_IS_VALID - A boolean that indicates if the repr value is 
                          valid for the purpose of re-evaluation.
          DICT_KEY_TYPE - A string representing the type of the experession's 
                          evaluated value.
          DICT_KEY_N_SUBNODES - If the evaluated value has children like items 
                          in a list or in a dictionary or members of a class, 
                          etc, this key will have their number as value.
          DICT_KEY_SUBNODES - If the evaluated value has children and the 
                          "expand" flag was set for this expression, then the 
                          value of this key will be a list of dictionaries as 
                          described below.
          DICT_KEY_ERROR - If an error prevented evaluation of this expression
                          the value of this key will be a repr of the 
                          exception info: repr(sys.exc_info())

        Each dictionary for child items has the following keys and values:
          DICT_KEY_EXPR - The Python expression that designates this child.
                          e.g. 'my_list[0]' designates the first child of the 
                          list 'my_list'
          DICT_KEY_NAME - a repr of the child name, e.g '0' for the first item
                          in a list.
          DICT_KEY_REPR - A repr of the evaluated value of the expression. 
          DICT_KEY_IS_VALID - A boolean that indicates if the repr value is 
                          valid for the purpose of re-evaluation.
          DICT_KEY_TYPE - A string representing the type of the experession's 
                          evaluated value.
          DICT_KEY_N_SUBNODES - If the evaluated value has children like items 
                          in a list or in a dictionary or members of a class, 
                          etc, this key will have their number as value.
        R   (   t   intRj   t   get_namespace(   R2   t   nlt   filter_levelt
   repr_limitt   fFilter(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   "  s    <
c         C   s"   t  | d t } |  i i |  S(   s  
        Evaluate a python expression in the context of the current thread
        and frame.

        Return value is a tuple (v, w, e) where v is a repr of the evaluated
        expression value, w is always '', and e is an error string if an error
        occurred.

        NOTE: This call might not return since debugged script logic can lead
        to tmporary locking or even deadlocking.
        R   (   R   R   Rj   t   evaluate(   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   i  s    c         C   s"   t  | d t } |  i i |  S(   sf  
        Execute a python statement in the context of the current thread
        and frame.

        Return value is a tuple (w, e) where w and e are warning and 
        error strings (respectively) if an error occurred.

        NOTE: This call might not return since debugged script logic can lead
        to tmporary locking or even deadlocking.
        R   (   R   R   Rj   t   execute(   R2   t   suite(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   {  s    c         C   s"   t  | d t } |  i i |  S(   s  
        Return matching completions for expression.
        Accepted expressions are of the form a.b.c

        Dictionary lookups or functions call are not evaluated. For 
        example: 'getobject().complete' or 'dict[item].complete' are
        not processed.

        On the other hand partial expressions and statements are 
        accepted. For example: 'foo(arg1, arg2.member.complete' will
        be accepted and the completion for 'arg2.member.complete' will
        be calculated.

        Completions are returned as a tuple of two items. The first item
        is a prefix to expr and the second item is a list of completions.
        For example if expr is 'foo(self.comp' the returned tuple can
        be ('foo(self.', ['complete', 'completion', etc...])
        R   (   R   R   Rj   t   complete_expression(   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i | |  S(   sE  
        Set the encoding that will be used as source encoding for execute()
        evaluate() commands and in strings returned by get_namespace().

        The encoding value can be either 'auto' or any encoding accepted by 
        the codecs module. If 'auto' is specified, the encoding used will be 
        the source encoding of the active scope, which is utf-8 by default.

        The default encoding value is 'auto'.

        If fraw is True, strings returned by evaluate() and get_namespace() 
        will represent non ASCII characters as an escape sequence.
        (   Rj   t   set_encoding(   R2   R9   t   fraw(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i   S(   s4   
        return the (encoding, fraw) tuple.
        (   Rj   t   get_encoding(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i |  S(   s6  
        Set the synchronicity mode. 
        
        Traditional Python debuggers that use the inspected thread (usually 
        the main thread) to query or modify the script name-space have to 
        wait until the script hits a break-point. Synchronicity allows the
        debugger to query and modify the script name-space even if its 
        threads are still running or blocked in C library code by using 
        special worker threads. In some rare cases querying or modifying data 
        in synchronicity can crash the script. For example in some Linux 
        builds of wxPython querying the state of wx objects from a thread 
        other than the GUI thread can crash the script. If this happens or 
        if you want to restrict these operations to the inspected thread, 
        turn synchronicity off.

        On the other hand when synchronicity is off it is possible to 
        accidentally deadlock or block indefinitely the script threads by 
        querying or modifying particular data structures.

        The default is on (True).
        (   Rj   t   set_synchronicity(   R2   t   fsynchronicity(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i   S(   N(   Rj   t   get_synchronicity(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i   S(   s   
        Get the session manager state. Return one of the STATE_* constants
        defined below, for example STATE_DETACHED, STATE_BROKEN, etc...
        (   Rj   t	   get_state(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i   S(   N(   Rj   t   get_thread_list(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i |  S(   s   
        Set the focused thread to the soecified thread.
        tid - either the OS thread id or the zero based index of the thread 
              in the thread list returned by get_thread_list().
        (   Rj   t
   set_thread(   R2   t   tid(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s"   t  | d t } |  i i |  S(   s}   
        Set the password that will govern the authentication and encryption
        of client-server communication.
        R   (   R   R   Rj   t   set_password(   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i   S(   sy   
        Get the password that governs the authentication and encryption
        of client-server communication.
        (   Rj   R@   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR@     s    c         C   s   |  i  i   S(   s   
        Get the encryption mode. Return True if unencrypted connections are
        not allowed. When launching a new debuggee the debuggee will inherit
        the encryption mode. The encryption mode can be set via command-line 
        only.
        (   Rj   t   get_encryption(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   
  s    c         C   s   |  i  i |  S(   s   
        Set the remote-connections mode. if True, connections from remote
        machine are allowed. When launching a new debuggee the debuggee will 
        inherit this mode. This mode is only relevant to the debuggee. 
        (   Rj   t
   set_remote(   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i   S(   s   
        Get the remote-connections mode. Return True if connections from 
        remote machine are allowed. When launching a new debuggee the 
        debuggee will inherit this mode. This mode is only relevant to the 
        debuggee. 
        (   Rj   t
   get_remote(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  i |  S(   sE  
        Set the environment variables mapping. This mapping is used 
        when a new script is launched to modify its environment.
        
        Example for a mapping on Windows: [('Path', '%Path%;c:\mydir')]
        Example for a mapping on Linux: [('PATH', '$PATH:~/mydir')]

        The mapping should be a list of tupples where each tupple is
        composed of a key and a value. Keys and Values must be either 
        strings or Unicode strings. Other types will raise the BadArgument 
        exception.

        Invalid arguments will be silently ignored.
        (   Rj   t   set_environ(   R2   t   envmap(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   *  s    c         C   s   |  i  i   S(   s9   
        Return the current environment mapping.
        (   Rj   t   get_environ(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   =  s    c         C   s   |  i  i   S(   s0   
        Stop the debuggee immediately.
        (   Rj   R=   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR=   E  s    N(A   Rd   Re   Rf   R4   R5   Rk   Rm   R,   Rr   Rs   R   R6   Rt   Ru   R   Rv   R<   Rx   R;   Ry   R|   R}   R~   R   R   R   R   R   R   R   R   R   R   R   R   RV   R   R   R   R   R   R   R   R   RA   R   R   R   R   R'   R   R   R   R   R   R   R   R   R@   R   R   R   R   R   R=   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRg     sx   
			
							
														
																		
G									
					
			t   CConsolec           B   sM   e  Z d  Z d d e d  Z d   Z d   Z d   Z d   Z	 d   Z
 RS(   s*   
    Interface to a debugger console.
    c         C   s   t  | | | |  |  _ d S(   s  
        Constructor of CConsole

        session_manager - session manager object.
        stdin, stdout - redirection for IO.
        fsplit - Set flag to True when Input and Ouput belong to different 
                 panes. For example take a look at Winpdb.
        N(   t   CConsoleInternalt   m_ci(   R2   t   session_managerR   R   t   fSplit(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   S  s
    c         C   s   |  i  i   S(   N(   R   t   start(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   l  s    c         C   s   |  i  i   S(   s.   
        Wait until the console ends.
        (   R   t   join(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   p  s    c         C   s   t  |  } |  i i |  S(   s   
        Set current filename for the console. The current filename can change
        from outside the console when the console is embeded in other 
        components, for example take a look at Winpdb. 
        (   R   R   t   set_filename(   R2   Rb   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   x  s    c         C   s   t  |  } |  i i | |  S(   s   
        Return the next possible completion for 'text'.
        If a command has not been entered, then complete against command list.
        Otherwise try to call complete_<command> to get list of completions.
        (   R   R   t   complete(   R2   t   textt   state(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   t  |  } |  i i |  S(   N(   R   R   Rl   (   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRl     s    N(   Rd   Re   Rf   R   R'   R4   R   R   R   R   Rl   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   N  s   				t
   CExceptionc           B   s   e  Z d  Z d   Z RS(   s0   
    Base exception class for the debugger.
    c         G   s   t  i |  |  d  S(   N(   t	   ExceptionR4   (   R2   t   args(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    (   Rd   Re   Rf   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t   BadMBCSPathc           B   s   e  Z d  Z RS(   s   
    Raised on Windows systems when the python executable or debugger script
    path can not be encoded with the file system code page. This means that
    the Windows code page is misconfigured.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t   NotPythonSourcec           B   s   e  Z d  Z RS(   sC   
    Raised when an attempt to load non Python source is made.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t   InvalidScopeNamec           B   s   e  Z d  Z RS(   s   
    Invalid scope name.
    This exception might be thrown when a request was made to set a breakpoint
    to an unknown scope.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   R   c           B   s   e  Z d  Z RS(   s   
    Bad Argument.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t   ThreadNotFoundc           B   s   e  Z d  Z RS(   s   
    Thread not found.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t	   NoThreadsc           B   s   e  Z d  Z RS(   s   
    No Threads.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t
   ThreadDonec           B   s   e  Z d  Z RS(   s   
    Thread Done.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t   DebuggerNotBrokenc           B   s   e  Z d  Z RS(   s   
    Debugger is not broken.
    This exception is thrown when an operation that can only be performed
    while the debuggee is broken, is requested while the debuggee is running.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t   InvalidFramec           B   s   e  Z d  Z RS(   s|   
    Invalid Frame.
    This exception is raised if an operation is requested on a stack frame
    that does not exist.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t   NoExceptionFoundc           B   s   e  Z d  Z RS(   s   
    No Exception Found.
    This exception is raised when exception information is requested, but no
    exception is found, or has been thrown.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t   CConnectionExceptionc           B   s   e  Z d    Z RS(   c         G   s   t  i |  |  d  S(   N(   R   R4   (   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    (   Rd   Re   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t   FirewallBlockc           B   s   e  Z d  Z RS(   s*   Firewall is blocking socket communication.(   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t
   BadVersionc           B   s    e  Z d  Z d   Z d   Z RS(   s   Bad Version.c         C   s   t  i |   | |  _ d  S(   N(   R   R4   t	   m_version(   R2   t   version(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    c         C   s   t  |  i  S(   N(   t   reprR   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __str__
  s    (   Rd   Re   Rf   R4   R   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   	t   UnexpectedDatac           B   s   e  Z d  Z RS(   s   Unexpected data.(   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t   AlreadyAttachedc           B   s   e  Z d  Z RS(   s   Already Attached.(   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t   NotAttachedc           B   s   e  Z d  Z RS(   s   Not Attached.(   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t   SpawnUnsupportedc           B   s   e  Z d  Z RS(   s   Spawn Unsupported.(   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s   t   UnknownServerc           B   s   e  Z d  Z RS(   s   Unknown Server.(   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   #  s   t   CSecurityExceptionc           B   s   e  Z d    Z RS(   c         G   s   t  i |  |  d  S(   N(   R   R4   (   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   )  s    (   Rd   Re   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   (  s   t   UnsetPasswordc           B   s   e  Z d  Z RS(   s   Unset Password.(   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   .  s   t   EncryptionNotSupportedc           B   s   e  Z d  Z RS(   s   Encryption Not Supported.(   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   3  s   t   EncryptionExpectedc           B   s   e  Z d  Z RS(   s   Encryption Expected.(   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   8  s   t   DecryptionFailurec           B   s   e  Z d  Z RS(   s   Decryption Failure.(   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   <  s   t   AuthenticationBadDatac           B   s   e  Z d  Z RS(   s   Authentication Bad Data.(   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   A  s   t   AuthenticationFailurec           B   s   e  Z d  Z RS(   s   Authentication Failure.(   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   F  s   t   AuthenticationBadIndexc           B   s&   e  Z d  Z d d d  Z d   Z RS(   s   Authentication Bad Index.i    c         C   s#   t  i |   | |  _ | |  _ d  S(   N(   R   R4   t   m_max_indext   m_anchor(   R2   t	   max_indext   anchor(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   M  s    	c         C   s   t  |  i |  i f  S(   N(   R   R   R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   S  s    (   Rd   Re   Rf   R4   R   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   K  s   c           C   s   t  i d d j S(   Ni    i   (   t   syst   version_info(    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   is_py3k^  s    c         C   sD   t    o t |   t j o t Sn t |   t j o t Sn t S(   N(   R   Rn   t   strR   t   unicodeR'   (   R_   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   is_unicodec  s
    s   utf-8c         C   sE   t  |   o |  Sn | o |  i |  } n |  i | d  } | S(   Nt   replace(   R   t   decode(   R_   R9   R   t   u(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   n  s    c         C   s   t    oI t |   o |  Sn | o |  i |  } n |  i | d  } | Sn t |   p |  Sn | o |  i |  } n |  i | d  } | S(   NR   (   R   R   R   t   encode(   R_   R9   R   R`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   as_string{  s    
c         C   sE   t  |   p |  Sn | o |  i |  } n |  i | d  } | S(   NR   (   R   R   (   R_   R9   R   t   b(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   as_bytes  s    s   gnome-terminalt   nt_debugt   screent   mact   darwinR?   s   start "rpdb2 - Version s8    - Debuggee Console" cmd.exe /K ""%(exec)s" %(options)s"t   nts<   %(term)s -e %(shell)s -c '%(exec)s %(options)s; %(shell)s' &sM   Terminal --disable-server -x %(shell)s -c '%(exec)s %(options)s; %(shell)s' &t   TerminalsT   gnome-terminal --disable-factory -x %(shell)s -c '%(exec)s %(options)s; %(shell)s' &s   %(exec)s %(options)ss/   screen -t debuggee_console %(exec)s %(options)st   RPDBTERMt	   COLORTERMt   TERMt   KDEt   GNOMEsY   kreadconfig --file kdeglobals --group General --key TerminalApplication --default konsolet   xtermt   rxvts   .rpdb2_settingst	   passwordst   breakpointst   rpdb2_breakpointsid   g      ?g      @i   g       @g      @g      @s	   127.0.0.1t	   localhosti8  i   t   Ct   Lt   Rt   Et   *t   Bt   Dt   >t   +t   -t   ^s   *** iN   s   
> s   
Analayze> s   RPDB - The Remote Python Debugger, version %s,
Copyright (C) 2005-2008 Nir Aides.
Type "help", "copyright", "license", "credits" for more information.s/   Hit Return for more, or q (and Return) to quit:i   s4   Operation failed since no traced threads were found.s   Attaching to debuggee...s   The debugger does not know how to open a new console on this system. You can start the debuggee manually with the -d flag on a separate console and then use the 'attach' command to attach to it.s   Alternatively, you can use the screen utility and invoke rpdb2 in screen mode with the -s command-line flag as follows: 
screen rpdb2 -s some-script.py script-arg1 script-arg2...s   Starting debuggee...s   Stopping debuggee...s,   Debuggee failed to start in a timely manner.s,   Textual output will be done at the debuggee.s5   The operation will continue to run in the background.sB   In analyze mode the globals and locals dictionaries are read only.s   Breakpoints were loaded.s   Breakpoints were saved.s0   A problem occurred while saving the breakpoints.s1   A problem occurred while loading the breakpoints.s   Breakpoints were not saved.s   Breakpoints were not loaded.s   Breakpoints file was not found.s   No Breakpoints were found.s   Bad File Name.s6   Some breakpoints were not loaded, because of an error.s   Bad expression '%s'.s   File '%s' not found.s   If the X server (Windowing system) is not started you need to use rpdb2 with the screen utility and invoke rpdb2 in screen mode with the -s command-line flag as follows: 
screen rpdb2 -s some-script.py script-arg1 script-arg2...s   No exception was found.s   Scope '%s' not found.s   Breakpoint not found.s   Thread was not found.s   No threads were found.s   Thread is running.s   Focus was set to chosen thread.sK   Argument is not allowed in analyze mode. Type 'help analyze' for more info.sJ   Command is not allowed in analyze mode. Type 'help analyze' for more info.s   Analyze mode was set to: %s.s   Bad Argument.s   The psyco module was detected. The debugger is incompatible with the psyco module and will not function correctly as long as the psyco module is imported and used.st   The modules: %s, which are incompatible with the debugger were detected and can possibly cause the debugger to fail.s   The signal %s(%d) was intercepted inside debugger tracing logic. It will be held pending until the debugger continues. Any exceptions raised by the handler will be ignored!sZ   Exception %s raised by handler of signal %s(%d) inside debugger tracing logic was ignored!s   Debuggee has terminated.sC   Debuggee has to be waiting at break point to complete this command.s8   Debuggee is waiting at break point for further commands.s5   Already attached. Detach from debuggee and try again.s=   Not attached to any script. Attach to a script and try again.s+   Failed to communicate with debugged script.su   Command returned the following error:
%(type)s, %(value)s.
Please check stderr for stack trace and report to support.s&  The debugger can not launch the script since the path to the Python executable or the debugger scripts can not be encoded into the default system code page. Please check the settings of 'Language for non-Unicode programs' in the Advanced tab of the Windows Regional and Language Options dialog.s   Lost connection to debuggee.s   A firewall is blocking the local communication chanel (socket) that is required between the debugger and the debugged script. Please make sure that the firewall allows that communication.sB   A debuggee was found with incompatible debugger version %(value)s.sx   While attempting to find the specified debuggee at least one debuggee was found that uses incompatible version of RPDB2.s   Unexpected data received.s   While attempting to find debuggee, at least one debuggee denied connection because of mismatched passwords. Please verify your password.s9   Communication is denied because of un-matching passwords.sw   While attempting to find debuggee, at least one debuggee denied connection since it accepts encrypted connections only.s2   Debuggee will only talk over an encrypted channel.s(   Bad packet was received by the debuggee.s   Debuggee does not support encrypted mode. Either install the python-crypto package on the debuggee machine or allow unencrypted connections.s+   Password has been set to a random password.s   Please type a password:s   Password has been set.s/   The --pwd flag is only supported on NT systems.sH   A password should be set to secure debugger client-server communication.s    Bad data received from debuggee.s   Bad data received from file.s   Failed to attachs   Failed to attach to '%s'.s   Debug Channel is%s encrypted.t   NOTs   Successfully attached to '%s'.s   Requesting script to stop.s   Detaching from script...s   Detached from script.s   Failed to find script.s.   WARNING: There is more than one debuggee '%s'.sW   The debugger was not able to set the host to '%s'.
The following error was returned:
%ss#   Failed to get source from debuggee.s   Connecting to '%s'...s   No scripts to debug on '%s'sD   Scripts to debug on '%s':

   pid    name
--------------------------s   Stack trace for thread %d:

   Frame  File Name                     Line  Function                 
------------------------------------------------------------------------------s+   Source lines for thread %d from file '%s':
s   List of active threads known to the debugger:

    No    Tid  Name             State                 
-----------------------------------------------s   List of breakpoints:

 Id  State      Line  Filename-Scope-Condition-Encoding
------------------------------------------------------------------------------s^    %2d  %-8s  %5d  %s
                      %s
                      %s
                      %ss   Encryption is not supported since the python-crypto package was not found. Either install the python-crypto package or allow unencrypted connections.s   Password is not set.s   Password is set to: "%s"s   The password should begin with a letter and continue with any combination of digits, letters or underscores ('_'). Only English characters are accepted for letters.s   Force encryption mode: %ss   Allow remote machines mode: %ss   Encoding is set to: %ss   Encoding was set to: %ss:   The specified encoding was not recognized by the debugger.s#   The current environment mapping is:s+   The current environment mapping is not set.s   Can not process command when thread is running unless synchronicity mode is turned on. Type 'help synchro' at the command prompt for more information.s$   The synchronicity mode is set to: %ss,   Trap unhandled exceptions mode is set to: %ss.   Trap unhandled exceptions mode was set to: %s.s   Fork mode is set to: %s, %s.s   Fork mode was set to: %s, %s.s   Debugger modifications to the original bindings of the local namespace of this frame will be committed before the execution of the next statement of the frame. Any code using these variables executed before that point will see the original values.s   Warning: %ss   Namespace Warnings   *** WARNING ***s6   Number of items exceeds capacity of namespace browser.s&   Output length exeeds maximum capacity.t   childt   parentt   manualt   autot	   encrypteds
   plain-textt   enabledt   disableds   .bpls   .pys   .pyws   .sos   .pycs   .pyds   .pyot   ?s   <module>s,   Blender script source code is not available.s   Source code is not available.t   :t   ,s   rpdb2.pys   threading.pys   waiting at break pointt   brokent   runningt   analyzet   detachedt	   detachingt   spawningt	   attachingR   t   stackt	   code_lists   current tidt   linesRb   t   first_linenot   frame_linenoRM   R   RD   R   t   fvalidRn   t   subnodest
   n_subnodest   errort   rpdb_exception_infot   ONt   OFFs   ﻿s   # -*- coding: %s -*-
t   rawt   __rawi   i   i   i  t   excludet   includet   dispatcher_methodt	   bytearrayt   bytesR   t   str8R   R   t   longt   floatt   boolt   NoneTypet   psycot   pdbt   bdbt   doctests   <?xml version='1.0'?>
<methodCall>
<methodName>dispatcher_method</methodName>
<params>
<param>
<value><string>%s</string></value>
</param>
</params>
</methodCall>i   i7   s   ...s   Error: No attribute.s   /+=s   _-#t   __builtin__t   builtinsc         O   s#   z | | |   Wd  |  i    Xd  S(   N(   t   set(   RM   t   fooR   t   kwargs(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   job_wrappero  s    c            sx   t  |  \ } } t i         f d   } | i |  z | i   | i   Wd  | i   Xt  |  d  S(   Nc              s   t        S(    (   RD  (    (   R   RB  RM   RC  (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   <lambda>  s    (   t   g_alertable_waiterst	   threadingt   Eventt   appendt   acquiret	   notifyAllt   releaset	   safe_wait(   R   R   RB  R   RC  t   lockt   jobst   f(    (   R   RC  RB  RM   s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   send_jobx  s    
c         C   s   g  } t  i   } |  | f t | <zt t |  |  x` t |  d j oL | i d  } y |   Wn n Xt |  d j o t i d  q5 q5 WWd  t | =Xd  S(   Ni    g?(   t   threadt	   get_identRF  RM  RW   t   popt   timet   sleep(   RN  R   RO  R   t   job(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   alertable_wait  s     c         C   sw   xp t  oh y t i   } |  i |  SWq | d  j o q n | t i   | 8} | d j o d  Sqn q Xq Wd  S(   Ni    (   R   RU  t   waitR   (   RN  R   t   t0(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRM    s     t
   _stub_typec           B   s   e  Z RS(    (   Rd   Re   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR[    s   c         C   s   |  i  |  S(   N(   R   (   R_   R`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   _rpdb2_bytes  s    t   setsc           B   s   e  Z e Z e Z e Z RS(    (   Rd   Re   R[  t   Sett   BaseSett   ImmutableSet(    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR]    s   c         C   sF   t    o t |   Sn t |   } t | t t i  d t } | S(   NR   (   R   t   inputt	   raw_inputR   R   R   R   R   (   R_   t   i(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   _raw_input  s
    
c         C   si   t  |   }  t |  } t |  | d t }  t |  |  }  | o | i |  d  n | i |   d  S(   NR   s   
(   R   R   R   R'   R   R   (   R_   RP  t   feolR9   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRJ     s    c         C   sw   y% |  i  } | d  j o t   Sn Wn t   Sn Xy t i |  | SWn n X| i   i d  o d Sn d S(   Nt   utf_8s   utf-8t   ascii(   R9   R   t   detect_localet   codecst   lookupt   lowert
   startswith(   t   fileR9   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   	  s    	c          C   sf   t  i   d }  |  d  j o d Sn y t i |   |  SWn n X|  i   i d  o d Sn d S(   Ni   Rg  Rf  s   utf-8(   t   localet   getdefaultlocaleR   Ri  Rj  Rk  Rl  (   R9   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRh  	  s    c         C   sO   t  |   } d | j o | i d  d } n | i t d  p t  | S(   Nt   'i   R    (   t   safe_strt   splitRl  Rd   Ri   (   t   cR_   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   class_name1	  s
    c         C   s`   t  |  |  } | i d  p | Sn | i t i  } | d j o | Sn d | | } | S(   Ns   ...i(   t   calc_suffixRl  t   findRC   t   sep(   RZ   t   nt   suffixt   indext   clip(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   clip_filename=	  s    c         C   s    y t  |   SWn d Sn Xd  S(   Ns   N/A(   R   (   t   x(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRq  L	  s    c         C   s    y t  |   SWn d Sn Xd  S(   Ns   N/A(   R   (   R}  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   safe_reprU	  s    c         C   s8   t  |   } d | j o | Sn | i d  d } | S(   NRp  i   (   R~  Rr  (   t   tt   rtR^   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   parse_type^	  s
    c      
   C   sR  t  d | t |   d  } d } d } y x | D] } t |  t j o | d j o q3 n | t | | t |  | |  7} | d 7} | t |  j  o@ t |  | j o- t | d <| i d  p | d 7} n Pn | t |  j  p | d j o |  d d	 j o | d
 7} q3 q3 WWn t j
 o t | d <n Xt |  |  S(   Ni    i   R   t   _rpdb2_argsR   t   m_rpdb2_pwdi   s   ...t   (s   , (   s   _rpdb2_argss
   _rpdb2_pwds   m_rpdb2_pwd(	   t   maxRW   Rn   R   t   repr_ltdR'   t   endswitht   AttributeErrorR   (   t   patternt   lt   lengthR9   t   is_validR_   Rz  Rc  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   repr_listg	  s(      #
&
1c   	      C   s  t  d | t |   d  } d } d } yNxG| D]?} t |  t j o | d j o q3 n | | } | t | | t |  | |  7} t |  | j o- t | d <| i d  p | d 7} n Pn | d t | | t |  | |  7} | d	 7} | t |  j  o@ t |  | j o- t | d <| i d  p | d 7} n Pn | t |  j  o | d
 7} q3 q3 WWn t j
 o t | d <n Xt |  |  S(   Ni    i   R   R  R   R  s   ...s   : i   s   , (   s   _rpdb2_argss
   _rpdb2_pwds   m_rpdb2_pwd(	   R  RW   Rn   R   R  R'   R  R  R   (	   R  t   dR  R9   R  R_   Rz  t   kt   v(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   repr_dict	  s6      
#
'
&
c         C   sS   y5 |  i  |  }  t |  | |  } d | d d SWn t |  | |  Sn Xd  S(   Ns   bytearray(bi   t   )(   R   t   repr_unicodet   repr_str_raw(   R_   R  R9   R  t   r(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   repr_bytearray	  s    c         C   sO   y1 |  i  |  }  t |  | |  } d | d SWn t |  | |  Sn Xd  S(   NR   i   (   R   R  R  (   R_   R  R9   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   repr_bytes	  s    c         C   sO   y1 |  i  |  }  t |  | |  } d | d SWn t |  | |  Sn Xd  S(   NR_   i   (   R   R  R  (   R_   R  R9   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   repr_str8	  s    c         C   sQ   y3 t  |  | d t }  t |  | |  } | d SWn t |  | |  Sn Xd  S(   NR   i   (   R   R   R  R  (   R_   R  R9   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   repr_str	  s    c         C   s   d d g t    } d } xr |  D]j } t |  | j o t | d <| d 7} Pn t |  d j  o | t |  | d !7} q  | | 7} q  Wd | j o t d	 |  Sn d
 | j o t d |  Sn t d	 | i d d   S(   Ni   i   R   i    s   ...i   iRp  s   u'%s't   "s   u"%s"s   \'(   R   RW   R'   t   ordR   R   R   (   R_   R  R  Rz  t   rsRs  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  	  s      

c         C   s\   t  |   o
 t } n t } t |   | j o t | d <|  |  | }  n t t |    S(   Ni    (   R   t   ELLIPSIS_UNICODEt   ELLIPSIS_BYTESRW   R'   R   R   (   R_   R  R  t   eli(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  
  s    

c         C   sE   t  |   } t |  | j o t | d <| |  d } n t |  S(   Ni    s   ...(   R   RW   R'   R   (   R  R  R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   repr_base
  s
    
c         C   s^  y?t  d |  } yX t |  t  o t d |  | | |  Sn t |  t  o t d |  | | |  Sn Wn t j
 o n Xt |  t i  o t d |  | | |  Sn t |  t i  o t d |  | | |  Sn t |  t	  o t d |  | | |  Sn t |  t
  o t d |  | | |  Sn t |  t  o t d |  | | |  Sn | t j o6 t |   t t t t t g j o t |  | |  Sn t |   t j o t |  | |  Sn t |   t j o t |  | | |  Sn t |   t j o t |  | | |  Sn t |   t j o t |  | | |  Sn t |   t j o t |  | | |  Sn t |   t t t t t d   g j o t |  | |  Sn t  | d <t! |   |  } t" |  | j o | d	 7} n | t j o
 d
 } n y t# | | d t$ } | SWn n Xt% i&   } t# | |  } | SWn t'   t# d  Sn Xd  S(   Ni    s   frozenset([%s])s	   set([%s])s   sets.Set([%s])s   sets.ImmutableSet([%s])s   [%s]s   (%s)s   {%s}s   ...s   utf-8R   s   N/A((   R  t
   isinstancet	   frozensetR  RA  t	   NameErrorR]  R^  R`  t   listt   tuplet   dictR  t   ENCODING_RAW_IRn   R   R   R4  R5  R6  R  R  R  R  R  R  R9  R   R8  R7  R   R  R'   R~  RW   R   R   R   t   getfilesystemencodingt   print_debug_exception(   R}  R  R9   R  t   y(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  (
  sd    /(

c   	      C   s   t  p d  Sn t i   } t i |  } t i d |  d | t |  d } t i d  } t i i	 | i
 i  } | i } | i
 i } d | | | | |  f } t | t i  d  S(   Ns   %H:%M:%Ss   .%03di  i   s   %s %s:%d in %s: %s(   t   g_fDebugRU  t	   localtimet   strftimeR   R   t	   _getframeRC   RZ   R[   t   f_codet   co_filenamet   f_linenot   co_nameRJ   t
   __stderr__(	   t   _strR  R  R_   RP  Rb   R{   RD   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRT   u
  s    (	c         C   sD   t  o |  o d Sn t i   \ } } } t | | | |   d S(   s8   
    Print exceptions to stdout when in debug mode.
    N(   R  R   t   exc_infot   print_exception(   t   fForceR  R  Rp   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  
  s    t   CFileWrapperc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s   | |  _  d  S(   N(   t   m_f(   R2   RP  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   
  s    c         C   s   t  | |  i d t d  S(   NRe  (   RJ   R  R'   (   R2   R_   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   
  s    c         C   s   |  i  i |  S(   N(   R  t   __getattr__(   R2   RD   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  
  s    (   Rd   Re   R4   R   R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  
  s   		c      
   C   sZ   t  o | o d Sn z0 t i   t i |  | | d t t i  Wd t i   Xd S(   s8   
    Print exceptions to stderr when in debug mode.
    NRm  (	   R  t   g_traceback_lockRJ  t	   tracebackR  R  R   t   stderrRL  (   R  R  Rp   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  
  s    
&c           C   sJ   t  t j o9 z' t i   t i d t t i   Wd t i	   Xn d S(   s8   
    Print exceptions to stdout when in debug mode.
    Rm  N(
   R  R   R  RJ  R  t   print_stackR  R   R  RL  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  
  s
    
c         C   s'   y t  |  t  t SWn t Sn Xd  S(   N(   t	   mygetfileR'   R   (   RZ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   myisfile
  s
    c         C   s  t  i i |   o< | p d  Sn t |  d  } | i   } | i   | Sn t  i i |   } xY t oQ t  i i |  o Pn t  i i |  } | | d g j o
 t	  n | } qd Wt
 i |  p
 t	  n t i |  } y% | i |  t |  d  } | SWn t	  n Xd  S(   NR  R   i   (   RC   RZ   t   isfilet   opent   readt   closet   dirnameR   t   existst   IOErrort   zipfilet
   is_zipfilet	   zipimportt   zipimportert   get_dataRW   (   RZ   t
   fread_fileRP  t   dataR  t   _dt   z(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  
  s0    
 

c         C   sj  |  i    }  t |   d j o d	 Sn t |   o# t |   \ } } | | d f Sn |  d d
 j o |  d } | i |  d  } | d j o# t |  \ } } | | d f Sqft | |   \ } } | | d i    } | | | f Snw |  i d  } | d j o# t |   \ } } | | d f Sn8 |  | d i    } t |  |   \ } } | | | f Sd S(   sI   
    Split command line to a 3 elements tuple (path, filename, args)
    i    R   R  Rp  i   it    N(   R   R   R   (   R  Rp  (   t   stripRW   R  t
   split_pathRv  (   R8   t   _pathR   t   _command_lineRc  Rb   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt%   split_command_line_path_filename_args
  s,    
c         C   s   t  i i |   \ } } | d t  i i t  i i g j o[ |  t |  t |  d !t  i i t  i i g j o% | |  t |  t |  d !} n | | f S(   Nii   (   RC   RZ   Rr  Rw  t   altsepRW   (   RZ   R  Rb   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s
    #6%c         C   s   t    p& t |   t j o* t |  t j o t i i |  |  Sn t i   } t |   t j o |  i |  }  n t |  t j o | i |  } n t i i |  |  S(   N(	   R   Rn   R   RC   RZ   R   R   R  R   (   R  R[   R9   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   my_os_path_join+  s    0c      
   C   s  |  i  i d d   } |  i i } | i d  o1 | d  j o | Sqb t t i i	 |   } n | t
 j o t
 | Sn | d  j o t i i |  } t i i	 |  } t | |  } t i i |  o* t |  } t |  } | t
 | <| Sn y0 t | d t } t |  } | t
 | <| SWqBt j
 o qBXn t i i |  o* t |  } t |  } | t
 | <| Sn y0 t | d t } t |  } | t
 | <| SWn# t j
 o t |  } | Sn Xd  S(   Nt   __file__t   <t   fModules(   t	   f_globalsRX   R   R  R  Rl  t   CalcScriptNameRC   RZ   R[   t   g_frames_pathR  R  t   isabst
   my_abspatht   winlowert   FindFileR   R  (   t   framet   globals_filenameRb   R  R[   RZ   t   abspatht   lowered(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   calc_frame_path;  sJ    

	

c         C   sG   |  d  d j o |  Sn t  i d j o t |   Sn t  i i |   S(   s   
    We need our own little version of os.path.abspath since the original
    code imports modules in the 'nt' code path which can cause our debugger
    to deadlock in unexpected locations.
    i   R  R   (   RC   RD   t   my_abspath1RZ   R  (   RZ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  n  s
    c         C   s   |  o* y t  |   }  Wqc t j
 o qc Xn3 y t i   }  Wn t j
 o t i   }  n Xt i i |   } t |  d j o0 | d d !d j o | d  i	   | d } n | S(   sG   
    Modification of ntpath.abspath() that avoids doing an import.
    i   i   R  (
   R   t   WindowsErrorRC   t   getcwdt   UnicodeDecodeErrort   getcwduRZ   t   normpathRW   t   upper(   RZ   t   np(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    	'c         C   s   |  i  t  o t Sn |  i  t  o t Sn t i |  |   }  xK t d d  D]: } t |  |  } | i d  o d | j o t SqR qR Wt	   o t Sn y t
 i |   t SWn t Sn Xd  S(   Ni   i
   s   #!t   python(   R  t   PYTHON_FILE_EXTENSIONR   t   PYTHONW_FILE_EXTENSIONt   g_found_unicode_filesRX   t   ranget   get_source_lineRl  R   t   compilert	   parseFileR'   (   RZ   R{   t   line(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   IsPythonSourceFile  s"     
c         C   sC   t  i i |   } t  i i |  \ } } | t j o | Sn | S(   N(   RC   RZ   R[   t   splitextt   PYTHON_EXT_LIST(   Rb   t	   _basenamet
   modulenamet   ext(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   CalcModuleName  s
    c         C   s   |  i  t  o |  Sn |  i  t  o |  Sn |  i  t  o |  d  t } | Sn |  d  i  t  o |  d  } | Sn | o |  Sn |  t } | S(   Nii(   R  R  R  t   PYTHONW_SO_EXTENSION(   Rb   t   fAllowAnyExtt
   scriptname(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    

c         C   sN  |  d j o
 t   n |  i d  } | d j o |  |  } |  | d } n d } |  } t i |  } t | d  p | i d  j o) t |  } t | t	 |   } | Sn t
 i i | i  p) t |  } t | t	 |   } | Sn t
 i i | i  \ } } | i d  o t
 i i |  } n t |  }	 t	 |	  }
 |
 S(   NR   R    ii   R  R4   (   R  t   rfindR   t   modulest   hasattrR  R   t   FindModuleDirR  R  RC   RZ   R  R  R  R  R  (   t   module_namet	   dot_indexR  R  t   mt
   parent_dirt
   module_dirt   rootR  R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s.    

!c         C   s  t  |   } t i i |  \ } } | i d d  i d d  i d d  } g  } xv t t i i    D]_ \ } } t  |  } | d i	 | d  o/ | i
 t |  | f  | | j o Pq qj qj W| i   | i   x | D] \ }	 }
 y t |
  } Wn t j
 o
 q n X| |	 } | d j o | | } n t | | i d   | } t | d t } t |  o | Sn | d 7} | i t  o t |  o | Sq q Wt  d  S(   Ns   \R    t   /R  R   R  t   w(   R  RC   RZ   R  R   R  R   R  t   itemsRl  RI  RW   t   sortt   reverseR  R  R  R  R  R'   R  R  R  (   Rb   R  R  R  t   root_dottedt
   match_listR  R	  t   lowered_module_namet   matched_lent   matched_moduleR  Ry  RZ   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   FindFileAsModule  s<    * 

 

c         C   sa  |  t  j o |  Sn |  i d  o
 t  n |  i d  }  t i i |   }  | oR t i i |   p |  i d  o. y t t	 |    SWq t j
 o q Xn | o= y# t
 |  | d t d t } | SWq t j
 o q Xn t i i |   p |  i d  o z d } t |   } t |  } t | |  } t |  o | Sn | d 7} | i t  o t |  o | Sn d } t  Wd t   oK t |  o> t i   } t | |  } d | j o | t  | <n | Sn Xn t |  |  } y t i   t i   g }	 Wn" t j
 o t i   g }	 n Xt i d	 }
 | |	 t t i |
 i t i  } z d } xy | D]q } t | |  } t |  } t |  } t |  o | Sn | d 7} | i t  o t |  o | SqqWd } t  Wd t   oK t |  o> t i   } t | |  } d | j o | t  | <n | Sn Xd S(
   s   
    FindFile looks for the full path of a script in a rather non-strict
    and human like behavior.

    ENCODING:
    filename should be either Unicode or encoded with sys.getfilesystemencoding()!
    Returned value is encoded with sys.getfilesystemencoding().

    It will always look for .py or .pyw files even if a .pyc or no 
    extension is given.

    1. It will check against loaded modules if asked.
    1. full path (if exists).
    2. sources_paths.
    2. current path.
    3. PYTHONPATH
    4. PATH
    R  s   '"R    R  R  R  NR  t   PATH(   R  Rl  R  R  RC   RZ   t
   expanduserR  R  R  R  R'   R   R  R  R  R  R  R   R   R   R  R   R  R  R  t   environt   g_initial_cwdRr  t   pathsepR  (   Rb   t   sources_pathsR  R  R  R  R  t   fset   _lt   cwdt   env_patht   pathst   pRP  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  4  s    
+			#

% 

c         C   sE   |  d j o t  Sn y t |   t SWn t j
 o t  Sn Xd  S(   NR   (   R'   R  R   R  (   Rb   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   IsFileInPath  s    
c         C   s6   x/ t  i i   D] } | i |   o t Sq q Wt S(   N(   RC   R  t   keysRl  R   R'   (   R  R`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   IsPrefixInEnviron  s
     c          C   s  t  t i j o& t i t  }  t |   o |  Sq6 n t t i j o& t i t }  t |   o |  Sql n t t  o; t i t	  \ } }  | d j o t |   o |  Sq n' t t
  o t t  o t Sq n t t  o t Sn t t  o t Sn t  d S(   sK   
    Calc the unix command to start a new terminal, for example: xterm
    i    N(   R   RC   R  R$  R   R&  t
   KDE_PREFIXt   commandst   getstatusoutputt   KDE_DEFAULT_TERM_QUERYt   GNOME_PREFIXt   GNOME_DEFAULT_TERMt   XTERMt   RXVTR   (   t   termR_   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   CalcTerminalCommand  s(    c         C   sB   |  i  d d  i  d d  }  d |  }  |  i  d d  }  d |  S(	   s   
    Calculate what to put in popen to start a given script.
    Starts a tiny Applescript that performs the script action.
    s   \s   \\R  s   \"s-   tell application "Terminal" to do script "%s"Rp  s   '\''s   osascript -e '%s'(   R   (   t   command(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   CalcMacTerminalCommand  s    
c         C   s"   t  i d j o |  i   Sn |  S(   s   
    return lowercase version of 'path' on NT systems.
    
    On NT filenames are case insensitive so lowercase filenames
    for comparison purposes on NT.
    R   (   RC   RD   Rk  (   RZ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  
  s    c         C   s1  d t  i j o
 t  n |  i d  o t t   n t i i |   } y7 t  i d i |  } | i	   } d i
 |  d SWn t j
 o t |  } t  i d i   } d } x8 | D]0 } t | i    } | | j o | } Pq q W| d j o
 t  n | i	   } d i
 |  d Sn Xd S(   s  
    Return source code of the file referred by filename.
    
    Support for debugging of Blender Python scripts.
    Blender scripts are not always saved on disk, and their 
    source has to be queried directly from the Blender API.
    http://www.blender.org
    s   Blender.TextR  s   
N(   R   R  R  Rl  t   BLENDER_SOURCE_NOT_AVAILABLERC   RZ   R[   RX   t   asLinesR   R  R  R   t   getName(   Rb   R   R  R%  RP  t   tlistt   _tRx  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   source_provider_blender  s.    

 	
c         C   s5   t  |   } | d  t t  j o | d } n | S(   Ni   (   R  R   t   ENCODING_UTF8_PREFIX_1(   Rb   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   source_provider_filesystemL  s    c      	   C   s$  d  } t } y! t d  j o t |   } n Wn: t j
 o. t i   d } t | i j o   qj n Xy! | d  j o t |   } n Wn: t j
 o. t i   d } t	 | i j o   q n X| d  j o t
 |   } t } n t |  } t |  p t | |  } n | | | f S(   Ni   (   R   R'   t   g_source_provider_auxR  R   R  t   SOURCE_NOT_AVAILABLER   R8  R3  R:  R   t   ParseEncodingR   R   (   Rb   t   sourcet   ffilesystemR  R9   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   V  s.    
c         C   s   t  i |  |   }  |  t j o t |  Sn t |   \ } } } | i t d  t d   } | i t d   } | | | f t |  <| | | f S(   Ns   
s   
(   R  RX   t   g_lines_cacheR   R   R   Rr  (   Rb   R>  R9   R?  R%  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   lines_cachey  s    c         C   s4   t  |   \ } } } t d  i |  } | | f S(   Ns   
(   RA  R   R   (   Rb   R%  R9   R?  R>  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   get_source  s    c         C   sL   t  |   \ } } } | t |  j o t d  Sn | | d t d  S(   NR   i   s   
(   RA  RW   R   (   Rb   R{   R%  R9   R?  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    c         C   se   y t  |   \ } } } | SWnA t j
 o5 t i   d } t | i j p t | i j Sn Xd  S(   Ni   (   RA  R  R   R  R3  R   R<  (   Rb   R%  R9   R?  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   is_provider_filesystem  s    c         C   s   t  |   \ } } } | S(   N(   RA  (   Rb   R%  R9   R?  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   get_file_encoding  s    c         C   sd   |  i  d  o" |  t d  i   d } | Sn |  i  d  o |  t d  i   } | Sn d  S(   Ns   # -*- coding: i    s   # vim:fileencoding=(   Rl  RW   Rr  R  R   (   R  R`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   ParseLineEncoding  s    c         C   s   d } t  |   p t d  } n |  i | d  d  } xZ | D]R } t |  } t |  } | d j	 o' y t i |  | SWq d Sq Xq@ q@ Wd S(   s^   
    Parse document encoding according to: 
    http://docs.python.org/ref/encodings.html
    s   
i   is   utf-8N(   R   R   Rr  R   RE  R   Ri  Rj  (   t   txtt   eolR  R  R9   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR=    s     c           C   s    y t  i   SWn d Sn Xd  S(   Ni(   RC   t   getpid(    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   _getpid  s    c         C   s"   d t  |   d t  |  } | S(   s9   
    Form HTTP URL from 'host' and 'port' arguments.
    s   http://R  (   R   (   R$   t   portt   url(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   calcURL  s    c         C   s=   t  |  i t  p t |  i  d j o d Sn |  i d S(   Ni    i(   R  R   R  RW   (   R`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   GetSocketError  s    *c         C   sF   d | } t  i    } | |  } | | j  o t  i | |  n | S(   sg   
    Limits rate at which this function is called by sleeping.
    Returns the time of invocation.
    g      ?(   RU  RV  (   t   t_last_callt   max_rateR#  t	   t_currentt   dt(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   ControlRate  s    

c          C   s(   t  t i d d   }  t |   }  |  S(   s&   
    Return a 7 digits random id.
    i@B i (   R   t   randomt   randintR   (   RG   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   generate_rid   s    c         C   s9   |  d j o d Sn t  i d t |   d  } |  | S(   s9   
    Return a random character from string argument.
    R   i    i   (   RS  RT  RW   (   R  Rc  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   generate_random_char  s    c          C   sZ   d d }  d |  } t  |   } x' t d d  D] } | t  |  7} q0 Wt |  } | S(   s1   
    Generate an 8 characters long password.
    t   abdefghijmnqrtt   ABDEFGHJLMNQRTYt	   23456789_i    i   (   RV  R  R   (   R_   t   dsR   Rc  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   generate_random_password  s    

 c         C   s   |  d j o t Sn y1 t |   p |  i d  }  n |  i d  Wn t Sn Xx: |  D]2 } | i   o q[ n | d j o q[ n t Sq[ Wt S(   NR   Rg  t   _(   NR   (   R   R'   R   R   R   t   isalnumR   (   R   Rs  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRh   ,  s      c           C   s   d t    j S(   s2   
    Is the Crypto module imported/available.
    R   (   t   globals(    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   is_encryption_supportedF  s    c         C   s,   t  |   | j o |  Sn d |  | d S(   sZ   
    Return an n charaters suffix of the argument string of the form
    '...suffix'.
    s   ...i   (   RW   (   R  Rx  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRu  O  s    c         C   s+   t  |   | j o |  Sn |  | d  d S(   sZ   
    Return an n charaters prefix of the argument string of the form
    'prefix...'.
    i   s   ...(   RW   (   R  Rx  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   calc_prefix\  s    c          C   s   t  i t j o d Sn t  i i d  }  t  i i |  t  } t  i i |  p t  i | t	 d d   n t  i i |  t
  } t  i i |  p t  i | t	 d d   n t  i i |  t  } t  i i |  p t  i | t	 d d   n d S(   s]   
    Create the settings folder on Posix systems:
    '~/.rpdb2_settings' with mode 700.
    Nt   ~t   0700i   (   RC   RD   t   POSIXRZ   R  R   t   RPDB_SETTINGS_FOLDERR  t   mkdirR   t   RPDB_PWD_FOLDERt   RPDB_BPL_FOLDER(   t   homet   rsft   pwdst   bpl(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   create_rpdb_settings_folderi  s    c         C   s   t  i d d  d j o d  Sn t i |   } t |  t j  o d  Sn yJ g  } | D]2 } | t i t i i |  |   t i	 | f qY ~ } Wn d  Sn X| i
   xC | t  D]6 \ } } y  t i t i i |  |   Wq q Xq Wd  S(   Ni    i
   (   RS  RT  RC   t   listdirRW   t   MAX_BPL_FILESt   statRZ   R   t   ST_ATIMER  t   remove(   RZ   R  t   _[1]RP  t   llR  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   cleanup_bpl_folder  s     J
  c      	   C   s  t  |   } t i |  i   d  } t i t j oR t i i d  } t i i	 | t
  } t |  t i i	 | |  t } | Sn t i   } t i i	 | t  } t i i |  p8 y t i | t d d   Wq t   t  q Xn t |  t i i	 | |  t } | S(   Ni
   Ra  Rb  i   (   R   t   hmact   newt	   hexdigestRC   RD   Rc  RZ   R  R   Rg  Rt  t   BREAKPOINTS_FILE_EXTt   tempfilet
   gettempdirt   RPDB_BPL_FOLDER_NTR  Re  R   R  R   (   Rb   Rw   t   tmp_filenameRh  t   bpldirRZ   t   tmpdir(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   calc_bpl_filename  s&    

c         C   s@   t  i i d  } t  i i | t  } t  i i | |   } | S(   sR   
    Calc password file path for Posix systems:
    '~/.rpdb2_settings/<rid>'
    Ra  (   RC   RZ   R  R   Rf  (   RG   Rh  Ri  t   pwd_file_path(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   calc_pwd_file_path  s    c         C   sm   t  i t j o d Sn t |   } t  i | t  i t  i Bt d d   } t  i | |  t  i	 |  d S(   s1   
    Create password file for Posix systems.
    Nt   0600i   (
   RC   RD   Rc  R  R  t   O_WRONLYt   O_CREATR   R   R  (   RG   R   RZ   t   fd(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRE     s    (c         C   s^   t  i t j p t  t |   } t | d  } | i   } | i   t | d t	 } | S(   s=   
    Read password from password file for Posix systems.
    R  R   (
   RC   RD   Rc  Ri   R  R  R  R  R   R   (   RG   RZ   R#  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   read_pwd_file  s    
c         C   sC   t  i t j o d Sn t |   } y t  i |  Wn n Xd S(   s1   
    Delete password file for Posix systems.
    N(   RC   RD   Rc  R  Rq  (   RG   RZ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   delete_pwd_file  s    c    	      C   s   y t  i d  }  |  d  j o |  Sn d d  k } | i   } t d d  } | i   } | i   | i d  } t	 g  } | D]0 } | | i d d  d | i d  d f q ~  } | | SWn d	 Sn Xd  S(
   Nt   SHELLis   /etc/passwdR  s   
R  i   i    t   sh(
   RC   t   getenvR   t   getpasst   getuserR  R  R  Rr  R  (	   R_   R  t   usernameRP  R  Rs  Rr  R`   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   CalcUserShell  s    
Jc         C   sA   |  i  d  o |  i d  p t Sn |  d	 j o t Sn t S(
   Nt   __t	   __class__t	   __bases__R  Rf   Rd   t   __all__t   __builtins__(   s	   __class__s	   __bases__s   __file__s   __doc__s   __name__s   __all__s   __builtins__(   Rl  R  R'   R   (   t   a(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   IsFilteredAttribute  s
     c         C   sj   yX t  |  |  } t t |   }  d |  j p d |  j p |  d j o t Sn t SWn t Sn Xd  S(   Nt   functiont   methodRn   (   t   getattrR  Rn   R   R'   (   R  R  t   o(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   IsFilteredAttribute2#  s    'c         C   sW   t  |   } | d j o | Sn g  } | D] } t |  p | | q, q, ~ } | S(   Ni    (   t   dirR  (   R  R   R  Rr  R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   CalcFilteredDir2  s
    2c         C   s4   | d j o |  Sn t  |  d  p |  Sn |  i S(   Ni    t   im_func(   R  R  (   R  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   CalcIdentity>  s
    c         C   s@   y t  |  |  SWn( t j
 o t Sn t   t Sn Xd  S(   N(   R  R  t   ERROR_NO_ATTRIBUTER  (   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   getattr_nothrowI  s    c         C   s  t  |  |  } t |  } t |  d  } | t j	 o t  | t  } t |  } | | @} x | D] } t |  |  } t | |  }	 | t j p t | |  t |	 |  j o | i |  n yA | d j o0 t | d  t |	 d  j o | i |  n Wqc qc Xqc Wn t |  d  }
 t |
  t	 j o x |
 D] } t  | t  } t |  } | | @} x | D] } t |  |  } t | |  }	 | t j p t | |  t |	 |  j o | i |  n yA | d j o0 t | d  t |	 d  j o | i |  n WqrqrXqrWq@Wn g  } | D]/ } | d j  p t
 |  |  o | | q5q5~ } t |  d  o d | j o d g | } n t |  d  o d | j o d g | } n g  } | D]! } t |  |  o | | qq~ } | S(   NR  i   t   __self__R  i   (   R  RA  R  R  R'   R  t   discardR  Rn   R  R  R  (   R  R   R  R  Rs  t   csR_   R`   t   o1t   o2t   blR   t   bsRr  R  R  t   _[2]t   al(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   calc_attribute_listV  sV    
 ,, 
 ,,C5t   _RPDB2_FindReprc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s   | |  _  | |  _ d  S(   N(   t   m_objectt   m_repr_limit(   R2   R  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    	c         C   s   d } x |  i  D]z } t | |  i d t i d d  | j o* t |  i  t  o |  i  | Sn | Sn | d 7} | t j o d  Sq q Wd  S(   Ni    R9   R  s   &quoti   (	   R  R  R  R  R   R  R  t   MAX_SORTABLE_LENGTHR   (   R2   Rw   Rz  Rc  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __getitem__  s    
 +
c         C   s   t  |  i t  p d  Sn d } xp |  i D]e } t | |  i d t i d d  | j o | |  i | <d  Sn | d 7} | t j o d  Sq+ q+ Wd  S(   Ni    R9   R  s   &quoti   (   R  R  R  R  R  R  R   R  (   R2   Rw   Ro   Rz  Rc  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __setitem__  s    
 +
(   Rd   Re   R4   R  R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s   		c      
   C   sF   y t  |  |  SWn n Xt  t |  d d t t | d d t  S(   Ni   R9   (   t   cmpR  R  (   R}  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   SafeCmp  s
    c         C   s   |  i  t i i  } t i d d t |  5t i i d d  } | i  t i i  } xI t |  D]; \ } } t	 |  } t
 |  } t i i d | |  qc Wd  S(   Ni   t
   PYTHONPATHR   (   Rr  RC   RZ   R  R   RW   R  RX   t	   enumerateR  R  t   insert(   t   old_pythonpatht   oplt
   pythonpatht   pplRc  R#  R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   recalc_sys_path  s     c         C   sa   xZ t  t  i   D]F \ } } | i d  p | d j o q n | |  j o | Sq q Wd S(   Nt   SIGt   SIG_IGNt   SIG_DFLt   SIGRTMINt   SIGRTMAXR  (   s   SIG_IGNs   SIG_DFLR  R  (   t   varst   signalR  Rl  (   t   signumR  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   calc_signame  s     c         C   s   t  i |   } | i   g  } x | D] \ } } } } t t |   t i    } | d  j o
 d } n | i | | t |  t |  f  |  i	 }  |  d  j o Pq& q& W| i   | S(   NR   (
   R  t   extract_stackR  R   R  R   R  R   RI  t   f_back(   RP  t   _sR_   R#  t   lnt   fnR   RZ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   my_extract_stack  s    
 
%		
c         C   s   t  i |   } g  } x | D] \ } } } } t t |  i  t i    } | d  j o
 d } n | i | | t |  t |  f  |  i	 }  |  d  j o Pq q W| S(   NR   (
   R  t
   extract_tbR   R  t   tb_frameR   R  R   RI  t   tb_next(   Rp   R  R_   R#  R  R  R   RZ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   my_extract_tb  s     
%		t   CFirewallTestc           B   sb   e  Z d Z d Z d Z e i   Z e	 d  d  Z
 d   Z d   Z d   Z d   Z d   Z RS(   i   c         C   sE   | o d |  _  n
 t |  _  | |  _ d  |  _ d  |  _ d  |  _ d  S(   NR   (   t
   m_loopbackt   LOOPBACKt	   m_timeoutR   t   m_resultt   m_last_server_errort   m_last_client_error(   R2   t   fremoteR   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    				c         C   s  t  i i   zt  i } | d  j o: | i   o- | i |  i d  | i   o t Sq` n t  i	 } | d  j o: | i   o- | i |  i d  | i   o t Sq n d  t  _
 d  |  _ t i   } t i d |  i  } | i   | t  _ xU t  i
 d  j oD | i   o7 t i   | |  i d j o t Sn t i d  q W| i   p t Sn t i   } t i d |  i  } | i   | t  _	 xU |  i d  j oD | i   o7 t i   | |  i d j o t Sn t i d  qW|  i SWd  t  i i   Xd  S(   Ng      ?t   targetg?(   R  t   m_lockRJ  t   m_thread_serverR   t   isAliveR   R  R'   t   m_thread_clientt   m_portR  RU  RG  t   Threadt   _CFirewallTest__serverR   RV  t   _CFirewallTest__clientRL  (   R2   t   servert   clientRZ  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   run  sH    				
	 
	 c      	   C   s   t  i  t  i t  i  } | i |  i  z yH | i t t i f  | i	 t
 d   |  i | d  } t |  _ Wn8 t  i j
 o) t i   d } | |  _ t |  _ n XWd  | i   Xd  S(   Ns   Hello, worldi   i   (   t   sockett   AF_INETt   SOCK_STREAMt
   settimeoutR  t   connectR  R  R  t   sendR   t   _CFirewallTest__recvR   R  R+  R   R  R  R'   R  (   R2   R_   R  R`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __clientW  s    	c      	   C   s  t  i  t  i t  i  } | i |  i  t i t j o | i t  i	 t  i
 d  n t } x t o y | i |  i | f  PWq^ t  i j
 o t i   d } |  i |  t i j o | |  _ | i   d  Sn | t t d j o | |  _ | i   d  Sn | d 7} q^ Xq^ W| t _ z yf d  } | i d  | i   \ } } x: t o2 |  i | d  } | p d  Sn | i |  qSWWn/ t  i j
 o  t i   d } | |  _ n XWd  | d  j o | i   n | i   Xd  S(   Ni   i   (   R  R  R  R  R  RC   RD   Rc  t
   setsockoptt
   SOL_SOCKETt   SO_REUSEADDRt   SERVER_PORT_RANGE_STARTR   t   bindR  R+  R   R  t   _CFirewallTest__GetSocketErrort   errnot
   EADDRINUSER  R  t   SERVER_PORT_RANGE_LENGTHR  R  R   t   listent   acceptR  R  (   R2   R_   RJ  R`   t   connt   addrR  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __serverl  sN     	
	
	 c         C   s   t  i    } x t o y | i d  } | SWq t i j
 oo t i   d } |  i |  t i	 j o t
 d t |     n t  i    | |  i j o   q q q Xq Wd  S(   Ni   i   s   socket error was caught, %s(   RU  R   t   recvR  R+  R   R  R  R  t   EWOULDBLOCKRT   R   R  (   R2   R_   RW   RZ  R  R`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __recv  s     c         C   s=   t  | i t  p t | i  d j o d Sn | i d S(   Ni    i(   R  R   R  RW   (   R2   R`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __GetSocketError  s    *N(   Rd   Re   R   R  R  R  RG  t   RLockR  R'   R4   R  R  R  R  R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s   	:		6	t   CThreadc           B   s   e  Z e Z h  Z e i   Z d  Z d
 d
 d d
 d  Z
 d   Z d   Z d   Z d
 d  Z d   Z d   Z e e  Z d   Z e e  Z d	   Z RS(   i    c         C   sG   t  i i |  d | d | d | t |  _ | |  _ |  i   |  _ d  S(   NRD   R  R   (   RG  R  R4   R'   t
   m_fstartedt   m_shutdown_callbackt   _CThread__getIdt   m_id(   R2   RD   R  R   R5   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    "		c         C   s9   |  i  o+ y t i |  i =Wq5 t j
 o q5 Xn d  S(   N(   R  R  t	   m_threadsR  t   KeyError(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __del__  s
    
c         C   sg   t  i o d  Sn t i |   t  i |  i <t  i o t  i |  i =d  Sn t |  _ t i	 i
 |   d  S(   N(   R  t   m_fstopt   weakreft   refR  R  R   R  RG  R  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    

	c         C   s.   t  i d   t  i d   t i i |   d  S(   N(   R   R   R   t
   setprofileRG  R  R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    c         C   s1   y t  i i |  |  Wn t j
 o n Xd  S(   N(   RG  R  R   Ri   (   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  o |  i    n d  S(   N(   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR5     s    
c         C   s   t  d  t t _ xX t t i i    D]A \ } } |   } | p q) n y | i   Wn n Xd  } q) Wt	 i	   } xQ t
 t i  d j o: t	 i	   | t j o t  d  d  Sn t	 i d  q} Wt  d  d  S(   Ns!   Shutting down debugger threads...i    s,   Shut down of debugger threads has TIMED OUT!g?s!   Shut down debugger threads, done.(   RT   R   R  R  R  R  R  R5   R   RU  RW   t   SHUTDOWN_TIMEOUTRV  (   t   clsR   R  R  RZ  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   joinAll  s(    
	 	
 
c         C   s   t  t _ d  S(   N(   R'   R  R  (   R
  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   clearJoin$  s    c         C   s6   t  i i   t  i } t  i d 7_ t  i i   | S(   Ni   (   R  R  RJ  R  RL  (   R2   t   id(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __getId*  s
    	N(    (   Rd   Re   R'   R  R  RG  R  R  R  R   R4   R  R   R  R   R5   R  t   classmethodR  R   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s   							t   CCryptoc           B   s   e  Z d  Z h  Z d   Z d   Z d   Z d   Z d   Z e	 d  Z
 d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z RS(   sR   
    Handle authentication and encryption of data, using password protection.
    c         C   s   t  |  p t  t  |  p t  | |  _ |  i |  |  _ | |  _ | |  _ t i   |  _	 t i   |  _
 t i d d  |  _ d |  _ d |  _ h  |  _ t |  _ d |  _ d  S(   Ni    i ʚ;(   R   Ri   R  t   _CCrypto__calc_keyt   m_keyt   m_fAllowUnencryptedRB   RG  R  t   m_failure_lockR  RS  RT  t   m_index_anchor_int   m_index_anchor_ext   m_indext   m_index_tablet   INDEX_TABLE_SIZEt   m_index_table_sizeR   (   R2   R   R   RG   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   A  s    							c         C   s   | t  i j o t  i | Sn t |  } | d  } t i | d t } x5 t d  D]' } | i | | d  | i   } qW W| t  i | <| S(   sd   
        Create and return a key from a password.
        A Weak password means a weak key.
        i   t	   digestmodi   i   i   (	   R  t   m_keysR   Ru  Rv  t   _md5R  t   updatet   digest(   R2   R   Rw   Ry  R  Rc  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   __calc_keyX  s    
 c         C   s8   z# |  i  i   | |  _ | |  _ Wd  |  i  i   Xd  S(   N(   R  RJ  R  R  RL  (   R2   Rc  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   set_indexu  s
    	c         C   s   |  i  S(   N(   R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   get_max_index  s    c         C   s   | o |  i  o
 t  n | o t   o
 t  n |  i |  \ } } t } t |  d j o@ t i |  } t |  t |  d j  o | } t	 } q n | o |  i
 |  } n t i |  } t |  } | | | f S(   sZ   
        Sign args and possibly encrypt. 
        Return signed/encrypted string.
        iP  g?(   R  R   R_  R   t   _CCrypto__signR'   RW   t   zlibt   compressR   t   _CCrypto__encryptt   base64t   encodestringR   (   R2   R   t   fencryptR  R_   t	   fcompressR  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   do_crypto  s     

c   	      C   s   | o |  i  o
 t  n | o t   o
 t  n t |  } t i |  } | o |  i |  } n | o t i	 |  } n |  i
 | | |  \ } } | | f S(   s]   
        Take crypto string, verify its signature and decrypt it, if
        needed.
        (   R  R   R_  R   R   R'  t   decodestringt   _CCrypto__decryptR$  t
   decompresst   _CCrypto__verify_signature(	   R2   R)  R*  R  t   msgt   fVerifyIndexR_   R   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   undo_crypto  s    

c         C   s   | t  d  t i t |  t i } |  i t  d  t i t |  i  t i t i  } d t i } t i | t i |  } | i |  } | S(   Nt    t   0(	   R   R   t
   block_sizeRW   R  t   key_sizeRv  t   MODE_CBCt   encrypt(   R2   R_   t   s_paddedt
   key_paddedt   ivR  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   __encrypt  s    (5c         C   s   y |  i  t d  t i t |  i   t i t i  } d t i } t i | t i |  } | i |  i	 t d   } | SWn |  i
   t  n Xd  S(   NR4  R3  (   R  R   R   R6  RW   R5  Rv  R7  t   decryptR  t   _CCrypto__wait_a_littleR   (   R2   R_   R:  R;  R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   __decrypt  s    5
c         C   sg   |  i    } |  i | |  i | f } t i | d  } t i |  i | d t } | i	   } | | f S(   Ni   R  (
   t   _CCrypto__get_next_indexR  RB   t   picklet   dumpsRu  Rv  R  R  Rw  (   R2   R   Rc  t   packR_   t   hR  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __sign  s    c         C   s<   z' |  i  i   |  i d 7_ |  i SWd  |  i  i   Xd  S(   Ni   (   R  RJ  R  RL  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __get_next_index  s
    c         C   s   ym t  i |  i | d t } | i   } | | j o |  i   t  n t i |  } | \ } } }	 }
 Wn3 t j
 o
   n t	   |  i   t
  n X| o |  i | | |	  n |
 |	 f S(   NR  (   Ru  Rv  R  R  Rw  R>  R   RA  t   loadsR  R   t   _CCrypto__verify_index(   R2   R  R_   R1  RD  R  RC  R   Rc  R  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __verify_signature  s"    



c      
   C   s^  yCz.|  i  i   | |  i j o t |  i |  i   n | |  i t d j o t |  i |  i   n | t } |  i i | d  \ } } | d j p | | j o | g } nA | | j o | | j o | i	 |  n t |  i |  i   | | f |  i | <| |  i j o | |  _ n |  i
 SWd |  i  i   XWn |  i     n Xd S(   sH   
        Manage messages ids to prevent replay of old messages.
        i   N(   NN(   R  RJ  R  R   R   R  R  RX   R   RI  R  RL  R>  (   R2   R   Rc  R  t   i_modR;  t   idl(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __verify_index  s,    

c         C   s9   |  i  i   t i d t i   d  |  i  i   d  S(   Ng      ?i   (   R  RJ  RU  RV  RS  RL  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __wait_a_little<  s    (   Rd   Re   Rf   R  R4   R  R!  R"  R+  R   R2  R&  R-  R#  R@  R/  RH  R>  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  :  s   					 						*t   CEventc           B   s    e  Z d  Z d   Z d   Z RS(   s    
    Base class for events.
    c         C   s+   t  i t |   f t |   d  d  f } | S(   N(   t   copy_regt
   __newobj__Rn   R  R   (   R2   t   rv(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   __reduce__N  s    'c         C   s   d  S(   N(    (   R2   t   arg(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   is_matchS  s    (   Rd   Re   Rf   RR  RT  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRN  I  s   	t
   CEventNullc           B   s   e  Z d  Z RS(   sI   
    Sent to release event listeners (Internal, speeds up shutdown).
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRU  X  s   t   CEventEmbeddedSyncc           B   s   e  Z d  Z RS(   s   
    Sent when an embedded interpreter becomes active if it needs to 
    determine if there are pending break requests. (Internal)
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRV  a  s   t   CEventClearSourceCachec           B   s   e  Z d  Z RS(   s0   
    Sent when the source cache is cleared.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRW  k  s   t   CEventSignalInterceptedc           B   s   e  Z d  Z d   Z RS(   s   
    This event is sent when a signal is intercepted inside tracing code.
    Such signals are held pending until tracing code is returned from.
    c         C   s   | |  _  t |  |  _ d  S(   N(   t   m_signumR  t	   m_signame(   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   z  s    	(   Rd   Re   Rf   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRX  t  s   t   CEventSignalExceptionc           B   s   e  Z d  Z d   Z RS(   s   
    This event is sent when the handler of a previously intercepted signal
    raises an exception. Such exceptions are ignored because of technical 
    limitations.
    c         C   s%   | |  _  t |  |  _ | |  _ d  S(   N(   RY  R  RZ  t   m_description(   R2   R  t   description(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    	(   Rd   Re   Rf   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR[    s   t   CEventEncodingc           B   s   e  Z d  Z d   Z RS(   s$   
    The encoding has been set.
    c         C   s   | |  _  | |  _ d  S(   N(   t
   m_encodingt   m_fraw(   R2   R9   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    	(   Rd   Re   Rf   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR^    s   t   CEventPsycoWarningc           B   s   e  Z d  Z RS(   sP   
    The psyco module was detected. rpdb2 is incompatible with this module.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRa    s   t   CEventConflictingModulesc           B   s   e  Z d  Z d   Z RS(   sV   
    Conflicting modules were detected. rpdb2 is incompatible with these modules.
    c         C   s   | |  _  d  S(   N(   t   m_modules_list(   R2   t   modules_list(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    (   Rd   Re   Rf   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRb    s   t   CEventSyncReceiversc           B   s   e  Z d  Z d   Z RS(   s   
    A base class for events that need to be received by all listeners at
    the same time. The synchronization mechanism is internal to rpdb2.
    c         C   s   | |  _  d  S(   N(   t   m_sync_n(   R2   t   sync_n(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    (   Rd   Re   Rf   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRe    s   t   CEventForkSwitchc           B   s   e  Z d  Z RS(   s6   
    Debuggee is about to fork. Try to reconnect.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRh    s   t   CEventExecSwitchc           B   s   e  Z d  Z RS(   s6   
    Debuggee is about to exec. Try to reconnect.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRi    s   R0   c           B   s   e  Z d  Z RS(   s"   
    Debuggee is terminating.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR0     s   R.   c           B   s    e  Z d  Z d   Z d   Z RS(   sX   
    State of the debugger.
    Value of m_state can be one of the STATE_* globals.
    c         C   s   t  |  |  _ d  S(   N(   R   RR   (   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    c         C   s   |  i  t |  j S(   N(   RR   R   (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRT    s    (   Rd   Re   Rf   R4   RT  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR.     s   	t   CEventSynchronicityc           B   s    e  Z d  Z d   Z d   Z RS(   s<   
    Mode of synchronicity.
    Sent when mode changes.
    c         C   s   | |  _  d  S(   N(   t   m_fsynchronicity(   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    c         C   s   |  i  | j S(   N(   Rk  (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRT    s    (   Rd   Re   Rf   R4   RT  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRj    s   	t
   CEventTrapc           B   s    e  Z d  Z d   Z d   Z RS(   sN   
    Mode of "trap unhandled exceptions".
    Sent when the mode changes.
    c         C   s   | |  _  d  S(   N(   t   m_ftrap(   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    c         C   s   |  i  | j S(   N(   Rm  (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRT    s    (   Rd   Re   Rf   R4   RT  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRl    s   	t   CEventForkModec           B   s   e  Z d  Z d   Z RS(   sL   
    Mode of fork behavior has changed.
    Sent when the mode changes.
    c         C   s   | |  _  | |  _ d  S(   N(   t   m_ffork_into_childt   m_ffork_auto(   R2   R   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    	(   Rd   Re   Rf   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRn    s   R+   c           B   s   e  Z d  Z RS(   sN   
    Unhandled Exception 
    Sent when an unhandled exception is caught.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR+     s   t   CEventNamespacec           B   s   e  Z d  Z RS(   sb   
    Namespace has changed. 
    This tells the debugger it should query the namespace again.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRq    s   t   CEventNoThreadsc           B   s   e  Z d  Z RS(   s   
    No threads to debug.
    Debuggee notifies the debugger that it has no threads. This can
    happen in embedded debugging and in a python interpreter session.
    (   Rd   Re   Rf   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRr    s   t   CEventThreadsc           B   s   e  Z d  Z d   Z RS(   s   
    State of threads.
    c         C   s   | |  _  | |  _ d  S(   N(   t   m_current_threadt   m_thread_list(   R2   t   current_threadt   thread_list(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   -  s    	(   Rd   Re   Rf   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRs  (  s   t   CEventThreadBrokenc           B   s   e  Z d  Z d   Z RS(   s   
    A thread has broken.
    c         C   s   | |  _  t |  |  _ d  S(   N(   t   m_tidR   t   m_name(   R2   R   RD   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   8  s    	(   Rd   Re   Rf   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRx  3  s   t   CEventStackc           B   s   e  Z d  Z d   Z RS(   s"   
    Stack of current thread.
    c         C   s   | |  _  d  S(   N(   t   m_stack(   R2   R#  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   C  s    (   Rd   Re   Rf   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR{  >  s   t   CEventStackFrameChangec           B   s   e  Z d  Z d   Z RS(   sf   
    Stack frame has changed.
    This event is sent when the debugger goes up or down the stack.
    c         C   s   | |  _  d  S(   N(   t   m_frame_index(   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   N  s    (   Rd   Re   Rf   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR}  H  s   t   CEventStackDepthc           B   s   e  Z d  Z d   Z RS(   s"   
    Stack depth has changed.
    c         C   s   | |  _  | |  _ d  S(   N(   t   m_stack_deptht   m_stack_depth_exception(   R2   t   stack_deptht   stack_depth_exception(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   X  s    	(   Rd   Re   Rf   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  S  s   t   CEventBreakpointc           B   sP   e  Z d  Z e d  Z e d  Z e d  Z e d  Z e g  e d  Z	 RS(   s.   
    A breakpoint or breakpoints changed.
    t   disablet   enableRq  RA  c         C   s.   t  |  |  _ | |  _ | |  _ | |  _ d  S(   N(   t   breakpoint_copyt   m_bpt   m_actiont	   m_id_listt   m_fAll(   R2   t   bpt   actionR   RQ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   h  s    		(
   Rd   Re   Rf   R   t   DISABLEt   ENABLEt   REMOVEt   SETR'   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  ^  s   t
   CEventSyncc           B   s   e  Z d  Z d   Z RS(   s   
    Internal (not sent to the debugger) event that trigers the 
    firing of other events that help the debugger synchronize with 
    the state of the debuggee.
    c         C   s   | |  _  | |  _ d  S(   N(   t   m_fExceptiont   m_fSendUnhandled(   R2   t
   fExceptiont   fSendUnhandled(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   w  s    	(   Rd   Re   Rf   R4   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  p  s   t   CEventDispatcherRecordc           B   s    e  Z d  Z d   Z d   Z RS(   sH   
    Internal structure that binds a callback to particular events.
    c         C   s(   | |  _  t i |  |  _ | |  _ d  S(   N(   t
   m_callbackt   copyt   m_event_type_dictt   m_fSingleUse(   R2   Rq   R3   R%   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    	c         C   s!  g  } |  i  i   D]! } t | |  o | | q q ~ } t |  d j o t Sn | d } |  i  | i t g   } t |  d j o1 x& | D] } | i |  o t Sq q Wt Sn |  i  | i t	 g   } t |  d j o1 x& | D] } | i |  o t Sq q Wt Sn t S(   Ni    (
   R  R%  R  RW   R'   RX   t   EVENT_EXCLUDERT  R   t   EVENT_INCLUDE(   R2   RM   Rr  R  t   rtlR  t   rteR`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRT    s&    >
  (   Rd   Re   Rf   R4   RT  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s   	t   CEventDispatcherc           B   sk   e  Z d  Z d d  Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d	   Z d
   Z RS(   sE   
    Events dispatcher.
    Dispatchers can be chained together.
    c         C   s   | |  _  h  |  _ h  |  _ d  S(   N(   t   m_chained_event_dispatchert   m_chain_override_typest   m_registrants(   R2   t   chained_event_dispatcher(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    		c         C   s1   x* t  |  i i    D] } |  i |  q Wd  S(   N(   R  R  R%  t+   _CEventDispatcher__remove_dispatcher_record(   R2   t   er(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR5     s     c         C   s]   t  | | |  } |  i d  j	 o* |  i | | |  } | |  i | <| Sn t |  i | <| S(   N(   R  R  R   t-   _CEventDispatcher__register_callback_on_chainR  R   (   R2   Rq   R3   R%   R  t   _er(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR,     s    c         C   sf   g  } t  |  i i    D]! } | i | j o | | q q ~ } x | D] } |  i |  qK Wd  S(   N(   R  R  R%  R  R  (   R2   Rq   Rr  R  t   erl(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRr     s    D c         C   s"   x | D] } |  i  |  q Wd  S(   N(   t
   fire_event(   R2   t
   event_listRM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   fire_events  s     c         C   s4   x- t  |  i i    D] } |  i | |  q Wd  S(   N(   R  R  R%  t   _CEventDispatcher__fire_er(   R2   RM   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s     c         C   sm   | i  |  p d  Sn y | i |  Wn n X| i p d  Sn y |  i | =Wn t j
 o n Xd  S(   N(   RT  R  R  R  R  (   R2   RM   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   __fire_er  s    
c         C   s.   x' t  | i    D] } t |  i | <q Wd S(   sp   
        Chain override prevents registration on chained 
        dispatchers for specific event types.
        N(   R  R%  R   R  (   R2   R3   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   register_chain_override  s     c            s   t  i  |  } x)   i D] } | | j o | | =q q Wt |  d j o t Sn |   f d  }   i i | | |  } | S(   Ni    c            s     i  |  |  d  S(   N(   R  (   RM   R  (   R2   (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRq     s    (   R  R  RW   R'   R  R,   (   R2   R  R3   R%   t   _event_type_dictR  Rq   R  (    (   R2   s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __register_callback_on_chain  s    
 c         C   sj   yP |  i  d  j	 o2 |  i | } | t j o |  i  i |  qE n |  i | =Wn t j
 o n Xd  S(   N(   R  R   R  R'   R  R  (   R2   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __remove_dispatcher_record	  s    N(   Rd   Re   Rf   R   R4   R5   R,   Rr   R  R  R  R  R  R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s   							
	t   CEventQueuec           B   sG   e  Z d  Z e d  Z d   Z d   Z d   Z d   Z d   Z	 RS(   s   
    Add queue semantics above an event dispatcher.
    Instead of firing event callbacks, new events are returned in a list
    upon request.
    c         C   s@   | |  _  t i   |  _ | |  _ g  |  _ d |  _ g  |  _ d  S(   Ni    (   t   m_event_dispatcherRG  t	   Conditiont   m_event_lockt   m_max_event_list_lengtht   m_event_listt   m_event_indext   m_n_waiters(   R2   t   event_dispatchert   max_event_list_length(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    				c         C   s   |  i  i |  i  d  S(   N(   R  Rr   t   event_handler(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR5   )  s    c         C   s    |  i  i |  i | d t d  S(   NR%   (   R  R,   R  R'   (   R2   R3   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   register_event_types-  s    c         C   s   z |  i  i   t | t  oU t i   } xF t |  i  | i j  o( t i   | t j  o t i	 d  q/ Wn |  i
 i |  t |  i
  |  i j o |  i
 i d  n |  i d 7_ |  i  i   Wd  |  i  i   Xd  S(   Ng?i    i   (   R  RJ  R  Re  RU  RW   R  Rf  t   HEARTBEAT_TIMEOUTRV  R  RI  R  RT  R  RK  RL  (   R2   RM   RZ  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  1  s     0c         C   s   |  i  S(   N(   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   get_event_indexE  s    c         C   s   z |  i  i d  |  i i   | |  i j o t |  i |  n | |  i j o |  i g  f Sn |  i | |  i } |  i | f SWd |  i  i   |  i i   Xd S(   s:   
        Return the new events which were fired. 
        i    N(	   R  RI  R  RJ  R  RM  R  RT  RL  (   R2   R   t   event_indext   sub_event_list(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   wait_for_eventI  s    (
   Rd   Re   Rf   t   MAX_EVENT_LIST_LENGTHR4   R5   R  R  R  R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s   				t   CStateManagerc           B   s   e  Z d  Z d d d  Z d   Z d   Z d   Z d   Z d d  Z	 d   Z
 d   Z d	   Z d
   Z d e d  Z d   Z d   Z d   Z RS(   s+  
    Manage possible debugger states (broken, running, etc...)

    The state manager can receive state changes via an input event 
    dispatcher or via the set_state() method

    It sends state changes forward to the output event dispatcher.

    The state can also be queried or waited for.
    c         C   s   | |  _  | |  _ |  i  d  j	 oS h  h  t <} |  i  i |  i | d t |  i d  j	 o |  i i |  qu n t i	   |  _
 g  |  _ d |  _ h  |  _ |  i |  d  S(   NR%   i    (   t   m_event_dispatcher_inputt   m_event_dispatcher_outputR   R.   R,   R  R'   R  RG  R  t   m_state_lockt   m_state_queuet   m_state_indext   m_waiter_listt	   set_state(   R2   t   initial_statet   event_dispatcher_outputt   event_dispatcher_inputR3   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   n  s    					c         C   s+   |  i  d  j	 o |  i  i |  i  n d  S(   N(   R  R   Rr   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR5     s    c         C   s   |  i  | i  d  S(   N(   R  RR   (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    c         C   s   |  i  d S(   Ni(   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s-   |  i  i |  |  i d 7_ |  i   d  S(   Ni   (   R  RI  R  t   _CStateManager__remove_states(   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __add_state  s    c         C   sT   |  i    } | d j	 o | | j o d Sn d |  i | } |  i | |  _ d S(   sB   
        Clean up old state changes from the state queue.
        Ni   (   t   _CStateManager__calc_min_indexR   R  R  (   R2   t   tresholdRz  t   _delta(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __remove_states  s
    c         C   sF   t  |  i  d j o |  i Sn t |  i i    } t |  } | S(   s   
        Calc the minimum state index.
        The calculated index is the oldest state of which all state
        waiters are aware of. That is, no one cares for older states
        and these can be removed from the state queue.
        i    (   RW   R  R  R  R%  t   min(   R2   t
   index_listt	   min_index(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __calc_min_index  s
    c         C   s3   |  i  } |  i i | d  } | d |  i | <| S(   Ni    i   (   R  R  RX   (   R2   Rz  Rx  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __add_waiter  s    	c         C   sJ   |  i  | } | d j o |  i  | =|  i |  n | d |  i  | <d  S(   Ni   (   R  R  (   R2   Rz  Rx  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __remove_waiter  s
    
c         C   s#   d |  i  | } |  i | } | S(   Ni   (   R  R  (   R2   Rz  R  t   states(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __get_states  s    c         C   s   zS | o |  i  i   n | d  j o |  i   } n |  i |  |  i  i   Wd  | o |  i  i   n X|  i d  j	 o  t |  } |  i i	 |  n d  S(   N(
   R  RJ  R   R   t   _CStateManager__add_stateRK  RL  R  R.   R  (   R2   R   t   fLockRM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    c         C   s   z |  i  i   |  i   | j o |  i   Sn xj t ob |  i   } t |  i  t  |  i |  } |  i |  x# | D] } | | j o | Sqz qz Wq4 WWd |  i  i	   Xd S(   s?   
        Wait for any of the states in the state list.
        N(
   R  RJ  R   R   t   _CStateManager__add_waiterRX  t   PING_TIMEOUTt   _CStateManager__get_statest   _CStateManager__remove_waiterRL  (   R2   t
   state_listRz  R  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   wait_for_state  s      c         C   s   |  i  i   d  S(   N(   R  RJ  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRJ    s    c         C   s   |  i  i   d  S(   N(   R  RL  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRL    s    N(   Rd   Re   Rf   R   R4   R5   R  R   R  R  R  R  R  R  R   R  R  RJ  RL  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  b  s   
											c         C   s    y t  |   SWn |  Sn Xd  S(   N(   R  (   Rs  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   myord  s    c   
   	   C   s+  |  i  } | g } g  } |  i d d  d  D] } | t |  q- ~ } g  } |  i d d  d  D] } | t |  qd ~ } x] t | |  D]L \ } }	 | |	 7} | d j o q n | | d j o | i |  q q Wt |  d j o4 | | d 7} | | d j o | i |  q'n | S(   Ni   i   i    i(   t   co_firstlinenot	   co_lnotabR  t   zipRI  RW   (
   t   codeR  t   vlRr  Rs  R  R  R]   t   biRF   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   CalcValidLines  s     		77 
t   CScopeBreakInfoc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s0   | |  _  | d |  _ | d |  _ | |  _ d  S(   Ni    i(   t   m_fqnt   m_first_linet   m_last_linet   m_valid_lines(   R2   t   fqnt   valid_lines(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   /  s    	c         C   sC   t  i  |  i  } | i   x  | D] } | | j o Pq# q# W| S(   N(   R  R  R  (   R2   R{   t   rvlR  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   CalcScopeLine6  s    
 	c         C   s    d |  i  d t |  i  d S(   Ns   ('s   ', R  (   R  R   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   A  s    (   Rd   Re   R4   R  R   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  .  s   		t   CFileBreakInfoc           B   s;   e  Z d  Z d   Z d   Z d   Z d   Z d   Z RS(   s1   
    Break info structure for a source file.
    c         C   s(   | |  _  d |  _ d |  _ g  |  _ d  S(   Ni    (   t
   m_filenameR  R  t   m_scope_break_info(   R2   Rb   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   K  s    			c         C   sQ  t  |  i  \ } } t | t d  |  } t | |  i d  } g  |  _ | i |  _ d |  _ g  } | g } x t	 |  d j o | i
 d  } t |  t j o' |  i i t |    | i
   qs n | | i g } t |  } t |  i | d  |  _ t d i |  |  }	 |	 | f }
 |  i |  } | |
 g | } qs Wd  S(   Ns   
t   execi    iR    (   RB  R  R   R   t   compileR  R  R  R  RW   RT  Rn   R  RI  R  R  R  R  R   t!   _CFileBreakInfo__CalcSubCodesList(   R2   R>  R9   t   _sourceR  R  R  Rs  R  t   _fqnRF   t   subcodeslist(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   CalcBreakInfoR  s,    			 
c         C   s   t  |  } g  } | i D]- } t  |  | j o | | i | f q q ~ } | i   g  } | D] } | | d qe ~ } | S(   Ni   (   Rn   t	   co_constsR  R  (   R2   R  t   tcRr  Rs  R  R  t   scl(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __CalcSubCodesListp  s
    D
%c         C   s  t  t | |  i  |  i  } d  } d  } x} |  i D]r } | | i j o1 | d  j p | i | i j o
 | } q4 q4 n | | i j o | | i j o | } Pq4 q4 W| d  j	 p t  | } | i |  } | d  j	 o) | | i j o | } | i |  } n | | f S(   N(   R  R  R  R  R   R  Ri   R  (   R2   R{   t   smaller_elementt   exact_elementt   sbiRz   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   FindScopeByLinenox  s&    
  
 	c         C   s   | i  t  o t | t t  } nA | i  t  o t | t t  } n |  i t t | |  SxK |  i D]@ } | i | | g j o$ | i | i	 |  } | | f Sqr qr Wt
 d t |   t  d  S(   Ns   Invalid scope: %s(   Rl  t   MODULE_SCOPEt   MODULE_SCOPE2RW   t   FindScopeByNamet	   SCOPE_SEPR  R  R  R  RT   R   R   (   R2   RD   t   offsett	   alt_scopeR  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    
 (   Rd   Re   Rf   R4   R   R  R  R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  F  s   				t   CBreakInfoManagerc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s4   
    Manage break info dictionary per filename.
    c         C   s   h  |  _  d  S(   N(   t   m_file_info_dic(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    c         C   s'   t  |  } | i   | |  i | <d  S(   N(   R  R   R  (   R2   Rb   t   mbi(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   addFile  s    
c         C   s,   | |  i  j o |  i |  n |  i  | S(   N(   R  R  (   R2   Rb   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   getFile  s    (   Rd   Re   Rf   R4   R  R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s   		c         C   sL   |  d  j o d  Sn t i |   } t |  i t i    | _ d  | _ | S(   N(   R   R  R   R  R   R  t   m_code(   R  t   _bp(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    	t   CBreakPointc           B   sJ   e  Z e d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 RS(   c	   
      C   s   d |  _ | |  _ | |  _ | |  _ | i t  d |  _ | |  _ | | |  _	 | |  _
 | |  _ | |  _ d |  _ | |  _ | d j	 oQ | d j oD t t | | |  }	 t d t |	   t |	 d d  |  _ n d S(   ss   
        Breakpoint constructor.

        scope_fqn - scope fully qualified name. e.g: module.class.method
        iR   s   Breakpoint expression: %ss   <string>t   evalN(   R   R  t
   m_fEnabledR  t   m_scope_fqnRr  R  t   m_scope_namet   m_scope_first_linet   m_scope_offsett   m_linenot   m_exprR_  R  t   m_fTemporaryR   t   ENCODING_SOURCERT   R   R  (
   R2   Rb   t	   scope_fqnt   scope_first_lineR{   R   R   R9   t
   fTemporaryt   _expr(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s     										c         C   s+   t  i t |   f t |   d  d  f } | S(   N(   RO  RP  Rn   R  R   (   R2   RQ  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRR    s    'c         C   sV   |  i  d j o d  Sn |  i t t g j o d  Sn |  i i t  } | d } | S(   Ni    i(   R  R   R  R	  R
  Rr  R  (   R2   t   scope_name_listt   enclosing_scope_name(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   calc_enclosing_scope_name  s    
c         C   s   t  |  _ d  S(   N(   R   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   t  |  _ d  S(   N(   R'   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    c         C   s   |  i  S(   N(   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   isEnabled  s    c         C   sM   d |  i  d |  i d t |  i  d t |  i  d t |  i  d S(   Ns   ('s   ', 's   ', s   , R  (   R  R  R   R  R  R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    (
   Rd   Re   R'   R4   RR  R'  R  R  R(  R   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s   					t   CBreakPointsManagerProxyc           B   sD   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s   
    A proxy for the breakpoint manager.
    While the breakpoint manager resides on the debuggee (the server), 
    the proxy resides in the debugger (the client - session manager)
    c         C   so   | |  _  h  |  _ h  |  _ t i   |  _ h  h  t <} |  i  i i |  i	 | d t
 |  i  i i |  d  S(   NR%   (   t   m_session_managert   m_break_points_by_filet   m_break_points_by_idRG  t   LockR  R  t   m_event_dispatcher_proxyR,   t	   update_bpR'   R  R  (   R2   R   R3   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    			c         C   s  z|  i  i   | i o t |  i i    } n
 | i } | i t i	 j o xx | D]p } yT |  i i
 |  } |  i | i } | | i =t |  d j o |  i | i =n WqV t j
 o qV XqV Wd Sn | i t i j oJ x? | D]7 } y |  i | } | i   Wq t j
 o q Xq Wd Sn | i t i j oJ x? | D]7 } y |  i | } | i   WqIt j
 o qIXqIWd Sn |  i i | i i h   } | i | | i i <| i |  i | i i <Wd |  i  i   |  i i i |  Xd S(   sQ   
        Handle breakpoint updates that arrive via the event dispatcher.
        i    N(   R  RJ  R  R  R,  R%  R  R  R  R  RT  R+  R  R  RW   R  R  R  R  R  RX   R  R  RL  R*  R  R  (   R2   RM   R   R  R  t   bpm(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR/  +  sP    
	 
	 	 	c      
   C   s   z# |  i  i   h  |  _ h  |  _ Wd  |  i  i   X|  i i   i   i   } zf |  i  i   |  i i	 |  xB t
 |  i i    D]+ } |  i i | i h   } | | | i <q WWd  |  i  i   Xd  S(   N(   R  RJ  R+  R,  RL  R*  t
   getSessiont   getProxyR   R  R  t   valuesRX   R  R  (   R2   t   break_points_by_idR  R0  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   synca  s    	 c         C   s8   z# |  i  i   h  |  _ h  |  _ Wd  |  i  i   Xd  S(   N(   R  RJ  R+  R,  RL  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   clearz  s
    	c         C   s   |  i  S(   N(   R,  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s   |  i  | } | | } | S(   N(   R+  (   R2   Rb   R{   R0  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   get_breakpoint  s    
(	   Rd   Re   Rf   R4   R/  R5  R6  R   R7  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR)    s   		6			t   CBreakPointsManagerc           B   s   e  Z d    Z d   Z d   Z d   Z d   Z d   Z e d d  Z
 e d  Z d   Z d	   Z d
   Z d   Z d   Z RS(   c         C   sU   t    |  _ h  |  _ h  |  _ h  |  _ h  |  _ t i   |  _ d  |  _
 t |  _ d  S(   N(   R  t   m_break_info_managert   m_active_break_points_by_filet   m_break_points_by_functionR+  R,  RG  R-  R  R   t	   m_temp_bpR'   t   m_fhard_tbp(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    					c         C   s   t  |  } |  i i | h   S(   s2   
        Get active breakpoints for file.
        (   R  R:  t
   setdefault(   R2   Rb   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   get_active_break_points_by_file  s    c         C   s   |  i  i | h   } | i   |  i i | h   } x5 t | i    D]! } | i o | | | i <qG qG W|  i	 } | d  j	 o! | i | j o | | | i <n d  S(   N(   R:  R>  R6  R+  RX   R  R3  R  R  R<  R   R  (   R2   Rb   t   bpmptR0  R  t   tbp(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt"   __calc_active_break_points_by_file  s    
 
	c         C   s   | i  } y9 |  i | } | | =t |  d j o |  i | =n Wn t j
 o n X| i   } | d  j o d  Sn y9 |  i | } | | =t |  d j o |  i | =n Wn t j
 o n Xd  S(   Ni    (   R  R;  RW   R  R'  R   (   R2   R  Ra   t   bpft   _function_namet   _bpf(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __remove_from_function_list  s$    	c         C   sl   | i  } |  i i | h   } t | | <| i   } | d  j o d  Sn |  i i | h   } t | | <d  S(   N(   R  R;  R>  R   R'  R   (   R2   R  Ra   RC  RD  RE  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __add_to_function_list  s    	
c         C   s   |  i  | } | | } | S(   s9   
        Get breakpoint by file and line number.
        (   R+  (   R2   Rb   R{   R0  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR7    s    
c         C   s   |  i  d j o d Sn z | o |  i i   n |  i  d j o d Sn |  i o | |  i  j	 o d Sn |  i  } d |  _  t |  _ |  i |  |  i | i  Wd | o |  i i	   n Xd S(   s   
        Delete a temoporary breakpoint.
        A temporary breakpoint is used when the debugger is asked to
        run-to a particular line.
        Hard temporary breakpoints are deleted only when actually hit.
        N(
   R<  R   R  RJ  R=  R'   t/   _CBreakPointsManager__remove_from_function_listt6   _CBreakPointsManager__calc_active_break_points_by_fileR  RL  (   R2   R  t
   breakpointR  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   del_temp_breakpoint  s     			c   
      C   s	  t  |  } |  i i |  } | d j o | i | |  \ } } n | i |  \ } } t | | i | i | d t d t	 d  d t	 d  d t }	 zY |  i
 i   t |  _ |  i d t  | |  _ |	 |  _ |  i |	  |  i |	 i  Wd |  i
 i   Xd S(	   s   
        Set a temoporary breakpoint.
        A temporary breakpoint is used when the debugger is asked to
        run-to a particular line.
        Hard temporary breakpoints are deleted only when actually hit.
        R   R   R   R9   s   utf-8R#  R  N(   R  R9  R  R  R  R  R  R  R   R   R  RJ  R'   R=  RK  R<  t*   _CBreakPointsManager__add_to_function_listRI  R  RL  (
   R2   Rb   Rz   R{   t   fhardR   R  R_   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   set_temp_breakpoint  s    ?			c      	   C   s  t  |  } |  i i |  } | d j o | i | |  \ }	 }
 n | i |  \ }	 }
 t | |	 i |	 i |
 | | |  } z|  i i	   |  i
 i | h   } y$ | |
 } | i } |  i |  Wns t j
 og t |  i i    } | i   d } x= | t |  j  o$ | | | j o Pn | d 7} qWn X| | _ | |  i | <| | |
 <| o |  i |  n |  i | i  | SWd |  i i   Xd S(   s  
        Set breakpoint.

        scope - a string (possibly empty) with the dotted scope of the 
                breakpoint. eg. 'my_module.my_class.foo'

        expr - a string (possibly empty) with a python expression 
               that will be evaluated at the scope of the breakpoint. 
               The breakpoint will be hit if the expression evaluates
               to True.
        R   i    i   N(   R  R9  R  R  R  R  R  R  R  RJ  R+  R>  R  RH  R  R  R,  R%  R  RW   RL  RI  R  RL  (   R2   Rb   Rz   R{   R   R   R9   R   R  R_   R  R  R0  t   old_bpR  t   bpids(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   3  s<    $
	
 	
c      	   C   s   z |  i  i   | o t |  i i    } n x_ | D]W } y |  i | } Wn t j
 o
 q7 n X| i   |  i |  |  i | i	  q7 WWd |  i  i
   Xd S(   s%   
        Disable breakpoint.
        N(   R  RJ  R  R,  R%  R  R  RH  RI  R  RL  (   R2   R   RQ   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   w  s     
c      	   C   s   z |  i  i   | o t |  i i    } n x_ | D]W } y |  i | } Wn t j
 o
 q7 n X| i   |  i |  |  i | i	  q7 WWd |  i  i
   Xd S(   s$   
        Enable breakpoint.
        N(   R  RJ  R  R,  R%  R  R  RL  RI  R  RL  (   R2   R   RQ   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s     
c      
   C   s  z |  i  i   | o t |  i i    } n x | D] } y |  i | } Wn t j
 o
 q7 n X| i } | i } |  i | } | | | j o | | =n t	 |  d j o |  i | =n |  i
 |  |  i | i  |  i | =q7 WWd |  i  i   Xd S(   s$   
        Delete breakpoint.
        i    N(   R  RJ  R  R,  R%  R  R  R  R+  RW   RH  RI  RL  (   R2   R   RQ   R  R  Rb   R{   R0  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s*     		c         C   s   |  i  S(   N(   R,  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    N(   Rd   Re   R4   R?  RI  RH  RL  R7  R   R   RK  R'   RN  R   R   R   R   R   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR8    s   		
				
 "	D			$t   CCodeContextc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s8   
    Class represents info related to code objects.
    c         C   sU   | i  |  _ t |  |  _ t i i |  i  |  _ | i |  i  |  _	 t
 |  _ d  S(   N(   R  R  R  R  RC   RZ   R[   t
   m_basenameR?  t   m_file_breakpointsR'   t   m_fExceptionTrap(   R2   R  t
   bp_manager(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s
    c         C   s   |  i  t t g j S(   sG   
        Return True if this code object should not be traced.
        (   RR  t   THREADING_FILENAMER\   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   is_untraced  s    c         C   sG   |  i  t j o t Sn |  i  t j o |  i i d j o t Sn t S(   s^   
        Return True if this frame should be a trap for unhandled
        exceptions.
        t   __execvt   __execvet   __function_wrapper(   s   __execvs   __execves   __function_wrapper(   RR  RV  R   R\   R  R  R'   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   is_exception_trap_frame  s
    #(   Rd   Re   Rf   R4   RW  R[  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRQ    s   	
	t   CDebuggerCoreThreadc           B   s   e  Z d  Z d   Z d   Z d   Z d   Z e d  Z d   Z	 d   Z
 d   Z d	   Z e d
  Z e d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s   
    Class represents a debugged thread.
    This is a core structure of the debugger. It includes most of the
    optimization tricks and hacks, and includes a good amount of 
    subtle bug fixes, be carefull not to mess it up...
    c         C   s   t  i   |  _ | |  _ t |  _ t |  _ | |  _ | |  _ d  |  _
 d  |  _ | i |  |  _ h  |  _ | |  _ | i |  _ t i   |  _ d |  _ d  S(   Ni    (   RR  RS  t   m_thread_idt   m_thread_nameR'   t	   m_fBrokent   m_fUnhandledExceptiont   m_framet   m_eventR   t   m_ue_linenot   m_uef_linenot   get_code_contextt   m_code_contextt   m_locals_copyt   m_coret   m_bp_managerRG  R  t   m_frame_lockt   m_frame_external_references(   R2   RD   t   core_debuggerR  RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4     s    									c      	   C   sz  | d j oi| i  |  _ y |  i i |  i i |  _ Wn t j
 o |  i d j o |  i i ot | |  _ d |  _ |  i	 |  _
 t |  _ |  i i |  | | |  d |  _
 | |  i j o |  i   n d |  _ n |  i i |  i  t i d  t i |  i i  n X|  i d j o d Sn z9 |  i i   x% |  i d j o t |  i d  q;WWd |  i i   Xn d S(   s   
        Profiler method.
        The Python profiling mechanism is used by the debugger
        mainly to handle synchronization issues related to the 
        life time of the frame structure.
        t   returnt	   exceptioni    Ng      ?(   R  Ra  Rh  t   m_code_contextsR  Rf  R  Rb  Rm  Rc  Rd  R   R`  t   _breakR   Rg  t   update_localst   remove_threadR]  R   R  R   t   trace_dispatch_initRk  Rj  RJ  RM  RL  (   R2   R  RM   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   profile  s4    				 c         C   sY   zD |  i  i   |  i d 7_ |  i } | d j o
 t  n | SWd |  i  i   Xd S(   s2   
        Aquire a reference to the frame.
        i   N(   Rj  RJ  Rk  Ra  R   R   RL  (   R2   RP  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   frame_acquireU  s    	
c         C   sV   zA |  i  i   |  i d 8_ |  i d j o |  i  i   n Wd |  i  i   Xd S(   s3   
        Release a reference to the frame.
        i   i    N(   Rj  RJ  Rk  t   notifyRL  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   frame_releaseh  s    c         C   st  | oN | i  } | d j o
 t  n x | i d j	 o | i } q* W| i } n | } xb | d j	 oT t o# | i i d j o | i } q^ n | d j o Pn | i } | d 8} q^ W| d j  p | d j o
 t	  n |  i
 d j	 o | i d j o |  i
 } n
 | i } | oI | i  } x= | d j	 o+ | i | j o | i } Pn | i } q-Wn | | f S(   s   
        Get frame at index depth down the stack.
        Starting from base_frame return the index depth frame 
        down the stack. If fException is True use the exception
        stack (traceback).
        t   rpdb2_import_wrapperi    i   N(   t   f_exc_tracebackR   R   R  R  R  R  R  R  R   Rd  R  t	   tb_lineno(   R2   t
   base_frameRz  R  Rp   RP  R{   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   get_framex  s@    	
  		
 		 	c   
   	   C   s  z |  i    } |  i | | |  \ } } | o t i | i  } n
 | i } y |  i | \ } }	 Wn t j
 o| | i i t t	 g j o | } | }	 q t i | i
  } t i |  }	 | p$ | |	 f |  i | <|  i |  q n X| | |	 f SWd d } d } |  i   Xd S(   s   
        Get globals and locals of frame.
        A copy scheme is used for locals to work around a bug in 
        Python 2.3 and 2.4 that prevents modifying the local dictionary.
        N(   Ru  R|  R  R  Rg  R  R  R  R	  R
  t   f_localst   set_local_traceR   Rw  (
   R2   R   R  t	   fReadOnlyR{  RP  R{   t   gct   lct   olc(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   get_locals_copy  s*    	
c         C   s   |  i  i |  i d  } | d j o d Sn | \ } } t i |  i i  } xW | D]O } | | j o | | | | <qU n | | | | j	 o | | | | <qU qU Wd S(   s?   
        Update copy of locals with changes in locals.
        N(   Rg  RX   Ra  R   R  R}  (   R2   t   lctR  t   baset   crR  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   update_locals_copy  s     c         C   sH   |  i  i |  i d  } | d j o d Sn |  i i i | d  d S(   sA   
        Update locals with changes from copy of locals.
        Ni    (   Rg  RT  Ra  R   R}  R  (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRq    s    c         C   s   | i  p t Sn | i d j o t Sn yf | |  i j o- |  i | d } t | i | i |  } n t | i | i | i  } | t j SWn t Sn Xd S(   s7   
        Return True if the breakpoint is hit.
        R   i    N(	   R  R'   R  R   Rg  R  R  R  R}  (   R2   R  R  R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __eval_breakpoint  s    
c         C   s  |  i  i p |  i | _ d Sn | o |  i | _ d Sn |  i  i |  } |  i  i |  |  o |  i | _ n | i p | i	 d j o |  i | _ ns | i i |  i i j o |  i | _ nJ | |  i j o |  i | _ n* | |  i  i j o |  i | _ n | ` d S(   s   
        Set trace callback of frame. 
        Specialized trace methods are selected here to save switching time 
        during actual tracing.
        N(   Rh  t   m_ftracet   trace_dispatch_stopt   f_tracet   trace_dispatch_signalRe  t   is_breakt   trace_dispatch_breakRT  R  R   t   trace_dispatch_trapR  R  Ri  R;  t   trace_dispatchRg  t   m_return_frame(   R2   R  t   fsignal_exceptiont   code_context(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR~    s$    c      	   C   sv   z^ y> |  i    } x+ | d j	 o |  i | |  | i } q WWn t j
 o d } n XWd d } |  i   Xd S(   s>   
        Set trace callbacks for all frames in stack.
        N(   Ru  R   R~  R  R   Rw  (   R2   R  RP  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   set_tracers1  s     c         C   s<   | |  i  j o |  i   n t i d  t i d  d S(   s2   
        Disable tracing for this thread.
        N(   Rg  Rq  R   R   R   R  (   R2   R  RM   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  E  s
    c         C   s   | d j o | i  Sn | d j o |  i |  n | |  _ | |  i j o |  i   n |  i i |  | | |  | |  i j o |  i   |  i |  n | i  S(   s5   
        Trace method for breaking a thread.
        R  Rm  Rn  (   s   lines   returns	   exception(	   R  t   set_exc_infoRb  Rg  R  Rh  Rp  Rq  R~  (   R2   R  RM   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  R  s    	
c         C   s  |  i  i p |  i | | |  Sn | |  _ y |  i  i | i |  _ Wn( t j
 o |  i  i |  |  _ n X|  i  i	 p |  i  i
 |  i j oX | |  _ |  i  i |  | | |  | |  i j o |  i   |  i |  n | i Sn | i i |  i i j o d Sn |  i i i | i d  } | d j	 ok |  i | |  oX | |  _ |  i  i |  | | |  | |  i j o |  i   |  i |  n | i Sn |  i S(   s2   
        Initial trace method for thread.
        N(   Rh  R  R  Ra  Ro  R  Rf  R  Re  t   m_fBreakt
   m_step_tidR]  Rb  Rp  Rg  Rq  R~  R  R  Ri  R;  R   RS  RX   R  t%   _CDebuggerCoreThread__eval_breakpointR  (   R2   R  RM   RS  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   trace_dispatch_callk  s2    	#	
 	
c         C   s  | d j o | |  i  j o |  i   n |  i i i | i d  } | d j	 o9 |  i | |  o& | |  _ |  i	 i
 |  | | |  n | |  i  j o |  i   |  i |  n | i Sn | d j o} | |  i  j o |  i   n | |  i	 i j o& | |  _ |  i	 i
 |  | | |  n | |  i  j o |  i   n d Sn | d j of | |  i  j o |  i   |  i |  n | i | d j	 o | \ | _ | _ | _ n | i Sn | i S(   s2   
        General trace method for thread.
        R  Rm  Rn  i   N(   Rg  R  Rf  RS  RX   R  R   R  Rb  Rh  Rp  Rq  R~  R  R  Ry  t
   f_exc_typet   f_exc_value(   R2   R  RM   RS  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s8     	
	
c         C   sp  | d j o | |  _  | |  i j o |  i   n |  i i i | i d  } | d j	 o0 |  i | |  o |  i	 i
 |  | | |  n | |  i j o |  i   |  i |  n | i Sn | d j o |  i  } | |  _  | |  i j o |  i   n | |  i	 i j o |  i	 i
 |  | | |  n | |  i j o |  i   n | d j o | |  _  n d Sn | d j o | |  _  |  i i oe |  i	 i oX |  i |  t |  _ |  i	 i
 |  | | |  | |  i j o |  i   n | i Sn | i |  _ | |  i j o |  i   |  i |  n | i | d j	 o | \ | _ | _ | _ n | i Sn | i S(   sf   
        Trace method used for frames in which unhandled exceptions
        should be caught.
        R  Rm  Rn  i   N(   Rb  Rg  R  Rf  RS  RX   R  R   R  Rh  Rp  Rq  R~  R  R  RT  Rm  R  R   R`  Rc  Ry  R  R  (   R2   R  RM   RS  R  t
   last_event(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    sP    	 
				
c         C   s:   |  i  |  |  i   t i |  i  |  i | | |  S(   N(   R  R  R   R  Rt  R  (   R2   R  RM   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    
c         C   sU   | \ } } } x? | d j	 o1 | i } | | _ | | _ | | _ | i } q Wd S(   s?   
        Set exception information in frames of stack.
        N(   R   R  R  R  Ry  R  (   R2   RS  R  R  Rp   RP  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s     				c         C   sM   |  i  i i |  i i d  } | d j	 o |  i |  i |  o t Sn t S(   s<   
        Calc if current line is hit by breakpoint.
        N(	   Rf  RS  RX   Ra  R  R   R  R   R'   (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   is_breakpoint  s    #c         C   s   |  i  i i |  i i d  S(   s8   
        Return current line breakpoint if any.
        N(   Rf  RS  RX   Ra  R  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR7  )  s    (   Rd   Re   Rf   R4   Rt  Ru  Rw  R'   R|  R  R  Rq  R  R~  R  R  R  R  R  R  R  R  R  R7  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR\    s*   		8		2	*			$			&	/	D				t   CDebuggerCorec           B   s  e  Z d  Z e d  Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d	   Z d
   Z d8 e d8 d8 d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z  d8 d  Z! d   Z" d   Z# d   Z$ d    Z% d!   Z& d"   Z' d#   Z( d$   Z) d%   Z* d&   Z+ d'   Z, d(   Z- d)   Z. d*   Z/ d+   Z0 d,   Z1 d-   Z2 d.   Z3 e d/  Z4 e d0  Z5 d1   Z6 e d2  Z7 e d3  Z8 d4   Z9 d5   Z: d6   Z; d7   Z< RS(9   sQ   
    Base class for the debugger. 
    Handles basic debugger functionality.
    c         C   sC  t  |  _ d  |  _ t  |  _ t |  _ d  |  _ d  |  _ t	 i
   |  _ h  |  _ t   |  _ t t |  i  |  _ t |  _ t |  _ t  |  _ t  |  _ t |  _ t |  _ d  |  _ d  |  _ d  |  _ d  |  _ d |  _ d  |  _ t   |  _ h  d  d  <|  _  | |  _! t	 i"   |  _# d |  _$ d |  _% h  t& i&   d d <|  _' d  S(   Ni    i  (   NNN((   R   R  R   t   m_current_ctxt   m_f_first_to_breakR'   t   m_f_break_on_initt   m_builtins_hackt   m_timer_embedded_giveupRG  R  t   m_threads_lockR  R  R  R  t   STATE_RUNNINGt   m_state_managerRo  Rp  Rk  Rm  R`  R  t   m_lastest_eventR  t   m_next_frameR  t   m_saved_stept   m_saved_nextR8  Ri  Ro  t   m_fembeddedRH  t   m_embedded_eventt   m_embedded_sync_t0t   m_embedded_sync_t1RU  t   m_heartbeats(   R2   t	   fembedded(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   8  s:    																						c         C   s   |  i  i   |  i i   d  S(   N(   R  R5   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR5   e  s    c         C   s   |  i  S(   N(   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   is_embeddedj  s    c         C   s*   t  d  t |  } |  i i |  d S(   sr   
        Notify client that debuggee is forking and that it should
        try to reconnect to the child.
        s   Sending fork switch eventN(   RT   Rh  R  R  (   R2   Rg  RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   send_fork_switchn  s    
c         C   s*   t  d  t |  } |  i i |  d S(   s   
        Notify client that debuggee is doing an exec and that it should 
        try to reconnect (in case the exec failed).
        s   Sending exec switch eventN(   RT   Ri  R  R  (   R2   Rg  RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   send_exec_switchz  s    
c         C   s   t    } |  i i |  d S(   sC   
        Notify client that the debuggee is shutting down.
        N(   R0   R  R  (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   send_event_exit  s    	c         C   s   d  S(   N(    (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   send_events  s    c            sp     i    | d j o d Sn t d |  }   f d   } t i | |    _   i i   t i d  d S(   se   
        Set timeout thread to release debugger from waiting for a client
        to attach.
        Ng      ?c              s     i  d  t t    i   f S(   i    (   t   record_client_heartbeatR'   R   R;   (    (   R2   (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRE    s    g?(	   t   cancel_request_go_timerR   R  RG  t   TimerR  R   RU  RV  (   R2   R   t   _timeoutRP  (    (   R2   s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   set_request_go_timer  s    
c         C   s1   |  i  } | d  j	 o d  |  _  | i   n d  S(   N(   R  R   t   cancel(   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    		c         C   sq   |  i  p d Sn t i   } | |  i j o |  i |  Sn |  i | } | i | _ |  i |  _ | |  _ d S(   s8   
        Set thread to break on next statement.
        N(	   R  RR  RS  R  R   R  R  R  R  (   R2   RP  R   t   ctx(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    
c         C   s   |  i  p d Sn t i   } | |  i j o d Sn |  i |  | |  _ | |  _ t i |  i	  t
 i |  i	  | d j	 o |  i	 | _ n d S(   s5   
        Start tracing mechanism for thread.
        N(   R  RR  RS  R  R  R  R  RG  R   Rs  R   R   R  (   R2   RP  t   f_break_on_initR   t   builtins_hackR   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    
		c         C   sh   t  a t i d  t i d  t i d  t |  _ |  i	   y |  i
   Wn t j
 o n Xd S(   s)   
        Stop tracing mechanism.
        N(   R   t   g_fignore_atexitRG  R   R   R   R  R'   R  t   set_all_tracersR;   R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   stoptrace  s    	
c         C   s   y |  i  | i SWn t j
 os |  i d  j o4 t |  |  i j o d  |  _ t | i d <qg n t | |  i	  } |  i  i
 | i |  Sn Xd  S(   NR  (   Ro  R  R  R  R   R  t   g_builtins_moduleR  RQ  Ri  R>  (   R2   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRe    s    	c         C   s'   t  |  i  d j o
 t  n |  i S(   Ni    (   RW   R  R   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   get_current_ctx  s    
c         C   s0   |  i  i | d   } | d  j o
 t  n | S(   N(   R  RX   R   R   (   R2   R   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   get_ctx  s    
c         C   sf   |  i  d j	 o d Sn z9 |  i i   x% |  i  d j o t |  i d  q+ WWd |  i i   Xd S(   s   
        Wait until at least one debuggee thread is alive.
        Python can have 0 threads in some circumstances as
        embedded Python and the Python interpreter console.
        Ng      ?(   R  R   R  RJ  RM  RL  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   wait_for_first_thread  s     c         C   s3   z |  i  i   |  i  i   Wd |  i  i   Xd S(   sD   
        Notify that first thread is available for tracing.
        N(   R  RJ  Rv  RL  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   notify_first_thread)  s    c         C   sO   xH | d j	 o: |  i |  } | i   o t | _ d Sn | i } q Wd S(   sF   
        Set trap for unhandled exceptions in relevant frame.
        N(   R   Re  R[  R   RT  R  (   R2   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   set_exception_trap_frame5  s     	c         C   s   x t  t t  i    D] \ } } | i d  p | d j o q n t i |  } | t i t i g j o q n y t i | |  Wq t d | | f  q Xq Wd S(	   s8   
        Set rpdb2 to wrap all signal handlers.
        R  R  R  R  R  s.   Failed to set signal handler for signal %s(%d)N(   s   SIG_IGNs   SIG_DFLs   SIGRTMINs   SIGRTMAX(	   R  R  R  R  Rl  t	   getsignalR  R  RT   (   R2   Rw   Ro   t   handler(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __set_signal_handlerC  s     c         C   s'   t  i   t   } |  i i |  d  S(   N(   R@  R6  RW  R  R  (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   clear_source_cacheU  s    
	c   	   
   C   s  | d	 j o d Sn |  i |  } | d j o | i   o d Sn |  i |  y t i   } | i   } Wn d } n X| d j o |  i   n t | |  | |  } | i	   zK |  i
 i   | |  i | i <t |  i  } | d j o |  i   n Wd |  i
 i   X| d j oB |  i   | |  _ |  i   |  i o t |  _ |  i   qdn t i | i  t i | i  |  i | d j  | d j o | i | | |  Sn< t | d  o' | i d j	 o | i | | |  Sn d Sd S(
   s)   
        Initial tracing method.
        t   callR  Rm  R   t
   MainThreadi   NR  (   s   calls   lines   return(   R   Re  RW  R  RG  t   currentThreadR5  t"   _CDebuggerCore__set_signal_handlerR\  R  R  RJ  R  R]  RW   t   prepare_embedded_syncRL  R  R  R  R  R'   Rx   R   R   R  R  Rt  t   wait_embedded_syncR  R  (	   R2   R  RM   RS  R  R  RD   R  t   nthreads(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRs  \  sJ    


	

	 c         C   s   |  i  p d  Sn t i   } |  i } | d j o |  i | |  n |  i   d j o d  Sn | | t j  o d  Sn | |  _ |  i i   d  S(   Ni    (	   R  RU  R  t   fix_heartbeatst   get_clients_attachedt   EMBEDDED_SYNC_THRESHOLDR  R  R6  (   R2   R  RZ  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    
		c         C   s   |  i  p d  Sn t i   } |  i } |  i } | | t j  o d  Sn | | t j o d  Sn | o t   } |  i i |  n t	 |  i
 t | |  | o d |  _ n d  S(   Ni    (   R  RU  R  R  R  t   EMBEDDED_SYNC_TIMEOUTRV  R  R  RM  R  (   R2   t   ftriggerR  RZ  t   t1RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    
			c         C   s   |  i  i   d  S(   N(   R  RA  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   embedded_sync  s    c         C   s.   x' t  |  i i    D] } | i   q Wd S(   sB   
        Set trace methods for all frames of all threads.
        N(   R  R  R3  R  (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s     c         C   sp   yA |  i  | =|  i i | j o  t |  i  i    d |  _ n Wn( t t f j
 o t i   |  _ n Xd  S(   Ni    (	   R  R  R]  R  R3  R  t
   IndexErrorRU  R  (   R2   t	   thread_id(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRr    s    
$c         C   s   |  i  i   t j |  _ d  S(   N(   R  R   RS   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   set_break_flag  s    c         C   s   |  i  o t Sn | i o t Sn |  i | i j o t Sn |  i | j o t Sn |  i | j o | d j o t Sn t S(   NRm  (   R  R   R`  R  R]  R  R  R'   (   R2   R  R  RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    

c         C   sr   | o |  i  i d d  n | o |  i  i | d  d Sn | p | |  i  j o t i   |  i  | <n d S(   s:   
        Record that client id is still attached.
        i    N(   R  RT  R   RU  (   R2   R  t   finitt   fdetach(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    c         C   s;   x4 t  |  i i    D] \ } } | | |  i | <q Wd  S(   N(   R  R  R  (   R2   t   missing_pulseR  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s     c         C   sU   d } t  i    } x< t |  i i    D]% } | | t j  o | d 7} q( q( W| S(   Ni    i   (   RU  R  R  R3  R  (   R2   Rx  R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  	  s     c         C   sF   |  i    d j o t Sn t |  i i    d g j o t Sn t S(   Ni   i    (   R  R'   R  R  R%  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   is_waiting_for_attach  s
    c         C   s  |  i  | | |  o  | i   o | i   d Sn t | _ t } t } |  i } z|  i i   |  i i	   t
 j o |  i   n t d j o% y t i d a Wq d a q Xn | i d j	 o# | i | i | i | i f  n y t i   } | i   | _ Wn n X| i o |  i o t |  _ t } n |  i | i  o4 |  i |  i |  i f |  _ d |  _ t |  i _ n |  i  p |  i! | j ob | |  _! | |  _" d |  _ d |  _# d |  _ d |  _ |  i i$ d | i%    t |  _  t } n Wd |  i i&   X|  i' |  }	 |  i( |  |  i | i  o |  i)   n|  i* oE |	 o> |  i \ |  _ |  _# |  _ d |  _ t |  i _ |  i)   n |  i+   d j o |  i)   n | | i j o! | i, i- d j o |  i.   nc | o |  i/ d  n! |  i0 | i | i  |  i1   | o |  i2   n |  i i3 t4 g  }
 |  i5 | i  |  i6 | i  t | _ t | _ | i   t7 o! t a7 |  i8   t9 i: d  n d S(	   s#   
        Main break logic.
        Nit   __main__RJ  i    Rx  g      ?(   NNN(;   R  R  R  R   R_  R'   R  R  RJ  R   RS   t   set_break_dont_lockt   g_module_mainR   R  R   Ry  R  R  R  RG  R  R5  R^  R`  t   is_auto_fork_first_stageR]  R  R  R  Ri  R=  R  R  R  R  RK  R7  RL  t   handle_forkt   handle_exect   request_go_quietRp  R  R  R  t   request_step_quietR  t   notify_thread_brokent   notify_namespacet   send_unhandled_exception_eventR  R  t   prepare_fork_stept   prepare_exec_stept
   g_fos_exitR  RU  RV  (   R2   R  R  RM   RS  t   f_full_notificationt   f_uhe_notificationt   step_tidR  t   ffork_second_stageR   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRp    s    %
		#	
									#
		

c         C   s)   |  i  p t Sn | t j o
 t d  j S(   N(   Rp  R'   t	   g_forktidt	   g_forkpidR   (   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    
c         C   s   | t  j o d  Sn | |  _ t i   a |  i p d  Sn |  i   } |  i |  t i	 d  t
 i   t i   t i   a d  S(   Ng      ?(   R  R  RC   RH  R  Ro  R  R  RU  RV  R   R5   R  R  t   g_ignore_broken_pipe(   R2   R   Rx  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    	


c         C   s   | i  } t d  j p | t j o t Sn t } d  a d  a t i   | j o$ |  i p t Sn |  i	   t Sn |  i p |  i	   t Sn h  | | <|  _
 t i   t i   t S(   N(   R]  R  R   R  R'   RC   RH  Ro  R   R  R  R  R  R   t	   jumpstart(   R2   R  R   t   forkpid(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s$    	





c         C   sh   | t  j o d  Sn | |  _ t i   a |  i   } |  i |  t i d  t	 i
   t i   d  S(   Ng      ?(   t	   g_exectidR  RC   RH  t	   g_execpidR  R  RU  RV  R   R5   R  R  (   R2   R   Rx  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    	
c         C   sO   | i  } t d  j p | t j o t Sn d  a d  a t i   t i   t	 S(   N(
   R]  R  R   R  R'   R  R  R   R  R   (   R2   R  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    	

c         C   s#   t  | |  } |  i i |  d S(   s   
        Notify that thread (tid) has broken.
        This notification is sent for each thread that breaks after
        the first one.
        N(   Rx  R  R  (   R2   R   RD   t   _event(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    c         C   s   t    } |  i i |  d S(   sF   
        Notify that a namespace update query should be done.
        N(   Rq  R  R  (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    	c         C   s   |  i  i   S(   N(   R  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    c         C   s$   |  i  i   t j o
 t  n d  S(   N(   R  R   RS   R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   verify_broken  s    c         C   sk   |  i    } zA d } | i   } | i | | |  \ } } t |  } | SWd d } d } | i   Xd S(   s   
        Return path of sources corresponding to the frame at depth
        'frame_index' down the stack of the current thread.
        N(   R  R   Ru  R|  R  Rw  (   R2   R   R  R  RP  R{  R'  t   frame_filename(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   get_current_filename  s    c         C   s   |  i  S(   N(   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   get_threads.  s    c         C   s7   t  |  _ |  i i t d t |  i   |  i   d  S(   NR  (   R   R  R  R  RS   R'   R  R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  2  s    	
c         C   s   t  |  i  d j o |  i   n z9 |  i i   |  i i   t j o d Sn |  i   Wd |  i i   X|  i	 d  d S(   s9   
        Ask debugger to break (pause debuggee).
        i    N(   RW   R  R  R  RJ  R   RS   R  RL  R  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRx   ;  s    c         C   s+   y |  i  |  Wn t j
 o n Xd  S(   N(   R;   R   (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  P  s    c         C   s   zj | o |  i  i   n |  i   t |  _ |  i  i t d t |  i o t i	 d  n |  i
   Wd | o |  i  i   n Xd S(   s#   
        Let debugger run.
        R  gQ?N(   R  RJ  R  R'   R`  R  R  R  RU  RV  R  RL  (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR;   X  s    
	
c         C   s   t  |  p t  t  |  p t  z |  i i   |  i   | d j o |  i | |  } n9 t |  p t | t	 i
    } n t | d t } |  i i | | |  |  i   |  i d t  Wd |  i i   Xd S(   sU   
        Let debugger run until temp breakpoint as defined in the arguments.
        R   R  R  N(   NR   (   R   Ri   R  RJ  R  R   R  RC  R   R   R  R  R   Ri  RN  R  R;   R'   RL  (   R2   Rb   Rz   R{   R   R  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRy   p  s    

c         C   s+   y |  i  |  Wn t j
 o n Xd  S(   N(   R|   R   (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    c      	   C   s   z~ | o |  i  i   n |  i   y |  i   } Wn t j
 o d Sn X| i |  _ d |  _ d |  _	 |  i
 d t  Wd | o |  i  i   n Xd S(   su   
        Let debugger run until next statement is reached or a breakpoint 
        is hit in another thread.
        NR  (   R  RJ  R  R  R   R]  R  R   R  R  R;   R'   RL  (   R2   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR|     s    
			c      	   C   s   z |  i  i   |  i   y |  i   } Wn t j
 o d Sn X|  i d j o |  i d t  Sn | i |  _	 d |  _ |  i d t  Wd |  i  i   Xd S(   s   
        Let debugger run until next statement in the same frame 
        is reached or a breakpoint is hit in another thread.
        NRm  Rn  R  (   s   returns	   exception(   R  RJ  R  R  R   R  R|   R'   Ra  R  R   R  R;   RL  (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR}     s    
		c      	   C   s   z |  i  i   |  i   y |  i   } Wn t j
 o d Sn X|  i d j o |  i d t  Sn d |  _	 | i
 |  _ |  i d t  Wd |  i  i   Xd S(   sy   
        Let debugger run until end of frame frame is reached 
        or a breakpoint is hit in another thread.
        NRm  R  (   R  RJ  R  R  R   R  R|   R'   R   R  Ra  R  R;   RL  (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR~     s    
		c      	   C   s   z |  i  i   |  i   y |  i   } Wn t j
 o d Sn X| i } | i } t |  } t t	 d  |  } | i
 |  } | | _ Wd d } |  i  i   X|  i d  d S(   s/   
        Jump to line number 'lineno'.
        NR   (   R  RJ  R  R  R   Ra  R  R  R  R   R  R  R   RL  R  (   R2   R{   R  R  R  R  R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s     
			c      	   C   s   z |  i  i   |  i   yN | d j o* | d j  o t |  i i    | } n | } |  i | } Wn t t f j
 o t  n X| |  _	 | i
 |  _ Wd |  i  i   X|  i d  d S(   s3   
        Switch focus to specified thread.
        i    id   N(   R  RJ  R  R  R  R%  R  R  R   R  Rb  R  RL  R  R   (   R2   R   t   _tidR  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    
	N(=   Rd   Re   Rf   R'   R4   R5   R  R  R  R  R  R  R  R   R   R   R   R  Re  R  R  R  R  R  R  R  Rs  R  R  R  R  Rr  R  R  R  R  R  R  Rp  R  R  R  R  R  R  R  R   R  R  R  R  Rx   R  R;   Ry   R  R|   R}   R~   R   R   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  2  sp   -																				=											
	m			+																t   CDebuggerEnginec           B   s  e  Z d  Z e d  Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z e d  Z d   Z d   Z d   Z d   Z d   Z  e d, d  Z" d   Z# d    Z$ d!   Z% d"   Z& d#   Z' d$   Z( d%   Z) d&   Z* d'   Z+ d(   Z, d)   Z- d*   Z. d+   Z/ RS(-   sV   
    Main class for the debugger.
    Adds functionality on top of CDebuggerCore.
    c         C   s-  t  i |  |  h  h  t <h  t <h  t <h  t <h  t <h  t <h  t <h  t	 <h  t
 <h  t <h  t <h  t <h  t <h  t <h  t <h  t <h  t <h  t <h  t <h  t <h  t <h  t <} t |  i  |  _ |  i i |  h  h  t <} |  i i |  i | d t d  S(   NR%   (    R  R4   R.   R  R  Rs  Rr  Rx  Rq  R+   R{  RU  R0   Rh  Ri  Rj  Rl  Rn  Ra  Rb  RX  R[  RW  RV  R  R  t   m_event_queueR  R  R,   R  R'   (   R2   R  R3   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   &  s8    																					c         C   s   |  i  i   t i |   d  S(   N(   R  R5   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR5   I  s    c         C   sV   t  |  i  d j o |  i   n |  i i   } t | |  } |  i i |  | S(   s0   
        Send debugger state to client.
        i    (   RW   R  R  R  R  R  R  R  (   R2   R  R  Rz  RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   sync_with_eventsP  s    c         C   s   g  } x t  D]{ } | t j o q n | t i j o q n | d j o t   } |  i i |  n t i |  | i t |   q W| g  j o t	 Sn t
 |  } |  i i |  t S(   NR;  (   t   CONFLICTING_MODULESt   g_found_conflicting_modulesR   R  Ra  R  R  RI  R   R'   Rb  R   (   R2   Rd  R	  RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   trap_conflicting_modules^  s"     	c         C   se   |  i    |  i   |  i i | |  \ } } |  i   o |  i i | |  \ } } n | | f S(   sH   
        Wait for new events and return them as list of events.
        (   R  R  R  R  (   R2   R   R  t   new_event_indext   sel(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  {  s    

c	         C   s  t  d t |  | | f  t |  p t  t |  p t  t |  p t  t }	 z0| d j o3 |  i i   t }	 |  i	   |  i
 | |  }
 n9 t |  p t | t i    }
 n t | d t }
 | d j oT y@ |  i | d |
 } t t | | |  } t | d d  Wq;t  q;Xn t |  } |  i i |
 | | | | |  } |  i   t |  } |  i i |  Wd  |	 o |  i i   n Xd  S(   Ns!   Setting breakpoint to: %s, %s, %dR   R  Rb   s   <string>R  (   NR   (   RT   R   R   Ri   R'   R   R  RJ  R   R  R  RC  R   R   R  R  t   _CDebuggerEngine__calc_encodingR   R   R  t   SyntaxErrorR   Ri  R   R  R  R  R  RL  (   R2   Rb   Rz   R{   R   R   R   R  R9   R  R   R$  R  RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s8    
!
c         C   sI   |  i  i | |  |  i   t d  t i | |  } |  i i |  d  S(   N(   Ri  R   R  R  R   R  R  R  (   R2   R   RQ   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    
c         C   sI   |  i  i | |  |  i   t d  t i | |  } |  i i |  d  S(   N(   Ri  R   R  R  R   R  R  R  (   R2   R   RQ   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    
c         C   sI   |  i  i | |  |  i   t d  t i | |  } |  i i |  d  S(   N(   Ri  R   R  R  R   R  R  R  (   R2   R   RQ   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    
c         C   sx   |  i  i   } g  } | i   D] \ } } | | t |  f q  ~ } x | D] \ } } d | _ qO Wt |  } | S(   s3   
        return id->breakpoint dictionary.
        N(   Ri  R   R  R  R   R  R  (   R2   Rk  Rr  R  R  t   _itemst   _bpl(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    9 c         C   s   t  | t  o | i } | i } n t } t } yz t  | t  o | o |  i i   n |  i   |  i |  |  i	 |  |  i
   | o |  i o |  i   n Wn- t j
 o |  i   n t     n Xd S(   sG   
        Send series of events that define the debugger state.
        N(   R  R  R  R  R'   R  R  t   send_stack_deptht   send_threads_eventt   send_stack_eventt   send_namespace_eventR`  R  R   t   send_no_threads_eventR  (   R2   RM   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s&    	

c         C   s   t    } |  i i |  d  S(   N(   R+   R  R  (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s    	c         C   s  |  i    } zpy d } | i   } Wn t j
 o d Sn Xzb t i   t i |  } g  } | D]1 \ } } } } t p | d j o | d qf qf ~ } Wd t i	   Xt
 |  }	 | i d j o
 d }
 n ze t i   t i | i  } g  } | D]1 \ } } } } t p | d j o | d q q ~ } Wd t i	   X|	 t
 |  d }
 t |	 |
  } |  i i |  Wd d } | i   Xd S(   sH   
        Send event with stack depth and exception stack depth.
        NRx  i   (   R  R   Ru  R   R  RJ  R  R  R  RL  RW   Ry  R  R  R  R  Rw  (   R2   R  RP  R_   Rr  R  R   Rs  R  R  R  R  R  RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR    s2    	
I

Ic   
      C   s   |  i    } | oZ | d } | d } g  } | D]" } | t | j o | | q2 q2 ~ } | | f } n | } t |   }	 |  i i |	  d S(   sr   
        Send event with current thread list.
        In case of exception, send only the current thread.
        i    i   N(   R   t   DICT_KEY_TIDRs  R  R  (
   R2   R  t   tlt   ctidt   itlRr  R  t   _itlt   _tlRM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  /  s    

6c         C   sT   |  i  g  t |  } t |  d j o d  Sn t | d  } |  i i |  d  S(   Ni    (   RV   R'   RW   R{  R  R  (   R2   R  R]   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  C  s
    c         C   s   t    } |  i i |  d S(   sI   
        Send event notifying namespace should be queried again.
        N(   Rq  R  R  (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  M  s    	c         C   s   t    } |  i i |  d  S(   N(   Rr  R  R  (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  V  s    	c         C   s   t    } |  i i |  d S(   s/   
        Make the event waiter return.
        N(   RU  R  R  (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   send_event_null[  s    	c         C   s  | i  } zYy d  } | i   } Wn t j
 o d  Sn X| } z t i   t |  } Wd  t i   X| o | i d  j o
 t	  n | i } x | i
 d  j	 o | i
 } q W| i } z t i   t | i  }	 Wd  t i   X| d  |	 } n g  }
 x] | d  j	 oO t | i  i d  d i   d } t |  } |
 i d |  | i } qWWd  d  } d  } | i   Xg  } | D]= \ } } } } t p | d j o | | | | | f qq~ } | i d  j	 oM t |  d j o: | d \ } } } } | | i | | f g | d } n h  } | | t <|
 | t <| | t <| i | t <t | i  | t <| | j o t | t <n | S(   NiR  i    Rx  i   (    R]  R   Ru  R   R  RJ  R  RL  Ry  R   R  R  R  R   R  Rr  R   R  R  Rw  R  Rd  RW   RY   t   DICT_KEY_CODE_LISTR  R_  t   DICT_KEY_BROKENRb  t   DICT_KEY_EVENTR   t   DICT_KEY_CURRENT_TID(   R2   R  R  R  R   RP  t   _fR_   t   _tbR  R$  t   rcRr  R  R   Rs  R  t   _CDebuggerEngine__sR  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __get_stackd  s`    		

	 	
 &Q#$


c      	   C   s4  | o$ | p t  |  d j o
 t  n |  i   } | i } | o t |  i   i    } n[ | p t  |  d j o | g } n4 g  } | D] } | |  i   i | d   q ~ } g  }	 | D]- } | d  j	 o |	 |  i	 | | |  q q ~	 }
 g  } |
 D] } | d  j	 o | | q	q	~ } | S(   Ni    (
   RW   R   R  R]  R  R  R3  RX   R   t   _CDebuggerEngine__get_stack(   R2   RP   RQ   R  R  R  t   ctx_listRr  R  R  t   _slt   _[3]R_   R]   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRV     s    !
	3A2c         C   s  t  |  p t  | d j  o d } d } n | } h  } d  } y |  i   }	 zC d  }
 d  } |	 i   } |	 i | | |  \ }
 } t |
  } Wd  d  }
 d  } |	 i   X|	 i d g | d j d g | } Wn' t	 j
 o | d j o   q n X| d j o | } |	 i
 | t <nP t |  p t | t i    } n* t | d t } t |  p
 t  n t |  } g  } h  } t } x| d j oqz t i   t | |  } Wd  t i   X| d j o Pn | oA d | j o t d	  } qd
 | i d d  d } t } ny d | j ok | i d d  } | d d } d | d j o& | d | d i d d  d 7} q| d 7} t } n | i |  y9 |  i i | |  } t t t  g | i!    | | <Wn t" j
 o n X| d 7} | d 8} qW| | j o+ | | t# <t |  | t$ <|	 i% | t& <n | | t' <t | t i    | t( <| | t) <| | t* <| S(   Ni   iR  i    Rn  R   R  R  s   ...
s   ...""")s   start_embedded_debugger(s=   start_embedded_debugger("""...Removed-password-from-output...s   """)s   
(   NR   (   NR   (+   R   Ri   R   R  Ru  R|  R  Rw  Rb  R   R]  R  RC  R   R   R  R  R   R  R   R  R'   R  RJ  R  RL  R   Rr  RI  Ri  R7  t   STATE_DISABLEDt   STATE_ENABLEDR(  R  t   DICT_KEY_FRAME_LINENOR  R_  R  t   DICT_KEY_LINESt   DICT_KEY_FILENAMEt   DICT_KEY_BREAKPOINTSt   DICT_KEY_FIRST_LINENO(   R2   Rb   R{   R   R   R  t   _linenoR  R  R  RP  R{  R'  t   frame_eventt   _CDebuggerEngine__filenameR   R%  R  t   fhide_pwd_modeR  t   lsR  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR     s    
'
 

&

$




c         C   s  | i  } d | g | |  i i  j } zg yC d  } d  } | i   } | i | | |  \ } }	 t |  }
 Wn t t f j
 o d  Sn XWd  d  } d  } | i   X| i	 d g | d j d g | } t
 d |	 | d  } | } g  } h  } t } x| d j oqz t i   t |
 |  } Wd  t i   X| d j o Pn | oA d | j o t d  } qd	 | i d d  d } t } ny d
 | j ok | i d
 d  } | d d } d | d j o& | d | d i d d  d 7} q| d 7} t } n | i |  y9 |  i i |
 |  } t t t g | i    | | <Wn t j
 o n X| d 7} | d 8} q Wh  } |	 | t <t |  | t <| i | t <| | t <| | t <t |
 t  i!    | t" <| | t# <| | t$ <| S(   Ni    R  Rn  i   i   R   R  s   ...
s   ...""")s   start_embedded_debugger(s=   start_embedded_debugger("""...Removed-password-from-output...s   """)s   
(%   R]  R  R   Ru  R|  R  R   R   Rw  Rb  R  R'   R  RJ  R  RL  R   Rr  R   RI  Ri  R7  R%  R&  R(  R  R'  R  R_  R  R  R(  R   R  R)  R*  R+  (   R2   R  R   R   R  R   t   _frame_indexRP  R{  R'  R  R-  t
   first_lineR,  R%  R  R/  R  R0  R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __get_source)   st    	# 

&

$





c         C   s   | o | o
 t   n | o t |  i   i    } n |  i   } | g } g  } | D] } | |  i | | | |  q[ ~ } g  }	 | D] }
 |
 d  j	 o |	 |
 q q ~	 } | S(   N(   R   R  R  R3  R  t   _CDebuggerEngine__get_sourceR   (   R2   R   RQ   R   R  R"  R  Rr  R#  R  R_   R]   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR      s    
	32c         C   s7   |  i    } | i | | |  \ } } } | | | f S(   N(   R  R  (   R2   R   R  R  R  t   _globalst   _localst   _original_locals_copy(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __get_locals_globals   s    c      	   C   s.  t  t |   t j o d Sn y y2 t | t  p t | t  o t |  Sn Wn t j
 o n Xt | t i	  o t |  Sn t | t
  o t |  Sn t | t  o t |  Sn t | t  o t |  Sn t | d  p t | d  o d Sn Wn t j
 o d Sn Xd S(   Ni    R  R  i   (   R  Rn   t   BASIC_TYPES_LISTR  R  RA  RW   R  R]  R_  R  R  R  R  R  (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __calc_number_of_subnodes   s*      	c         C   s  g  } yst  | t  p t  | t  oOt |  t j o
 | } n/ g  }	 | D] }
 |	 |
 qQ ~	 } | i t  x | D] }
 t |  t j o | i t	  Pn t
 g } t |
 t d t } h  } t d | t | i d d  f  | t <t |
 | |  | t <t |
 | | |  | t <| d | t <t t t |
    | t <|  i |
  | t <| i |  q{ W| Sn Wn t j
 o n Xt  | t i  oOt |  t j o
 | } n/ g  } | D] }
 | |
 q~ } | i t  x | D] }
 t |  t j o | i t	  Pn t
 g } t |
 t d t } h  } t d | t | i d d  f  | t <t |
 | |  | t <t |
 | | |  | t <| d | t <t t t |
    | t <|  i |
  | t <| i |  qW| Sn t  | t  p t  | t  o x t | d t ! D] \ }
 } t
 g } h  } t d | |
 f  | t <t t |
   | t <t | | | |  | t <| d | t <t t t |    | t <|  i |  | t <| i |  q%Wt |  t j o | i t	  n | Sn t  | t   o| d j og | d j oZ t! i! |  } xH t | i"    D]0 \ } } t t |   d j o | | =qOqOWn t |  t j o
 | } n  t | i#    } | i t  x| D]} | d j o qn | | } t |  t j o | i t	  Pn t
 g } h  } t |  t$ t% t& t' t( t) t d   g j oA t |  } t |  t j  o t d | | f  | t <qn t |  t+ j oE t |  } t |  t j  o" t d | | d f  | t <qn t | j oB t | t d t } t d | t | i d d  f  | t <n t t | | |  | g |  | t <t | | | |  | t <| d | t <t t t |    | t <|  i |  | t <| i |  qW| Sn t, | |  } | i t  x| D]} | d j o qn y t- | |  } Wn t. j
 o
 qn Xt |  t j o | i t	  Pn t
 g } h  } t d | | f  | t <t |  | t <t | | | |  | t <| d | t <t t t |    | t <|  i |  | t <| i |  qW| S(   NR9   s   _RPDB2_FindRepr((%s), %d)["%s"]R  s   &quoti    s   (%s)[%d]i   s   locals()s	   globals()R  t   classobjRn   R  t   _RPDB2_builtinsR  R   R  s   (%s)[%s]s   (%s)[str8(%s)]i   s   (%s).%s(   s   locals()s	   globals()(   s   functions   classobjs   type(   s   _RPDB2_FindReprR<  s   _rpdb2_argss
   _rpdb2_pwds   m_rpdb2_pwd(/   R  R  RA  RW   R  R  R  t   MAX_NAMESPACE_ITEMSRI  t   MAX_NAMESPACE_WARNINGR   R  t   REPR_ID_LENGTHR  R   R   t   DICT_KEY_EXPRt   DICT_KEY_NAMEt   DICT_KEY_REPRt   DICT_KEY_IS_VALIDR  Rn   t   DICT_KEY_TYPEt)   _CDebuggerEngine__calc_number_of_subnodest   DICT_KEY_N_SUBNODESR  R]  R_  R  R  R  R   R  R  R  R%  R9  R   R8  R5  R   R   R   R6  R  R  R  (   R2   R   R  t   fForceNamesR   R   R9   t   snlt   gRr  Rc  R  t   rkR`   R  R  R  t   klR  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __calc_subnodes   s     
! 	)
! 	)  	 
 
	."&-& 	c         C   s   |  i    } ze d  } d  } | i   } | i | | |  \ } } h  | i d <| i d <| i d <} | SWd  d  } d  } | i   Xd  S(   NRn   Ro   R  (   R  R   Ru  R|  R  R  Ry  Rw  (   R2   R   R  R  RP  R{  R'  R`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   get_exception\!  s    *c         C   s-   x& | D] } | i  |  o t Sq q Wt S(   N(   Rl  R   R'   (   R2   t   failed_expr_listR   t   failed_expr(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   is_child_of_failurep!  s
     c      
   C   s  h  } y;| } | } t  | j o( |  i | |  } t   } t   } n t | d <t g } t | | |  } t |  | t <t	 | | | |  | t
 <| d | t <t t t |    | t <|  i |  | t <| od | t d j oS | d j p
 t  | j } |  i | | | | | |  | t <t | t  | t <n Wn* t   t t t i     | t <n X| i   t |
  | j o |
 i |  n | i   |	 i   d  S(   NR  i    s	   globals()s   locals()(   s	   globals()s   locals()(   t   RPDB_EXEC_INFORM  R^  t   localsR  R   R  R   R@  R  RB  RC  R  Rn   RD  RE  RF  t   _CDebuggerEngine__calc_subnodest   DICT_KEY_SUBNODESRW   R  R~  R   R  t   DICT_KEY_ERRORRJ  RI  RL  RA  (   R2   R   t   fExpandR   R   R  R5  R6  RN  RM   t   rlRz  R   R9   R`   t   _CDebuggerEngine__globalst   _CDebuggerEngine__localsR,  R  R  RG  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   calc_exprx!  s8    	
	" 

c         C   s   | t  j o | o | Sn | t  j o# y t i |  | SWqM qM Xn | d  j o |  i   } | i i } n y t |  } | SWn d Sn Xd  S(   Ns   utf-8(   t   ENCODING_AUTORi  Rj  R   R  Rf  R  RD  (   R2   R9   t	   fvalidateRb   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __calc_encoding!  s     c         C   s  | o
 t  } n |  i | d t } y% |  i | | d t \ } }	 }
 Wn t     n Xg  } g  } d } t i   } xH| D]@\ } } |  i | |  o q n t i   } | | | | | | |	 | | | | | | f } |  i	 o* t
 i i d |  i d | d d |  n: y/ |  i   } | i } t | d |  i |  Wn n Xt | d  | i   t |  | j o | i d	  | i |  n | d
 7} | i   t |  d j o Pq q Wg  } | D] } | d	 j o | | qq~ } | S(   NR\  R  i    R  R   RD   s   calc_expr %si   R+  i   i   (   R  R  R   t$   _CDebuggerEngine__get_locals_globalsR  RG  R  RP  RH  Rk  R   t   m_work_queuet   post_work_itemRZ  R  R]  RQ  RM  RJ  RW   RI  RL  (   R2   R   R   R   R  R   R9   R   R5  R6  R}  RN  RW  Rz  RN  R   RV  RM   R   R  R   Rr  R  t   _rl(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   !  sJ    
% -
*	


	2c   	      C   s   t  d  t  t  t  d  f g } |  i o  |  i | | | | | |  nI y> |  i   } | i } t | d |  i | | | | | | 	 Wn n X| d S(   sQ   
        Evaluate expression in context of frame at depth 'frame-index'.
        R   i  i(   R   t   STR_SYNCHRONICITY_BADRk  t	   _evaluateR  R]  RQ  (	   R2   R   R   R  R9   R   t   resultR  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   !  s    $
 	)c         C   s  |  i  |  } |  i | |  \ } } }	 d }
 d } d } y d | j p d | j o
 d } nz t t | | | d t } d | j o t t  | d <n z t } t | | |  } Wd ~ d | j o | d =n X| o
 t } n t	 | t
 |  }
 t |
  t
 j o |
 d t 7}
 t } n Wn7 t i   } d	 t | d
  t | d  f } n X|  i   | i t |
  t |  t |  f  d S(   sQ   
        Evaluate expression in context of frame at depth 'frame-index'.
        R   R   R  s"   ...Removed-password-from-output...R   R<  Ns   ... *** %s ***s   %s, %si    i   (   R  R^  R   R   R   R  R  R  R  R  t   MAX_EVALUATE_LENGTHRW   t   STR_MAX_EVALUATE_LENGTH_WARNINGR   R  Rq  R  RI  R   (   R2   Rd  R   R   R  R9   R   R5  R6  R}  R  R  R`   R  R$  t   redirect_exc_infoR  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRc   "  s8    

(
c         C   s   t  t  t  d  f g } |  i o |  i | | | | |  nF y; |  i   } | i } t | d |  i | | | | |  Wn n X| d S(   sg   
        Execute suite (Python statement) in context of frame at 
        depth 'frame-index'.
        R   i  i(   R   Rb  Rk  t   _executeR  R]  RQ  (   R2   R   R   R  R9   Rd  R  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   4"  s    
	&c         B   s  e  d e |   |  i |  } |  i | |  \ } } } | d j o  | | j	 o e i |  }	 n d }
 d } y d | j o d | j o e | d <n zU e e | | | d e } e	 | d d  } z e } | | | f d UWd ~ XWd d | j o d | j o | d =n XWn7 e
 i   } d	 e | d  e | d
  f } n X| d j o| | j	 o | |	 j o g  } | i   D] \ } } | | e |  f q~ } e |  } g  } |	 i   D] \ } } | | e |  f q~ } e |  } g  } | | D]$ \ } } | | j o | | qq~ } e |  d j o
 e }
 qin |  i   | i e |
  e |  f  d S(   sg   
        Execute suite (Python statement) in context of frame at 
        depth 'frame-index'.
        s   exec called with: i    R   R  R   s   <string>R  Ns   %s, %si   (   RT   R   R  R^  R  R  R   R   R   R  R   R  Rq  R  R~  RA  RW   t   STR_LOCAL_NAMESPACE_WARNINGR  RI  R   (   R2   Rd  R   R   R  R9   R5  R6  R7  t   _locals_copyR  R`   t   _suitet   _codeRg  R  Rr  R  R  R  R]   R  R  t   slcR$  t   nsc(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRh  I"  s@    ('99<
c         C   s   t  |  } | S(   N(   R   (   R2   RD   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __decode_thread_name"  s    c         C   s   |  i    } | d j o
 d } n
 | i } t |  i   i    } g  } xd | D]\ } h  } | i | t <|  i | i  | t	 <| i
 | t <t | i  | t <| i |  qQ W| | f S(   sT   
        Return thread list with tid, state, and last event of each thread.
        iN(   R  R   R]  R  R  R3  R  t$   _CDebuggerEngine__decode_thread_nameR^  RA  R_  R  R   Rb  R  RI  (   R2   R  t   current_thread_idR"  R  Rs  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   "  s    
	 c         C   s&   t  i i d t d t f d d  d S(   s@   
        Notify the client and terminate this proccess.
        R  R   RD   t   _atexitN(   R   R_  R`  Rr  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR=   "  s    c         C   sM   | |  _  t |  } |  i i |  |  i i   t j o |  i   n d  S(   N(   Rk  Rj  R  R  R  R   RS   R  (   R2   R   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   "  s
    	c         C   s)   | |  _  t |  } |  i i |  d  S(   N(   Rm  Rl  R  R  (   R2   R   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   "  s    	c         C   s   |  i  S(   N(   R`  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRU   "  s    c         C   s5   | |  _  | |  _ t | |  } |  i i |  d  S(   N(   Ro  Rp  Rn  R  R  (   R2   R   R   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   "  s    		c   
      C   sN  t  d t |   t |  d j o d  Sn t i i d d  } t   } x | D] \ } } y. t | | d t } t | | d t } Wn
 qT n Xd | } z t a	 t
 i |  } Wd  t a	 X| i   } | i   | d d j o | d  } n | t i | <qT Wd g  }	 | D] \ } } |	 | q~	 j o t |  n d  S(	   Ns&   Entered set_environ() with envmap = %si    R  R   R   s   echo %sis   
(   RT   R   RW   RC   R  RX   Rh  R   R   t   g_fignoreforkt   platformt   popenR'   R  R  R  (
   R2   R   R  R9   R  R  R1  RP  Ro   Rr  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   "  s0    	 

.N(0   Rd   Re   Rf   R'   R4   R5   R  R  R  R   R   R   R   R   R  R  R  R  R  R  R  R  R!  RV   R   R4  R   R^  RE  RS  RM  RP  RZ  R   R  R   R   Rc  R   Rh  Rp  R   R=   R   R   RU   R   R   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR      sX   #					+					 		-		
						G		j	X		!				(	3		4		;				
			t
   CWorkQueuec           B   sA   e  Z d  Z e d  Z d   Z d   Z d   Z d d  Z RS(   s;   
    Worker threads pool mechanism for RPC server.    
    c         C   sJ   t  i   |  _ g  |  _ t |  _ | |  _ d |  _ d |  _ |  i	   d  S(   Ni    (
   RG  R  R  t   m_work_itemsR'   t   m_f_shutdownt   m_sizet   m_n_threadst   m_n_availablet   _CWorkQueue__create_thread(   R2   t   size(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   "  s    					c         C   s/   t  d d d |  i d |  i  } | i   d  S(   NRD   t   __worker_targetR  R5   (   R  t   _CWorkQueue__worker_targetR5   R   (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __create_thread#  s    !c         C   s   |  i  o d Sn t d  |  i i   t |  _  |  i i   t i   } x[ |  i d j oJ t i   | t j o |  i i	   t d  d Sn t
 |  i d  qN W|  i i	   t d  d S(   sH   
        Signal worker threads to exit, and wait until they do.
        Ns   Shutting down worker queue...i    s(   Shut down of worker queue has TIMED OUT!g?s!   Shutting down worker queue, done.(   Rx  RT   R  RJ  R   RK  RU  Rz  R	  RL  RM  (   R2   RZ  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR5   #  s     

	 
c      	   C   s  z|  i  i   |  i d 7_ |  i d 7_ |  i o |  i |  i j  } |  i  i   | o |  i   n |  i  i   x'|  i pt |  i   |  i o Pn t	 |  i
  d j o q} n |  i d j } |  i
 i   \ } } } |  i d 8_ |  i  i   | o t d  |  i   n t i   i d |  y | |   Wn t   n Xt i   i d  |  i  i   |  i d 7_ |  i |  i j o Pq} q} W|  i d 8_ |  i d 8_ |  i  i   Wd  |  i  i   Xd  S(   Ni   i    s    Creating an extra worker thread.s   __worker_target - R~  (   R  RJ  Rz  R{  Rx  Ry  RL  R|  RM  RW   Rw  RT  RT   RG  R  t   setNameR  RK  (   R2   t   fcreate_threadR  R   RD   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR~  *#  sJ     



R   c         C   sp   |  i  o d  Sn zI |  i i   |  i  o d  Sn |  i i | | | f  |  i i   Wd  |  i i   Xd  S(   N(   Rx  R  RJ  Rw  RI  Rv  RL  (   R2   R  R   RD   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR`  d#  s    

(	   Rd   Re   Rf   t   N_WORK_QUEUE_THREADSR4   R|  R5   R  R`  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRv  "  s   			:t   CUnTracedThreadingMixInc           B   s   e  Z d  Z d   Z RS(   s   
    Modification of SocketServer.ThreadingMixIn that uses a worker thread
    queue instead of spawning threads to process requests.
    This mod was needed to resolve deadlocks that were generated in some 
    circumstances.
    c         C   s2   t  i i d t i i d |  | | f d d  d  S(   NR  R   RD   t   process_request(   R   R_  R`  t   SocketServert   ThreadingMixInt   process_request_thread(   R2   t   requestt   client_address(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  #  s    (   Rd   Re   Rf   R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  z#  s   c         C   s?   t  i   \ } } | i |   | i   | i   | i   f S(   st   
    Modification of Python 2.3 xmlrpclib.loads() that does not do an 
    import. Needed to prevent deadlocks.
    (   t	   xmlrpclibt	   getparsert   feedR  t   getmethodname(   R  R#  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   my_xmlrpclib_loads#  s    
t   CXMLRPCServerc           B   s[   e  Z e i e j o
 e Z n e Z d d   Z	 e
 i d  d j o
 e	 Z n d   Z RS(   c         C   s   t  |  \ } } yT | d  j	 o | | |  } n |  i | |  } | f } t i | d d } Wnm t i j
 o& t i   d } t i |  } n: t i t i d d t i t i	 f   } t
   n X| S(   Nt   methodresponsei   s   %s:%s(   R  R   t	   _dispatchR  RB  t   FaultR   R  t   exc_typet	   exc_valueR  (   R2   R  t   dispatch_methodt   paramsR  t   responset   fault(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __marshaled_dispatch#  s    	%i   i   c         C   sF   t  d t    t d t i   j o d  Sn t i i |  | |  S(   Ns   handle_error() in pid %di   (   RT   RI  R  RU  t   SimpleXMLRPCServert   handle_error(   R2   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  #  s    N(   i   i   (   Rd   Re   RC   RD   Rc  R   t   allow_reuse_addressR'   R   t"   _CXMLRPCServer__marshaled_dispatchR   R   t   _marshaled_dispatchR  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  #  s   

t   CPwdServerProxyc           B   sA   e  Z d  Z d d d  Z d   Z d   Z d   Z d   Z RS(   s`   
    Encrypted proxy to the debuggee.
    Works by wrapping a xmlrpclib.ServerProxy object.
    i    c         C   sL   | |  _  t i | |  |  _ t   |  _ | |  _ t |  i t  |  _	 d  S(   N(
   t   m_cryptoR  t   ServerProxyt   m_proxyR_  t   m_fEncryptiont   m_target_ridR  t   DISPACHER_METHODt   m_method(   R2   t   cryptot   urit	   transportt
   target_rid(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   #  s
    		c         C   s   | |  _  d  S(   N(   R  (   R2   t   fEncryption(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __set_encryption#  s    c         C   s   |  i  S(   N(   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   #  s    c      
   C   s  xt  oy |  i   } t |  | |  i f } |  i i | |  \ } } } t t    } |  i | | | | |  }	 |	 \ } } } } |  i i | | | | d t	 \ \ }
 } } } | d j	 o
 |  n Wnt j
 o3 t i   d } |  i i | i | i  q n~t i j
 oEt i   d } t t  | i j oB | i i d  } d | d g t |  d j } t |   n t t  | i j o
 t  qt t  | i j o+ |  i i o |  i t	  q n t  qt t  | i j o
 t  qt t  | i j o
 t  qt t  | i j o
 t  qt   t	 p t   n+ t i! j
 o t" d |  t#  n X| Sq Wd S(   sG   
        Call debuggee method 'name' with parameters 'params'.
        R1  i   Rp  R   i    s   Caught ProtocolError for %sN($   R   R   R   R  R  R+  R"   R  R2  R'   R   R   R   R  R!  R   R   R  R  Rt  R   t   faultStringRr  RW   R   R   R  t    _CPwdServerProxy__set_encryptionR   R   R   R  Ri   t   ProtocolErrorRT   R   (   R2   RD   R  R)  R   R*  R  R0  t   rpdb_versionR  R   t   _rt   _eR  R`   R  R_   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   __request#  sR     0 




c         C   s   t  i |  i |  S(   N(   R  t   _Methodt   _CPwdServerProxy__request(   R2   RD   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  -$  s    N(	   Rd   Re   Rf   R   R4   R  R   R  R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  #  s   
			Ft	   CIOServerc           B   sh   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z RS(   s)   
    Base class for debuggee server.
    c         C   s   t  |  p t  t  |  p t  d  |  _ t | | |  |  _ | |  _ | |  _ d  |  _ t	 |  _
 d  |  _ d  |  _ d  S(   N(   R   Ri   R   t   m_threadR  R  t   m_fAllowRemoteRB   R  R'   t   m_stopt   m_serverR_  (   R2   R   R   R   RG   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   7$  s    						c         C   s   |  i    d  S(   N(   t   stop(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR5   I$  s    c         C   sE   t  d d d |  i d |  i  |  _ |  i i t  |  i i   d  S(   NRD   t   ioserverR  R5   (   R  R  R5   R  t	   setDaemonR   R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   M$  s    $c         C   s   t  |  _ |  i   d  S(   N(   R'   R  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  S$  s    	c         C   s   |  i  o d  Sn t d t    t |  _  xv |  i i   oe y2 t |  i t t	 |  i
  t    } | i   Wn t i t f j
 o n X|  i i d  q/ Wd  |  _ |  i i   t d  d  S(   Ns    Stopping IO server... (pid = %d)g      ?s   Stopping IO server, done.(   R  RT   RI  R   R  R  R  R  RL  R  R  t   CLocalTimeoutTransportt   nullR  R+  R   R   R   R_  R5   (   R2   t   proxy(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  X$  s    
	 $	c         C   s   d S(   Ni    (    (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_nullu$  s    c         C   sn   |  i  d  j o |  i   \ |  _ |  _  n t   |  _ |  i  i |  i  x |  i p |  i  i	   qN Wd  S(   N(
   R  R   t   _CIOServer__StartXMLRPCServerR  Rv  R_  t   register_functionR3  R  t   handle_request(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  y$  s     
c         C   s  | t  t    j o t t  t      n yy. |  i i | | | |  \ \ } } } }	 Wno t j
 oc t i   d }
 |  i i	   } | d |
 f } |  i i | |  \ } } } | | | | f Sn Xd } d }
 y t |  d |  } Wn' t j
 o t d d |   n XyJ | d j o | |  i j o
 t  n |  i |	 | |  | |   } Wn0 t j
 o$ t i   d } t   | }
 n X|  i i	   } | | |
 f } |  i i | |  \ } } } | | | | f SWn t     n Xd S(   s#   
        Process RPC call.
        i   t   export_s   method "%s" is not supportedi    N(   R   R"   R   R    R  R2  R   R   R  R"  R   R+  R  R  R   RB   R   R  R  (   R2   R  R)  R*  R  R0  RD   t   _CIOServer__paramsR  t	   client_idR`   R   R   R  t   funcR  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR3  $  sB    .
c         C   s   t  d g |  i } t } x t o y& t | | f d d } | | f SWq t i j
 o] t i   d } t	 |  t
 i j o   n | t t d j o   n | d 7} q q Xq Wd S(   ss   
        As the name says, start the XML RPC server.
        Looks for an available tcp port to listen on.
        R   t   logRequestsi    i   N(   R  R  R  R   R  R  R+  R   R  RM  R  R  R  (   R2   R$   RJ  R  R`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __StartXMLRPCServer$  s     
c         C   s   d  S(   N(    (   R2   R  RD   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  $  s    (   Rd   Re   Rf   R4   R5   R   R  R  R  R  R3  R  R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  2$  s   								G	t   CServerInfoc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s   t  |  p t  | |  _ | |  _ | |  _ t | t i    |  _ t t	 |  t i    |  _
 | |  _ t |  |  _ | |  _ d  S(   N(   R   Ri   t   m_ageR  t   m_pidR   R   R  R  R  t   m_module_nameRB   RR   R  (   R2   t   ageRJ  t   pidRb   RG   R   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   $  s    				c         C   s+   t  i t |   f t |   d  d  f } | S(   N(   RO  RP  Rn   R  R   (   R2   RQ  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRR  $  s    'c         C   s&   d |  i  |  i |  i |  i |  i f S(   Ns1   age: %d, port: %d, pid: %d, filename: %s, rid: %s(   R  R  R  R  RB   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   $  s    (   Rd   Re   R4   RR  R   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  $  s   		t   CDebuggeeServerc           B   sF  e  Z d  Z d# d  Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d	   Z d
   Z d   Z d   Z d   Z e d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z  d   Z! d   Z" d   Z# d    Z$ d!   Z% d"   Z& RS($   s,   
    The debuggee XML RPC server class.
    c         C   s   | d  j o t   } n t |  p t  t |  p t  t i |  | | | |  | |  _ t   |  _ t	 i	   |  _
 | |  _ | |  _ d  S(   N(   R   RU  R   Ri   R  R4   R  RI  R  RU  t   m_timet
   m_debuggerRB   (   R2   Rb   t   debuggerR   R   R   RG   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   %  s    		c         C   s   t  i |   d  S(   N(   R  R5   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR5   %  s    c         C   s?   | d j } | d j o
 t  | j } |  i i | | |  d  S(   NRx   R;   (   R   R  R  (   R2   R  RD   R  R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  %  s    c         C   s   |  i  i   S(   N(   R  R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  "%  s    c         C   s_   t  i    |  i } |  i i   } |  i i   } t | |  i |  i |  i |  i	 | |  } | S(   N(
   RU  R  R  R   R  R  R  R  R  RB   (   R2   R  R   R  RF   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_server_info&%  s
    *c         C   s   |  i  i | |  } | S(   N(   R  R  (   R2   R  R  t   ei(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_sync_with_events/%  s    c         C   s%   |  i  i | |  \ } } | | f S(   N(   R  R  (   R2   R   R  R  R_   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_wait_for_event4%  s    c	   	   	   C   s)   |  i  i | | | | | | | |  d S(   Ni    (   R  R   (	   R2   Rb   Rz   R{   R   R   R   R  R9   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_set_breakpoint9%  s    %c         C   s   |  i  i | |  d S(   Ni    (   R  R   (   R2   R   RQ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_disable_breakpoint>%  s    c         C   s   |  i  i | |  d S(   Ni    (   R  R   (   R2   R   RQ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_enable_breakpointC%  s    c         C   s   |  i  i | |  d S(   Ni    (   R  R   (   R2   R   RQ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_delete_breakpointH%  s    c         C   s   |  i  i   } | S(   N(   R  R   (   R2   Rk  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_get_breakpointsM%  s    c         C   s   |  i  i   d S(   Ni    (   R  Rx   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_request_breakR%  s    c         C   s   |  i  i   d S(   Ni    (   R  R;   (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_request_goW%  s    c         C   s    |  i  i | | | | |  d S(   Ni    (   R  Ry   (   R2   Rb   Rz   R{   R   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_request_go_breakpoint\%  s    c         C   s   |  i  i   d S(   Ni    (   R  R|   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_request_stepa%  s    c         C   s   |  i  i   d S(   Ni    (   R  R}   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_request_nextf%  s    c         C   s   |  i  i   d S(   Ni    (   R  R~   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_request_returnk%  s    c         C   s   |  i  i |  d S(   Ni    (   R  R   (   R2   R{   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_request_jumpp%  s    c         C   s   |  i  i | | |  } | S(   N(   R  RV   (   R2   RP   RQ   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_get_stacku%  s    c         C   s"   |  i  i | | | | |  } | S(   N(   R  R   (   R2   Rb   R{   R   R   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_get_source_filez%  s    c         C   s   |  i  i | | | |  } | S(   N(   R  R   (   R2   R   RQ   R   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_get_source_lines%  s    c         C   s   |  i  i   } | S(   N(   R  R   (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_get_thread_list%  s    c         C   s   |  i  i |  d S(   Ni    (   R  R   (   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_set_thread%  s    c   	      C   s(   |  i  i | | | | | | |  } | S(   N(   R  R   (	   R2   R   R   R   R  R   R9   R   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_get_namespace%  s    $c   	      C   s4   |  i  i | | | | |  \ } } } | | | f S(   N(   R  R   (	   R2   R   R   R  R9   R   R  R  R`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_evaluate%  s    'c         C   s+   |  i  i | | | |  \ } } | | f S(   N(   R  R   (   R2   R   R   R  R9   R  R`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_execute%  s    !c         C   s   |  i  i   d S(   Ni    (   R  R=   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_stop_debuggee%  s    c         C   s   |  i  i |  d S(   Ni    (   R  R   (   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_set_synchronicity%  s    c         C   s   |  i  i |  d S(   Ni    (   R  R   (   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt$   export_set_trap_unhandled_exceptions%  s    c         C   s   |  i  i   S(   N(   R  RU   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_is_unhandled_exception%  s    c         C   s   |  i  i | |  d S(   Ni    (   R  R   (   R2   R   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_set_fork_mode%  s    c         C   s   |  i  i |  d S(   Ni    (   R  R   (   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_set_environ%  s    c         C   s   |  i  i   d S(   Ni    (   R  R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   export_embedded_sync%  s    N('   Rd   Re   Rf   R   R4   R5   R  R  R  R  R  R  R  R  R  R  R  R'   R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  %  sF   																																t   CTimeoutHTTPConnectionc           B   s   e  Z d  Z e Z d   Z RS(   sR   
        Modification of httplib.HTTPConnection with timeout for sockets.
        c         C   sZ  d } x0t  i |  i |  i d t  i  D]} | \ } } } } } ym t  i  | | |  |  _ |  i i |  i  |  i d j o t	 d |  i |  i f  n |  i i
 |  Wn t  i j
 or t i   d } |  i d j o$ t	 d t |  i |  i f   n |  i o |  i i   n d |  _ q( n XPq( W|  i p t  i |   n d S(   s3   Connect to the host and port specified in __init__.s!   getaddrinfo returns an empty listi    s   connect: (%s, %s)i   s   connect fail: N(   R  t   getaddrinfoR$   RJ  R  t   sockR  t   _rpdb2_timeoutt
   debuglevelRT   R  R+  R   R  R   R  R   (   R2   R0  t   rest   aft   socktypet   protot	   canonnamet   sa(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  %  s,    
 $
	
(   Rd   Re   Rf   R  R  R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  %  s   t   CLocalTimeoutHTTPConnectionc           B   s   e  Z d  Z e Z RS(   sR   
        Modification of httplib.HTTPConnection with timeout for sockets.
        (   Rd   Re   Rf   t   LOCAL_TIMEOUTR  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   %  s   t   CTimeoutHTTPc           B   s   e  Z d  Z e Z RS(   sH   
        Modification of httplib.HTTP with timeout for sockets.
        (   Rd   Re   Rf   R  t   _connection_class(    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  %  s   t   CLocalTimeoutHTTPc           B   s   e  Z d  Z e Z RS(   sH   
        Modification of httplib.HTTP with timeout for sockets.
        (   Rd   Re   Rf   R   R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  &  s   t   CTimeoutTransportc           B   s   e  Z d  Z d   Z RS(   sO   
        Modification of xmlrpclib.Transport with timeout for sockets.
        c         C   s"   |  i  |  \ } } } t |  S(   N(   t   get_host_infoR  (   R2   R$   t   extra_headerst   x509(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   make_connection&  s    (   Rd   Re   Rf   R	  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  &  s   R  c           B   s   e  Z d  Z d   Z RS(   sO   
        Modification of xmlrpclib.Transport with timeout for sockets.
        c         C   s"   |  i  |  \ } } } t |  S(   N(   R  R  (   R2   R$   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR	  &&  s    (   Rd   Re   Rf   R	  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  !&  s   c           B   s   e  Z d  Z d   Z RS(   sO   
        Modification of xmlrpclib.Transport with timeout for sockets.
        c         C   s   |  i  |  \ } } } t i | d t } | o | i d  n h  } | o% x" | D] \ }	 }
 |
 t |	 <qY Wn d | d <|  i | d <| i d | | |  | S(   NR   i   s   text/xmls   Content-Types
   User-Agentt   POST(   R  t   httplibt   HTTPConnectionR  t   set_debuglevelt   headert
   user_agentR  (   R2   R$   R  t   request_bodyt   debugR  R  t
   connectiont   headersRw   t   val(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   send_request4&  s     
(   Rd   Re   Rf   R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  /&  s   c           B   s   e  Z d  Z d   Z RS(   sO   
        Modification of xmlrpclib.Transport with timeout for sockets.
        c         C   s   |  i  |  \ } } } t i | d t } | o | i d  n h  } | o% x" | D] \ }	 }
 |
 t |	 <qY Wn d | d <|  i | d <| i d | | |  | S(   NR   i   s   text/xmls   Content-Types
   User-AgentR
  (   R  R  R  R  R  R  R  R  (   R2   R$   R  R  R  R  R  R  R  Rw   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  L&  s     
(   Rd   Re   Rf   R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  G&  s   t   CLocalTransportc           B   s1   e  Z d  Z d   Z e i d j o
 e Z n RS(   sW   
    Modification of xmlrpclib.Transport to work around Zonealarm sockets
    bug.
    c         C   s   |  i    \ } } xt | o | i d  } n t i d  | i d  } | p Pn |  i o t d t |   n | i |  q | i	   | i	   | i	   S(   Ni   gMb`?s   body: (
   R  R  RU  RV  R  t   verboseRJ   R   R  R  (   R2   Rm  R  R#  R   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __parse_responsee&  s    


R   (   Rd   Re   Rf   t    _CLocalTransport__parse_responseRC   RD   t   _parse_response(    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  _&  s   	t   CSessionc           B   sw   e  Z d  Z d   Z d   Z d   Z d   Z d d d  Z d   Z d	   Z	 d
   Z
 d   Z d   Z d   Z RS(   sA   
    Basic class that communicates with the debuggee server.
    c         C   sX   t  | | |  |  _ | |  _ | |  _ d  |  _ d  |  _ d  |  _ t |  _	 t |  _
 d  S(   N(   R  R  t   m_hostR  R   R  t   m_server_infot
   m_exc_infoR'   t   m_fShutDownt
   m_fRestart(   R2   R$   RJ  R   R   RG   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   &  s    						c         C   s   |  i  i   S(   N(   R  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   &  s    c         C   s   |  i  S(   N(   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   getServerInfo&  s    c         C   s   t  |  _ d  S(   N(   R   R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   pause&  s    i    i
   c         C   s   t  |  _ t i |  t i   } zq yW xJ t i   | | j  o2 y |  i   d  SWq+ t i j
 o
 q+ q+ Xq+ Wt  Wn t  |  _   n XWd  t	 |  _ Xd  S(   N(
   R   R   RU  RV  t   ConnectR  R+  R   R  R'   (   R2   RV  R   RZ  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRt   &  s"    	 

	c         C   s   t  |  _ d  S(   N(   R   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   shut_down&  s    c         C   s:   x |  i  o t i d  q W|  i o
 t  n |  i S(   si   
        Return the proxy object.
        With this object you can invoke methods on the server.
        g?(   R   RU  RV  R  R   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR2  &  s     


c         C   s#   t  i d |  i  } | i   | S(   NR  (   RG  R  t   ConnectNoThrowR   (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   ConnectAsync&  s    
c         C   s+   y |  i    Wn t i   |  _ n Xd  S(   N(   R#  R   R  R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR%  &  s    c         C   s   |  i  } | i   t j o
 t } n t |  i t | |  i  t    } | i	   } t |  i t | |  i  t
   d | i |  _ | |  _ d  S(   NR  (   R  Rk  R(   R  R  R  RL  R  R  t   server_infoR  RB   R  R  (   R2   R$   R  R'  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR#  &  s    	
$0c         C   s   |  i  d  j	 S(   N(   R  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   isConnected&  s    (   Rd   Re   Rf   R4   R   R!  R"  Rt   R$  R2  R&  R%  R#  R(  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  &  s   									t   CServerListc           B   s/   e  Z d    Z d d  Z d   Z d   Z RS(   c         C   s   | |  _  g  |  _ h  |  _ d  S(   N(   R  t   m_listt   m_errors(   R2   R$   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   &  s    		c         C   s  g  } g  } h  |  _  t } x` | t t j  oN t |  i | | d t d | } | i   } | i | | f  | d 7} q Wx| D]\ } } | i   | i	 d  j	 oK t | i	 d t i  p* |  i  i | i	 d g   i | i	  q q n | i   }	 |	 d  j	 o | i |	 i |	 f  n | i   g  }
 | D] } |
 | d q?~
 |  _ | d  j o# y |  i |  d SWqqXq q W| d  j o
 t  n | i   g  } | D] } | | d q~ |  _ |  i S(   NR   RG   i   i    (   R+  R  R  R  R  R   R&  RI  R   R  R   t
   issubclassR  R+  R>  R!  R  R  R*  t   findServersR   (   R2   R   RG   Rw   t   silt   sessionsRJ  R_   R  RF   Rr  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   calcList&  s@    	 ! 
*
(

(c         C   s   |  i  S(   N(   R+  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   get_errors'  s    c         C   s   yX t  |  } g  } |  i D]1 } | i | j p | i | j o | | q q ~ } Wn` t j
 oT t | t i    } g  } |  i D]! } | | i j o | | q q ~ } n X| g  j o
 t	  n | S(   N(
   R   R*  R  RB   t
   ValueErrorR   R   R  R  R   (   R2   Rw   Rx  Rr  R_   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR-  !'  s    L=
N(   Rd   Re   R4   R   R0  R1  R-  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR)  &  s   	+	R&   c           B   sG  e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 e
 d  Z d	   Z d
   Z d   Z dX e e e
 dX e
 d  Z d   Z e d  Z d   Z d   Z d   Z d   Z d   Z e d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z  e d  Z! d   Z" d   Z# d   Z$ d    Z% e d!  Z& d"   Z' d#   Z( d$   Z) d%   Z* d&   Z+ dX d'  Z, d(   Z- d)   Z. d*   Z/ d+   Z0 d, d-  Z1 d, d.  Z2 d/   Z3 d0   Z4 d1   Z5 d2   Z6 d3   Z7 d4   Z8 d5   Z9 d6   Z: d7   Z; d8   Z< d9   Z= d:   Z> d;   Z? d<   Z@ d=   ZA d>   ZB e
 d?  ZC d@   ZD dA   ZE dB   ZF dC   ZG dD   ZH dE   ZI dF   ZJ dG   ZK dH   ZL dI   ZM dJ   ZN dK   ZO e
 dL  ZP dM   ZQ dN   ZR dO   ZS dP   ZT dQ   ZU dR   ZV dS   ZW dT   ZX dU   ZY dV   ZZ dW   Z[ RS(Y   c         C   s[  | d  g | d j |  _ | |  _ | |  _ t   |  _ | |  _ t |  |  _ d  |  _	 d  |  _
 d  |  _ d  |  _ t |  _ d  |  _ d  |  _ d |  _ d |  _ h  |  _ d |  _ t   |  _ t |  i  |  _ t t |  i |  i  |  _ t |   |  _ h  h  t t g t <t  <} |  i! |  i" | d t h  h  t# <} |  i! |  i$ | d t h  h  t% <} |  i! |  i& | d t h  h  t' <} |  i! |  i( | d t h  h  t) <} |  i! |  i* | d t h  h  t+ <} |  i! |  i, | d t h  h  t- <} |  i! |  i. | d t h  h  t/ <} |  i! |  i0 | d t h  h  t1 <} |  i i! |  i2 | d t |  i i3 |  h  h  t4 <} |  i i! |  i5 | d t |  i i3 |  h  h  t6 <} |  i i! |  i7 | d t |  i i3 |  |  i8 |  _9 d  |  _: d  |  _; t< |  _= t< |  _> t |  _? t |  _@ g  |  _A tB |  _C t |  _D d  S(   NR   i    R%   (   NR   (E   R   R  R  R  RU  RB   R  R)  t   m_server_list_objectt	   m_sessionR  t   m_worker_threadt   m_worker_thread_identR'   t   m_fStopR  R  R~  t   m_frame_index_exceptiont   m_completionst   m_remote_event_indexR  R.  R  R  t   STATE_DETACHEDR  R)  t   m_breakpoints_proxyRS   t   STATE_ANALYZER  R.   R,   t   reset_frame_indexesR  t   set_stack_depthRr  t   _reset_frame_indexesR0   t   on_event_exitRb  t   on_event_conflicting_modulesRX  t   on_event_signal_interceptR[  t   on_event_signal_exceptionRV  t   on_event_embedded_syncRj  t   on_event_synchronicityR  Rl  t   on_event_trapRn  t   on_event_fork_modet%   _CSessionManagerInternal__nul_printert	   m_printert   m_last_command_linet   m_last_fchdirR   Rk  Rm  Ro  Rp  t   m_environmentR[  R_  R`  (   R2   R   R   R   R$   R3   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   2'  sp    																						c         C   s+   |  i  i   |  i i   |  i i   d  S(   N(   R.  R5   R  R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR5   '  s    c         C   s   d  S(   N(    (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __nul_printer'  s    c         C   s   | |  _  d  S(   N(   RJ  (   R2   Rl   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRk   '  s    c         C   s   |  i  i | | |  S(   N(   R  R,   (   R2   Rq   R3   R%   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR,   '  s    c         C   s   |  i  i |  S(   N(   R  Rr   (   R2   Rq   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRr   '  s    c         C   s   z t  i t d  x t t  D] } y6 t d  t  i    } |  i i |  i |  i	 |  SWq! t
 j
 o< t  i    | } | t j  o t  i t |  q! q! q! Xq! W|  i i |  i |  i	 |  SWd  |  i i   } |  i | d t Xd  S(   Ni   s   Scanning for debuggee...t   fsupress_pwd_warning(   RU  RV  t   STARTUP_TIMEOUTR  t   STARTUP_RETRIESRT   R3  R0  R  RB   R   R1  t.   _CSessionManagerInternal__report_server_errorsR   (   R2   RG   Rc  RZ  RQ  t   errors(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __wait_for_debuggee'  s      
  c         C   s   |  i    i   S(   N(   R1  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   '  s    c         C   s  t  |  p t  |  i   t i t d g j o |  i t  t  n t	 o- t
 |  i    } | i   p
 t  q n t d  |  i d  j o |  i   n | d j o
 t  n t |  \ } } } t | |  } t |  }	 |  i t  |  i t  t   }
 t |
 |  i  |  i i t  z yo |  i | |	 | |
  |  i |
  } |  i  | i! | i" d t# d t# d t$ d | d | | |  _% | |  _& Wn4 |  i i'   t( j o |  i i t(  n   n XWd  t) |
  Xd  S(	   NR   s   Skipping firewall test.R   RO  t   fsetenvt   ffirewall_testR  R:   (*   R   Ri   t+   _CSessionManagerInternal__verify_unattachedRC   RD   Rc  RJ  t   STR_SPAWN_UNSUPPORTEDR   t   g_fFirewallTestR  R   R  R   RT   R  R   t   set_random_passwordR   R  R  R  R   R(   t   STR_STARTUP_SPAWN_NOTICERU  RE   R  R  t   STATE_SPAWNINGt   _spawn_servert+   _CSessionManagerInternal__wait_for_debuggeeRv   RB   R  R   R'   RK  RL  R   R;  R  (   R2   R7   R8   R:   t   firewall_testRZ   Rb   R   R   t   ExpandedFilenameRG   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR6   '  sD    



	4	c         C   s_   d |  i |  i f j o d Sn |  i i   t j o |  i   n |  i |  i |  i  d S(   s{   
        Restart debug session with same command_line and fchdir arguments
        which were used in last launch.
        N(   R   RL  RK  R  R   R;  R=   R6   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRt   '  s
    c         C   s1   d |  i |  i f j o d Sn |  i |  i f S(   s   
        Return command_line and fchdir arguments which were used in last 
        launch as (last_fchdir, last_command_line).
        Returns None if there is no info.
        N(   NN(   R   RL  RK  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRu   (  s    c         C   s  t  o
 t } nD t i t j o
 t } n* y d d k } t } Wn t i } n X| d j o t	 o
 t
 } n d d g |  i } d d g |  i } d d g | }	 d d |  i g t i d j }
 d } t   } t i   } t i | |  } t | |  } t d	  t | | d
 t j oY t |  } t i |  } | i t d   i t  } t | d
 t } d | } n t i i t  } | d d j o | d  } n t | |  } d d g t	 } d | | |
 | | |	 | | | | f
 } t i } | i  d  o | d  d } n t | |  } t d	  t | | | d
 t j o
 t!  n | t" j o t#   } t$   } | t% j o- t% | h  | d <| d <| d <} qt% | h  | d <| d <| d <| d <} n! t% | h  | d <| d <} | t j o& d t i&   | f } t' |  } n t( d t) |   t | |  } | t j o | i* |  n t i+ |  d S(   s   
        Start an OS console to act as server.
        What it does is to start rpdb again in a new console in server only mode.
        iNR   R   s
    --encrypts	    --remotes    --chdirs    --pwd="%s"R  R   s   
s    --base64=%sRs  s    --debugs+   "%s"%s --debugee%s%s%s%s%s --rid=%s "%s" %ss   w.exeis   .exet   shellR  t   optionsR/  s   cd "%s" ; %ss   Terminal open string: %s(,   t	   g_fScreent   SCREENR   Rt  t   DARWINt   terminalcommandt   MACRC   RD   R  t   NT_DEBUGR  R  R  Rh  R  R  RX   R   R   R'   R'  R(  R  t	   translatet   g_safe_base64_toR   R   RZ   R  R  t
   executableR  R   Rc  R  R0  t   osSpawnR  R2  RT   R   R  Ru  (   R2   R7   R`  R   RG   RD   Rf  R`   R  Rs  R#  R   R9   R  t   _ut   _bR  t   debug_printsRb  t   python_execRa  t   terminal_commandR1  R_   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR]  (  sj    



 	"(	&
		-6 c         C   su  t  |  p t  |  i   | d j o
 t  n |  i d  j o
 t  n t o4 | o- t |  i	    } | i
   p
 t  q n t o | o t d  n | d  j o
 | } n | }	 |  i t  |  i i t  y2| g }
 | d  j o9 |  i i |  i |  i  |  i i |  }
 |
 d } n | i }	 |  i i   } | | i t | i  g j o |  i | |  n |  i | |  t |
  d j o |  i t |  n |  i t d t d g |  i     |  i t! | i  y | o |  i"   n Wn n XWn[ t# i$ t% f j
 o+ |  i t& |	  |  i i t'    n t(   t) p t  n Xd  S(   NR   s   Skipping firewall test.i    i   R  (*   R   Ri   RW  R   R  R   R   RY  R  R   R  R   RT   RJ  t   STR_STARTUP_NOTICER  R  t   STATE_ATTACHINGR3  R0  RB   R-  R  R1  R   R  RR  t    _CSessionManagerInternal__attachRW   t   STR_MULTIPLE_DEBUGGEESt   STR_ATTACH_CRYPTO_MODEt   STR_ATTACH_CRYPTO_MODE_NOTR   t   STR_ATTACH_SUCCEEDEDR   R  R+  R   t   STR_ATTACH_FAILED_NAMER;  R  R'   (   R2   Rw   RD   RO  RU  RV  R  R:   R_  t   _namet   serversRS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRv   c(  sX    



		%c         C   s   t  i | t  } | t j o1 t i t j o! t o t o | d t	 7} n | t
 j o1 t i t j o! t o t o | d t 7} n | h  | d <| d <| d <} |  i |  | t  j o t | | | t  n d  S(   NR  Rn   Ro   R  (   t   g_error_mappingRX   t   STR_ERROR_OTHERR   RC   RD   Rc  Rc  t   g_fDefaultStdt#   STR_SPAWN_UNSUPPORTED_SCREEN_SUFFIXR   t   STR_DISPLAY_ERRORRJ  R  R   (   R2   t   _typeRo   Rp   R0  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRm   (  s    ,,%c         C   s   x | i    D] \ } } | o | t t t g j o q n | t g j o4 x* | D]" \ } } } |  i | | d   qT Wq n | d \ } } } |  i | | |  q Wd  S(   Ni    (   R  R   R   R   Rm   R   (   R2   RS  RO  R  t   elR  R  Rp   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __report_server_errors(  s      c         C   s\  |  i    t |  i | i |  i |  i |  i  } | i   | i   i	 | i	 j p | i   i
 | i
 j o
 t  n | |  _ |  i   |  _ |  i   i   i |  i  |  i   i   i |  i  |  i   i   i |  i |  i  | o6 t |  i  d j o  |  i   i   i |  i  n |  i   |  i t  |  i   t d | i  d  S(   Ni    s    Attached to debuggee on port %d.(    RW  R  R  R  R  R  RB   R#  R!  R  R  R   R4  RA   R  R1  R2  R   Rk  R   Rm  R   Ro  Rp  RW   RM  R   Rx   Rs   R   t-   _CSessionManagerInternal__start_event_monitorRT   (   R2   R  RU  t   session(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __attach(  s     
'
2
	" 

c         C   s   |  i    o
 t  n d  S(   N(   t%   _CSessionManagerInternal__is_attachedR   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __verify_unattached(  s    c         C   s   |  i    p
 t  n d  S(   N(   R  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __verify_attached(  s    c         C   s#   |  i  i   t j o |  i d  j	 S(   N(   R  R   R;  R4  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __is_attached(  s    c         C   s*   |  i  i   t t g j o
 t  n d  S(   N(   R  R   RS   R=  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __verify_broken(  s    c         C   sG   |  i  i   t j } |  i   i   i | |  |  _ |  i i   d  S(   N(	   R  R   R=  R1  R2  R  R:  R<  R5  (   R2   R  t   fAnalyzeMode(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRs   (  s    !c         C   s2   t  |  _ t i d |  i  |  _ |  i i   d  S(   NR  (   R'   R7  RG  R  t,   _CSessionManagerInternal__event_monitor_procR5  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __start_event_monitor(  s    	c   	      C   s  t  i   |  _ d } d } xz|  i poyt | t  } |  i o d  Sn |  i   i   i t	 |  i
  \ } } t g  } | D] } | t | t  q ~ j o7 t d  |  i   i   t i d |  i  i   n t g  } | D] } | t | t  q ~ j o@ t d  |  i   i   t i d |  i d t f  i   n t g  } | D] } | t | t  qZ~ j o |  i   i   t |  _ n | |  i
 j o | |  _
 |  i i |  n d } Wq t j
 oE |  i p0 |  i t i     t i d |  i  i   n d  Sq t i j
 oc | t  j  o | d 7} q n |  i p0 |  i t i     t i d |  i  i   n d  Sq Xq Wd  S(   Ni    s   Received fork switch event.R  s   Received exec switch event.R   i   (!   RR  RS  R6  R7  RR  t   IDLE_MAX_RATER1  R2  R  R  R:  R   R  Rh  RT   R"  RG  R  t   restart_session_jobR   Ri  R0   R$  R.  R  R   Rm   R   R  t
   detach_jobR  R+  t   COMMUNICATION_RETRIES(	   R2   R  t	   nfailuresRx  R  Rr  R`   R  R$  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __event_monitor_proc(  sL     

'1
1
&1	



c         C   s'   d i  | i  } |  i t |  d  S(   Ns   , (   R   Rc  RJ  t   STR_CONFLICTING_MODULES(   R2   RM   R_   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRB  5)  s    c         C   sA   |  i  i   t t g j o! |  i t | i | i f  n d  S(   N(   R  R   R=  RS   RJ  t   STR_SIGNAL_INTERCEPTRZ  RY  (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRC  :)  s    c         C   s'   |  i  t | i | i | i f  d  S(   N(   RJ  t   STR_SIGNAL_EXCEPTIONR\  RZ  RY  (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRD  ?)  s    c         C   s'   t  i d  |  i   i   i   d  S(   NgMbP?(   RU  RV  R1  R2  R  (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRE  C)  s    c         C   s*   |  i  t  t i d |  i  i   d  S(   NR  (   RJ  t   STR_DEBUGGEE_TERMINATEDRG  R  R  R   (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRA  K)  s    c         C   st   y |  i    i d d  d  SWn n Xt |  _ | o! t   } |  i i |  d  Sn |  i t  |  i	   d  S(   NRV  i   (
   R1  Rt   R   R7  R0   R.  R  RJ  t   STR_LOST_CONNECTIONR  (   R2   t   fSendExitOnFailureR`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  P)  s    		c         C   s   y |  i    Wn n Xd  S(   N(   R<   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  c)  s    c         C   s   |  i    y |  i   Wn t   n X|  i t  |  i i t  |  i   zG y- |  i	   i
   i t  |  i d t  Wn t j
 o n XWd  |  i i t  d  |  _ |  i t  Xd  S(   NR  (   t)   _CSessionManagerInternal__verify_attachedR   R  RJ  t   STR_ATTEMPTING_TO_DETACHR  R  t   STATE_DETACHINGt,   _CSessionManagerInternal__stop_event_monitorR1  R2  R   R'   R;   R   R   R;  R   R4  t   STR_DETACH_SUCCEEDED(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR<   j)  s$    

		c         C   s~   t  |  _ |  i d  j	 oa t i   |  i j o5 y |  i   i   i	   Wn n X|  i i
   n d  |  _ d  |  _ n d  S(   N(   R   R7  R5  R   RR  RS  R6  R1  R2  R  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __stop_event_monitor)  s    		c         C   s   |  i    i   i   d  S(   N(   R1  R2  Rx   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRx   )  s    c         C   s   |  i    i   i |  d  S(   N(   R1  R2  R;   (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR;   )  s    c         C   sJ   |  i    } |  i i   t j } |  i   i   i | | | | |  d  S(   N(   R   R  R   R=  R1  R2  Ry   (   R2   Rb   Rz   R{   R   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRy   )  s    c         C   s   |  i    i   i   d  S(   N(   R1  R2  R|   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR|   )  s    c         C   s   |  i    i   i   d  S(   N(   R1  R2  R}   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR}   )  s    c         C   s   |  i    i   i   d  S(   N(   R1  R2  R~   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR~   )  s    c         C   s   |  i    i   i |  d  S(   N(   R1  R2  R   (   R2   R{   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   )  s    c   	   	   C   sm   |  i    } |  i i   t j } | d  j o |  i } n |  i   i   i | | | | | | | |  d  S(   N(	   R   R  R   R=  R   R_  R1  R2  R   (	   R2   Rb   Rz   R{   R   R   R9   R   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   )  s
    c         C   s    |  i    i   i | |  d  S(   N(   R1  R2  R   (   R2   R   RQ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   )  s    c         C   s    |  i    i   i | |  d  S(   N(   R1  R2  R   (   R2   R   RQ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   )  s    c         C   s    |  i    i   i | |  d  S(   N(   R1  R2  R   (   R2   R   RQ   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   )  s    c         C   s   |  i    |  i i   } | S(   N(   R  R<  R   (   R2   Rk  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   )  s    
R   c      	   C   s   |  i    |  i   i   i } | d  d j o d  Sn t | |  } t | d  } zG y, |  i   } t i |  } | i	 |  Wn t
   t  n XWd  | i   Xd  S(   Ni   R  t   wb(   R  R1  R!  R  R  R  R   RA  RB  R   R  R   R  (   R2   Rb   R  RZ   Rm  Rk  t   sbpl(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   )  s    
c         C   s  |  i    |  i   i   i } | d  d j o d  Sn t | |  } t | d  } t } zty# t i |  } |  i	 g  t
  Wn t   t  n X| d j o# t | i    d j o
 t  n x | i   D] } y | i d  j o t | i  | _ n | i d  j o t | i  | _ n | i d  j o t | i  | _ n | i d j o t d  | _ n |  i | i | i | i | i | i | i  Wq t   t
 } q Xq W| o
 t  n Wd  | i   Xd  S(   Ni   R  t   rbR   i    s   utf-8(   NR   (   R  R1  R!  R  R  R  R'   RA  t   loadR   R   R  R   RW   R3  R  R  R   R   R  R  R_  R   R  R  R  (   R2   Rb   R  RZ   Rm  t   ferrorRk  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   )  sD    

&
 2c         C   sL   |  i  | i  j } | i  |  _  | o# t | i   } |  i i |  n d  S(   N(   Rk  Rj  R  R  (   R2   RM   t   ffire(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRF  !*  s
    c         C   sm   | |  _  |  i   o7 y |  i   i   i |  WqM t j
 o qM Xn t |  } |  i i |  d  S(   N(	   Rk  R  R1  R2  R   R   Rj  R  R  (   R2   R   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   **  s    		c         C   s   |  i  S(   N(   Rk  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   7*  s    c         C   sL   |  i  | i  j } | i  |  _  | o# t | i   } |  i i |  n d  S(   N(   Rm  Rl  R  R  (   R2   RM   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRG  ;*  s
    c         C   sp   | |  _  |  i   o: y  |  i   i   i |  i   WqP t j
 o qP Xn t |  } |  i i |  d  S(   N(	   Rm  R  R1  R2  R   R   Rl  R  R  (   R2   R   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   D*  s    	 	c         C   s   |  i  S(   N(   Rm  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   Q*  s    c         C   s    |  i    |  i   i   i   S(   N(   R  R1  R2  RU   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRU   U*  s    
c         C   sp   |  i  |  i f | i  | i f j } | i  |  _  | i |  _ | o) t |  i  |  i  } |  i i |  n d  S(   N(   Ro  Rp  Rn  R  R  (   R2   RM   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRH  [*  s    c         C   s   | |  _  | |  _ |  i   o@ y& |  i   i   i |  i  |  i  Wq_ t j
 o q_ Xn t | |  } |  i i	 |  d  S(   N(
   Ro  Rp  R  R1  R2  R   R   Rn  R  R  (   R2   R   R   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   g*  s    			c         C   s   |  i  |  i f S(   N(   Ro  Rp  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   y*  s    c         C   s:   |  i  i   t j } |  i   i   i | | |  } | S(   N(   R  R   R=  R1  R2  RV   (   R2   RP   RQ   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRV   }*  s    !c         C   s`   t  |  p t  |  i   } |  i i   t j } |  i   i   i | | | | |  } | S(   N(	   R   Ri   R   R  R   R=  R1  R2  R   (   R2   Rb   R{   R   R   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   *  s
    'c         C   sI   |  i    } |  i i   t j } |  i   i   i | | | |  } | S(   N(   R   R  R   R=  R1  R2  R   (   R2   R   RQ   R   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   *  s    $c         C   s(   |  i    i   i   \ } } | | f S(   N(   R1  R2  R   (   R2   Rq  Rw  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   *  s    c         C   s*   |  i  d   |  i   i   i |  d  S(   N(   R>  R   R1  R2  R   (   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   *  s    c         C   sX   |  i    } |  i i   t j } |  i   i   i | | | | | |  i |  i  } | S(   N(	   R   R  R   R=  R1  R2  R   R_  R`  (   R2   R   R   R   R   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   *  s    3c         C   s   t  |  p t  |  i   |  i   |  i   } |  i i   t j } |  i   i	   i
 | | | |  i |  i  \ } } } | o |  i i   n | | | f S(   N(   R   Ri   R  t'   _CSessionManagerInternal__verify_brokenR   R  R   R=  R1  R2  R   R_  R`  R9  R6  (   R2   R   t   fclear_completionsR   R  Ro   t   warningR+  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   *  s    

6c         C   s   t  |  p t  |  i   |  i   |  i   } |  i i   t j } |  i   i	   i
 | | | |  i  \ } } |  i i   | | f S(   N(   R   Ri   R  R  R   R  R   R=  R1  R2  R   R_  R9  R6  (   R2   R   R   R  R  R+  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   *  s    

-c         C   sw   |  i  |  i f | | f j o d  Sn | |  _  | |  _ t | |  } |  i i |  |  i   o |  i   n d  S(   N(   R_  R`  R^  R  R  R  Rs   (   R2   R9   R   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   *  s    		c         C   s   |  i  |  i f S(   N(   R_  R`  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   *  s    c         C   s   |  i    y1 t |  p | i d  } n | i d  Wn t  n Xt | d  } y t i | d d t i  Wn= t i	 j
 o. | i
   t j o   n |  i t  Sn X| |  _ t |  |  _ d  S(   NRg  i    (   RW  R   R   R   R   R   R  R  R  t   gaierrorRk  R(   R   R  R  R)  R3  (   R2   R$   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   *  s     

	c         C   s   t  |  i  S(   N(   R   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   *  s    c         C   s   |  i  d  j o
 t  n t o- t |  i    } | i   p
 t  qX n t d  |  i	 i
 |  i  |  i  } |  i	 i   } |  i |  | | f S(   Ns   Skipping firewall test.(   R  R   R   RY  R  R   R  R   RT   R3  R0  RB   R1  RR  (   R2   R_  t   server_listRS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   *  s    

c         C   s   |  i    i   S(   N(   R1  R!  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRA   +  s    c         C   s  t  i d | t  i t  i B } | d  j o
 t  n | i   } | d | d | d } } } | d  j o
 t  n | d  j o t d  } n t d |  } | |  i j o |  i	 | d t
 \ } }	 }
 |	 d j p |
 d j o  t d	 |	 |
  | g  f Sn t t t |    } d
 | j o | i d
  n | |  i | <n g  } |  i | D]! } | i |  o | | qgqg~ } | i   | d j o
 | } n | t |   } | | f S(   NsT   (?P<unsupported> \.)? (?P<match> ((?P<scope> (\w+\.)* \w+) \.)? (?P<complete>\w*) $)t   unsupportedRz   R   sM   list(globals().keys()) + list(locals().keys()) + list(_RPDB2_builtins.keys())s   dir(%s)R  R   s3   evaluate() returned the following warning/error: %sR<  (   t   ret   searcht   Ut   XR   R   t	   groupdictR   R9  R   R'   RT   R  RA  R  Rq  Rl  R  RW   (   R2   R   t   matchR  R  Rz   R   t   _scopeR  R  R`   t   clRr  t   attrt   completionst   prefix(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   +  s8    
 
<

c         C   s   |  i  d   d  S(   N(   R>  R   (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR@  ?+  s    c         C   s   z |  i  i   | d  j o |  i   n% |  i  i   t t g j o d  Sn d  |  _ d  |  _ d |  _	 d |  _
 |  i i   Wd  |  i  i   Xd  S(   Ni    (   R  RJ  R   R  R   RS   R=  R  R  R~  R8  R9  R6  RL  (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR>  C+  s    				c         C   s   zk |  i  i   |  i   | i |  _ | i |  _ t |  i |  i d  |  _ t |  i |  i d  |  _ Wd  |  i  i   Xd  S(   Ni   (	   R  RJ  R  R  R  R  R~  R8  RL  (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR?  V+  s    
 c         C   s   z |  i  i   |  i   | d j  p |  i d  j o |  i d t  Sn |  i  i   t j o& t	 | |  i
 d  |  _ |  i } n# t	 | |  i d  |  _ |  i } Wd  |  i  i   Xt |  } |  i i |  t   } |  i i |  | S(   Ni    R  i   (   R  RJ  R  R  R   R   R'   R   R=  R  R  R8  R~  RL  R}  R  R  Rq  (   R2   R   RF   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   d+  s     
	c         C   sn   zN | o |  i  i   n |  i   |  i  i   t j o |  i Sn |  i SWd  | o |  i  i   n Xd  S(   N(   R  RJ  R  R   R=  R8  R~  RL  (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   +  s    
c         C   s   z |  i  i   | o  |  i  i   t j o
 t  n | o |  i  i   t j o d  Sn t t g | } |  i  i | d t Wd  |  i  i   |  i	   Xd  S(   NR  (
   R  RJ  R   RS   R   R=  R  R'   RL  Rs   (   R2   R   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   +  s    
c         C   s   |  i    |  i S(   N(   R  R4  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR1  +  s    
c         C   s   t  |  i i    S(   N(   R   R  R   (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   +  s    c         C   sd   t  |  p t  t |  p
 t  n z$ |  i i   |  i   | |  _ Wd  |  i i   Xd  S(   N(	   R   Ri   Rh   R   R  RJ  RW  R  RL  (   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   +  s    

c         C   sI   z4 |  i  i   |  i   t   |  _ |  i t  Wd  |  i  i   Xd  S(   N(   R  RJ  RW  R[  R  RJ  t   STR_RANDOM_PASSWORDRL  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRZ  +  s    
c         C   s   |  i  S(   N(   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR@   +  s    c         C   s9   z$ |  i  i   |  i   | |  _ Wd  |  i  i   Xd  S(   N(   R  RJ  RW  R  RL  (   R2   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   +  s
    
c         C   s   |  i  S(   N(   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   +  s    c         C   sr   g  |  _  yU xN | D]F \ } } t | d t } t | d t } |  i  i | | f  q WWn t  n Xd  S(   NR   (   RM  R   R   RI  R   (   R2   R   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   +  s    	 c         C   s   |  i  S(   N(   RM  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   +  s    c      	   C   s   |  i    y |  i   Wn t   n X|  i t  |  i t  |  i i t  |  i	   z |  i
   i   i   Wd  |  i i t  d  |  _ |  i t  Xd  S(   N(   R  R   R  RJ  t   STR_ATTEMPTING_TO_STOPR  R  R  R  R  R1  R2  R=   R;  R   R4  R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR=   +  s    

	N(\   Rd   Re   R4   R5   RI  Rk   R,   Rr   R^  R   R   R6   Rt   Ru   R]  R   R'   Rv   Rm   RR  Rt  RW  R  R  R  Rs   R  R  RB  RC  RD  RE  RA  R  R  R<   R  Rx   R;   Ry   R|   R}   R~   R   R   R   R   R   R   R   R   RF  R   R   RG  R   R   RU   RH  R   R   RV   R   R   R   R   R   R   R   R   R   R   R   R   RA   R   R@  R>  R?  R   R   R   R1  R   R   RZ  R@   R   R   R   R   R=   (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR&   1'  s   	S							;			T>								7														
				5														
												-														R   c           B   sX  e  Z dd dd e d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 dd dd dd d  Z dd dd dd d  Z e Z e Z e Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z e Z  e! d  Z" d   Z# e# Z$ d   Z% e% Z& d   Z' e' Z( d   Z) e) Z* d   Z+ e+ Z, d   Z- d    Z. d!   Z/ d"   Z0 d#   Z1 d$   Z2 d%   Z3 d&   Z4 e4 Z5 d'   Z6 e6 Z7 d(   Z8 d)   Z9 d*   Z: d+   Z; e; Z< d,   Z= d-   Z> e> Z? d.   Z@ d/   ZA eA ZB d0   ZC eC ZD d1   ZE d2   ZF d3   ZG d4   ZH d5   ZI d6   ZJ d7   ZK d8   ZL eL ZM d9   ZN d:   ZO d;   ZP d<   ZQ d=   ZR d>   ZS d?   ZT d@   ZU dA   ZV eV ZW dB   ZX dC   ZY dD   ZZ dE   Z[ dF   Z\ dG   Z] dH   Z^ dI   Z_ dJ   Z` dK   Za dL   Zb eb Zc dM   Zd dN   Ze dO   Zf dP   Zg dQ   Zh dR   Zi dS   Zj dT   Zk ek Zl dU   Zm em Zn dV   Zo dW   Zp ep Zq dX   Zr er Zs dY   Zt et Zu dZ   Zv ev Zw d[   Zx ex Zy d\   Zz ez Z{ d]   Z| e| Z} d^   Z~ d_   Z d`   Z e Z da   Z e Z db   Z dc   Z RS(e   c         C   s>  t  i i |  d | d | t i i |   t |  _ t |  _ t	 d  |  _
 d  |  _ d d g | |  _ | |  _ t t g |  i d g | |  _ t |  _ | o |  i d 7_ n | |  _ |  i i |  i  h  h  t <} |  i i |  i | d t h  h  t <} |  i i |  i | d t h  h  t <} |  i i |  i | d t h  h  t <} |  i i |  i | d t d  |  _  t! |  _" t |  _# t i$   |  _% |  i& i' d d  |  i( |  _) t* |  i+  |  _, | d  j a- |  i oL y> d d  k. } | i/   } d	 | j o | i0 | d	  n Wq:q:Xn d  S(
   NR   R   R   i   i    s   
R%   iR    (1   t   cmdt   CmdR4   RG  R  R'   R  R   t   fPrintBrokenR   R  R   t   m_completion_threadt   use_rawinputt   m_fSplitt   CONSOLE_PROMPTt   CONSOLE_PROMPT_ANALYZEt   promptt   CONSOLE_INTROt   introR*  Rk   Rl   R.   R,   R  Rj  t   synchronicity_handlerRl  t   trap_handlerRn  t   fork_mode_handlert   m_last_source_linet   DEFAULT_NUMBER_OF_LINESt   m_last_nlinest   m_fAddPromptBeforeMsgRH  t	   m_eInLoopt   cmdqueueR  R   t   m_stdoutR   R   R_  R~  R   t   get_completer_delimst   set_completer_delims(   R2   R   R   R   R   R3   R   t   cd(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR4   ,  sL    				 					
c         C   s!   t  |  p t  | |  _ d  S(   N(   R   Ri   R  (   R2   Rb   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   F,  s    c         C   s   t  | |  i  } t |  _ |  i i   p |  i i   t i d  n | i	   p | Sn | i
 d d  d i
 t d  d i
 t d  d } | d j o d  |  _ t |  _ n | S(   Ng{Gz?R  i   i    R  R  (   s   listR  (   R   R_  R   R  R  t   isSetRA  RU  RV  R  Rr  t   SOURCE_MOREt   SOURCE_LESSR   R  R  R  (   R2   R  R1  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   precmdL,  s    	6	c         C   s   t  |  _ | S(   N(   R'   R  (   R2   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   postcmd_,  s    	c         C   s   y t  i i |  |  SWn t i t f j
 o |  i i t i	     nP t
 j
 o |  i i t i	     n( |  i i t i	     t t  n Xt S(   sQ   
        Default Error handling and reporting of session manager errors.
        (   R  R  t   onecmdR  R+  R   R*  Rm   R   R  R   R  R   R'   (   R2   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  e,  s    c         C   s   d  S(   N(    (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   emptylinex,  s    c         C   s$  |  i  o& d d k } | i i |  | |  Sn y | d j o |  i | Sn d | j o! |  i |  |  _ |  i | Sn |  i |  \ } } } | d j p t |  d |  o! |  i |  |  _ |  i | Sn t	 |  d |  } | |  |  _ |  i | SWn t
 j
 o d Sn Xd S(   s   
        Return the next possible completion for 'text'.
        If a command has not been entered, then complete against command list.
        Otherwise try to call complete_<command> to get list of completions.
        iNi    R  R   t	   complete_(   R  R  R  R   t   completion_matchest   completenamest	   parselineR  t   completedefaultR  R  R   (   R2   R   R   R  R   RB  t   compfunc(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   |,  s$    
"c         C   s  | d  j o | d  j o | |  } n | i d  o d	 \ } } n) | i   d } t i i |  \ } } | } | d j o | t |   } n | d j on | i d  o^ | t i i |  j o
 | }	 n t i i | d  }	 | d  j o |	 | }	 n |	 g Sn | g }
 | d j o! |
 t i	 d i t i
  7}
 n g  } x|
 D]} | d j o
 d } n y t i i |  } t i |  } x | D] } | i |  p qn t i i |  \ } } | d
 j o qn t i i t i i | |   o | t i i | d  }	 n | | }	 | d  j o |	 | }	 n | i |	  qWWqWqWXqWWt |  } t |  } | i   | S(   NR  R   iRa  R  R    s   .pys   .pyw(   R   R   (   s   .pys   .pywR   (   R   R  Rr  RC   RZ   RW   Rl  R  R   R  R  Rm  R  t   isdirRI  RA  R  R  (   R2   R   R  t   begidxt   endidxt   dnt   bnRZ   R  Rs  t   plt   flR#  t   epR  RP  R  R  t   fsR  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   complete_launch,  s\    
	! 
 "

c         C   s  |  i  } | d  j o | i   o g  Sn d  |  _  d g  f g } | d  j o | d  j o | |  } n t i d |  i d | | f  } | i   | i t  | i   o | |  _  g  Sn | d \ } } | d  j o | | } n g  }	 | D] }
 |	 | |
 q ~	 } | S(   NR   R  R   i(	   R  R   R  RG  R  t   complete_expression_jobR   R   R  (   R2   R   R  R  R  R  Rd  R  R  Rr  Rs  t   ce(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   complete_eval,  s$    		!
	%c         C   sD   y/ |  i  i |  \ } } | i | | f  Wn t   n Xd  S(   N(   R*  R   RI  R  (   R2   R   Rd  R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  -  s
    c         C   s   |  i    d  S(   N(   t   cmdloop(   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  -  s    c         C   s   t  |  | j o d | j o | d f Sn | |  } | i d  } | d j o | i d  } n | d j o | | | f Sn | |  | | d f S(   Ns   
R   iR  i   (   RW   Rv  R  (   R2   R  t   max_lenR_   Rc  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __get_str_wrap-  s     
c         C   s   |  i  i   p |  i  i   n |  i } d |  i i d  g | t } d |  i i d  d g | } | } x\ | d j oN |  i | t t	 | |   \ } } t
 | | | |  i d t | } qs W|  i i   d  S(   NR   s   
Re  (   R  R  RY  R  R  R  t   CONSOLE_PRINTERt   _CConsoleInternal__get_str_wrapt   CONSOLE_WRAP_INDEXRW   RJ   R  R'   t   flush(   R2   R  t   fAPBMR  Ry  R_   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRl   #-  s    	   &c         C   s   | i  d  } d } x | D] } t | |  i  | d 7} | t d j oO t d t |  i d t |  i i   } | d j o Pn t d |  i  q q Wd  S(   Ns   
i    i   Re  R   (   Rr  RJ   R  t   PRINT_NOTICE_LINES_PER_SECTIONt   PRINT_NOTICE_PROMPTR'   R   R   (   R2   t   noticeR   Rc  R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   print_notice4-  s     
c         C   s   | i  } | t j o( |  i o t |  _ |  i t  d  Sn | t j oB |  i o8 t |  _ t d g |  i	 |  _
 |  i t t  d  Sn | t j oC |  i o8 t |  _ t d g |  i	 |  _
 |  i t t  d  Sn d  S(   NR   (   RR   RS   R  R'   Rl   t   STR_DEBUGGER_HAS_BROKENR=  R  R  R  R  t   STR_ANALYZE_MODE_TOGGLEt   MODE_OFFR   R  t   MODE_ON(   R2   RM   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  D-  s    				c         C   s   |  i  t t | i   d  S(   N(   Rl   t   STR_SYNCHRONICITY_MODER   Rk  (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  X-  s    c         C   s   |  i  t t | i   d  S(   N(   Rl   t   STR_TRAP_MODE_SETR   Rm  (   R2   RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  \-  s    c         C   sA   t  t g | i } t t g | i } |  i t | | f  d  S(   N(   t   FORK_PARENTt
   FORK_CHILDRo  t   FORK_MANUALt	   FORK_AUTORp  Rl   t   STR_FORK_MODE_SET(   R2   RM   R}  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  `-  s    c         C   s   | d j o |  i  t  d  Sn | d  d j o t } | d i   } n t } | } t |  _ y |  i i | |  d  SWnU t j
 o |  i  t  n7 t	 j
 o |  i  t
 |  n t |  _   n Xt |  _ d  S(   NR   i   s   -k(   Rl   t   STR_BAD_ARGUMENTR'   R  R   R  R*  R6   R   R  t   STR_FILE_NOT_FOUND(   R2   RS  R7   t   _arg(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   do_launchg-  s(    		c         C   s   | d j o |  i  t  d  Sn y |  i i   d  SWnU t j
 o |  i  t  n7 t j
 o |  i  t |  n t |  _   n Xt |  _ d  S(   NR   (	   Rl   R  R*  Rt   R   R  R  R'   R  (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   do_restart-  s    	c         C   s   | d j o |  i  |  Sn t |  _ y |  i i |  d  SWn2 t j
 o |  i t  n t |  _   n Xt |  _ d  S(   NR   (	   t   _CConsoleInternal__scriptsR   R  R*  Rv   R   Rl   R  R'   (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   do_attach-  s    		c      	   C   s&  |  i  i   d  j o t t |  i  d  Sn |  i  i   } t t | |  i  |  i  i   \ } } | g  j o t t	 | |  i  d  Sn y |  i  i
   i } Wn t j
 o d  } n Xt t | |  i  xJ | D]B } d t g | | i j } t d | | i | i f |  i  q Wd  S(   NR   s    %1s %-5d  %s(   R*  R@   R   RJ   t   STR_PASSWORD_MUST_BE_SETR  R   t   STR_SCRIPTS_CONNECTINGR   t   STR_SCRIPTS_NO_SCRIPTSRA   R  R   t   STR_SCRIPTS_TO_DEBUGt   SYMBOL_MARKERR  (   R2   RS  R$   R  RS  t   spidR_   R	  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   __scripts-  s$     c         C   s3   | d j p |  i  t  d  Sn |  i i   d  S(   NR   (   Rl   R  R*  R<   (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   do_detach-  s    c         C   s   | d j o' |  i  i   } t | |  i  d  Sn y |  i  i |  Wn= t i j
 o. t i   d } |  i	 t
 | | f  n Xd  S(   NR   i   (   R*  R   RJ   R  R   R  R  R   R  Rl   t   MSG_ERROR_HOST_TEXT(   R2   RS  R$   R`   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_host-  s    c         C   s3   | d j o |  i  t  d  Sn |  i i   d  S(   NR   (   Rl   R  R*  Rx   (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_break-  s    c   
   	   C   sB  | i  t  } t |  d j o | o
 t  n t |  d j o | d i   } n d } | d i t  } | d j o | d g } n! | d |  | d | d g } d | d g t |  d j } | d j o |  i } n y t	 | d  } d }	 Wn) t
 j
 o d } | d i   }	 n X| |	 | | f S(   Ni   R   i    i(   NR   (   Rr  t   BP_EVAL_SEPRW   R   R  R  t   BP_FILENAME_SEPR   R  R   R2  (
   R2   RS  t
   fAllowExprt   _argsR   t   rfR   Rb   R{   Rz   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __parse_bp_arg-  s(    
  
c         C   sB  |  i  o |  i t  d  Sn ys | d j oH |  i | d t \ } } } } t |  _ |  i i | | |  d  Sn t |  _ |  i i	   d  SWn t
 j
 o |  i t  n t j
 o |  i t |  n_ t j
 o |  i t |  n< t j
 o |  i i t i     n t |  _   n Xt |  _ d  S(   NR   R  (   R  Rl   t   STR_ILEGAL_ANALYZE_MODE_CMDt   _CConsoleInternal__parse_bp_argR'   R   R  R*  Ry   R;   R   R  R  R  R   t   STR_SCOPE_NOT_FOUNDR   Rm   R   R  (   R2   RS  Rb   Rz   R{   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_go.  s0    
!			c         C   s   | d j o |  i  t  d  Sn |  i o |  i  t  d  Sn y |  i i   Wn) t j
 o |  i i t i	     n Xd  S(   NR   (
   Rl   R  R  R  R*  R|   R   Rm   R   R  (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_step%.  s    
c         C   s   | d j o |  i  t  d  Sn |  i o |  i  t  d  Sn y |  i i   Wn) t j
 o |  i i t i	     n Xd  S(   NR   (
   Rl   R  R  R  R*  R}   R   Rm   R   R  (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_next7.  s    
c         C   s   | d j o |  i  t  d  Sn |  i o |  i  t  d  Sn y |  i i   Wn) t j
 o |  i i t i	     n Xd  S(   NR   (
   Rl   R  R  R  R*  R~   R   Rm   R   R  (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   do_returnI.  s    
c         C   s{   y t  |  } Wn$ t j
 o |  i t  d  Sn Xy |  i i |  Wn) t j
 o |  i i t i	     n Xd  S(   N(
   R   R2  Rl   R  R*  R   R   Rm   R   R  (   R2   RS  R{   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_jump[.  s    	c      	   C   s  | d j o |  i  t  d  Sn yA |  i | d t \ } } } } |  i i | | | t |  Wn t j
 o |  i  t  n t j
 o |  i  t |  np t	 j
 o |  i  t
 |  nM t j
 o |  i  t |  n* t j
 o |  i i t i     n Xd  S(   NR   R  (   Rl   R  R  R   R*  R   R   R  R  R   R  R	  t   STR_BAD_EXPRESSIONR   Rm   R   R  (   R2   RS  Rb   Rz   R{   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_bpk.  s     ! c         C   s   | d j o |  i  t  d  Sn yg g  } | t j } | p7 | i   } g  } | D] } | t |  qU ~ } n |  i i | |  Wn  t j
 o |  i  t  n Xd  S(   NR   (   Rl   R  t
   SYMBOL_ALLRr  R   R*  R   R2  (   R2   RS  R   RQ   t   sid_listRr  t   sid(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_be.  s    +c         C   s   | d j o |  i  t  d  Sn yg g  } | t j } | p7 | i   } g  } | D] } | t |  qU ~ } n |  i i | |  Wn  t j
 o |  i  t  n Xd  S(   NR   (   Rl   R  R%  Rr  R   R*  R   R2  (   R2   RS  R   RQ   R&  Rr  R'  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_bd.  s    +c         C   s   | d j o |  i  t  d  Sn yg g  } | t j } | p7 | i   } g  } | D] } | t |  qU ~ } n |  i i | |  Wn  t j
 o |  i  t  n Xd  S(   NR   (   Rl   R  R%  Rr  R   R*  R   R2  (   R2   RS  R   RQ   R&  Rr  R'  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_bc.  s    +c         C   su  |  i  i   } t | i    } | i   t t |  i  x3| D]+} | | } | i o | i } n d } y | i	 d d  d } Wn | i
 } n X| i } | i t d  o | t t  d } n- | i t d  o | t t  d } n t t g | i   }	 t | |	 | i t | i d  t | d  t | d  | f }
 t |
 i   d |  i  qB Wd  S(	   NR   Rg  t   strictR    i   i-   i2   s   
(   R*  R   R  R%  R  RJ   t   STR_BREAKPOINTS_LISTR  R  R   R_  R  Rl  R	  RW   R
  R%  R&  R(  t   STR_BREAKPOINTS_TEMPLATER  R|  R  Ru  R`  R   (   R2   RS  Rk  t   bplkR  R  R   R9   Rz   R   R_   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_bl.  s.    
 


	@c         C   s$   |  i  i |  t t |  i  d  S(   N(   R*  R   RJ   t   STR_BREAKPOINTS_SAVEDR  (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_save.  s    c         C   se   y( |  i  i |  t t |  i  d  SWn6 t j
 o* t t g | d j } |  i |  n Xd  S(   NR   (	   R*  R   RJ   t   STR_BREAKPOINTS_LOADEDR  R  t   STR_BREAKPOINTS_FILE_NOT_FOUNDt   STR_BREAKPOINTS_NOT_FOUNDRl   (   R2   RS  R+  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_load.  s    c         C   sw  |  i  o" | d j o |  i t  d  Sn yg  } | t j } | p7 | i   } g  } | D] } | t |  q_ ~ } n |  i i | |  } t |  d j o |  i t	  d  Sn |  i i
   } d  }	 xM| D]E}
 |
 i t g   } |
 i t d  } |
 i t t  } |
 i t t  } |	 d  j	 o t d |  i  n t t | |  i  d } x | t |  j  o | d | } t t g | } | o d | g | | j }	 n d | g | d j }	 t d |	 | t | d d  | d t | d d  f |  i  | d 7} qdWq WWnN t j
 o |  i t  n0 t t f j
 o |  i i t i     n Xd  S(   NR   i    i   s    %1s %5d  %-28s  %4d  %si   i   i   (    R  Rl   t   STR_ILEGAL_ANALYZE_MODE_ARGR%  Rr  R   R*  RV   RW   t   STR_NO_THREADS_FOUNDR   R   RX   RY   R  R  R'   R  RJ   R  t   STR_STACK_TRACEt   SOURCE_STATE_UNBROKENR  Ru  R`  R2  R  R   R   Rm   R   R  (   R2   RS  RP   RQ   R&  Rr  R'  R]   R   R	  R^   R_   R   t   fBrokent   fCurrentRc  R`   t   marker(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_stack.  sL    +  Ac         C   s  | i  t  } | d j o d } | } n | |  } | | d } | i t  } | d t j } | d t j } | d t j } | d t j }	 | d d j }
 t } d } yq t	 |  d j o t
 | d  } n
 |  i } | p | p | p |	 p |
 p t
 | d  } t } n Wn$ t j
 o |  i t  d  Sn X|  i o | o |  i t  d  Sn | o5 |  i o+ t d |  i |  i d d  } t } nA | o9 |  i o/ t d |  i |  i d d |  } t } n ys|	 o |  i i | d d  g } nh | o |  i i | | |  g } nB | d j o |  i i | | |  g } n |  i i | |  } t	 |  d j o |  i t  d  Sn d  } xQ| D]I} | i t d  } | i t d  } | i t h   } | i t g   } | i t d  } t	 |  d j o | d j o
 | } n | i t t  } | i t  d  } | i t! d  } | d  j	 o t" d |  i#  n t" t$ | | f |  i#  xKt% |  D]=\ } } | | } | | j o
 d } n | p t& t' } nm | d j o t( t' } nR | d j o t) t' } n7 | d j o t* t' } n | d	 j o t+ t' } n | i | d   t, j o
 t- } n* | i | d   t. j o
 t/ } n d } | i0 d
 d t1  } t" d | | | t2 | d  d  f |  i#  qWqW| p |	 o d  |  _ n= t	 |  d j o) | | d d | g | d j |  _ n | |  _ WnT t3 t4 f j
 o |  i t5  n0 t6 t7 f j
 o |  i i8 t9 i:     n Xd  S(   NiR   i   i    i   R  R  Rm  Rn  s   	R  s    %2s %1s %5d  %si<   (;   R  R  Rr  R  R%  R  R  t   SOURCE_ENTIRE_FILER'   RW   R   R  R   R2  Rl   R  R  R6  R  R  R*  R   R   R7  R   RX   R  R)  R*  R(  R+  R  R  R'  RJ   R  t   STR_SOURCE_LINESR  R9  R  t   SOURCE_EVENT_CALLt   SOURCE_EVENT_LINEt   SOURCE_EVENT_RETURNt   SOURCE_EVENT_EXCEPTIONR&  t   SOURCE_BP_ENABLEDR%  t   SOURCE_BP_DISABLEDR   t   PYTHON_TAB_WIDTHR`  R   R  t   STR_SOURCE_NOT_FOUNDR   R   Rm   R   R  (   R2   RS  R  R   t   _CConsoleInternal__args2R  RQ   t   fMoret   fLesst   fEntireR;  t   fLineR  R   R  R	  R  R   Rb   R  t   source_linesR&  R:  R-  R'  Rc  R  R{   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_list"/  s    

	#	!
%
  
 



5)c         C   sy   | d j o |  i  t  d  Sn y' |  i i   } |  i i | d  Wn) t j
 o |  i i t i     n Xd  S(   NR   i   (	   Rl   R  R*  R   R   R   Rm   R   R  (   R2   RS  t   fi(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_up/  s    c         C   sy   | d j o |  i  t  d  Sn y' |  i i   } |  i i | d  Wn) t j
 o |  i i t i     n Xd  S(   NR   i   (	   Rl   R  R*  R   R   R   Rm   R   R  (   R2   RS  RO  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_down/  s    c         C   sM  y |  i  i |  \ } } } | o |  i t |  n | o t | d |  i  n t | |  i  | i   o t |  i |  i d t n d  SWn t	 t
 f j
 o |  i  i t i     n t i t f j
 o |  i  i t i     nP t j
 o |  i  i t i     n( |  i  i t i     t t  n Xd  S(   Ns   
Re  (   R*  R   Rl   t   STR_WARNINGRJ   R  R  R  R'   R   R   Rm   R   R  R  R+  R   R   R  R   (   R2   t
   sync_eventR   Ro   R  R+  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   evaluate_job/  s&    c         C   s   | d j o |  i  t  d  Sn t i   } t i d |  i d | | f  } | i   | i t  | i	   o t
 t |  i  | i   n d  S(   NR   R  R   (   Rl   R  RG  RH  R  RT  R   R   t   WAIT_FOR_BREAK_TIMEOUTR  RJ   t   STR_OUTPUT_WARNING_ASYNCR  RA  (   R2   RS  RS  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_eval/  s    !
c         C   s:  y |  i  i |  \ } } | o |  i t |  n | o t | d |  i  n | i   o t |  i |  i d t n d  SWn t	 t
 f j
 o |  i  i t i     n t i t f j
 o |  i  i t i     nP t j
 o |  i  i t i     n( |  i  i t i     t t  n Xd  S(   Ns   
Re  (   R*  R   Rl   RR  RJ   R  R  R  R'   R   R   Rm   R   R  R  R+  R   R   R  R   (   R2   RS  R   R  R+  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   execute_job/  s$    c         C   s   | d j o |  i  t  d  Sn t t |  i  t i   } t i d |  i d | | f  } | i	   | i
 t  | i   o t t |  i  | i   n d  S(   NR   R  R   (   Rl   R  RJ   t   STR_OUTPUT_WARNINGR  RG  RH  R  RX  R   R   RU  R  RV  RA  (   R2   RS  RS  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_exec/  s    !
c      	   C   s  | d j o |  i  i   \ } } | t j o) y t i |  WqX | d 7} qX Xn | o | d t 7} n t t | |  i  d  Sn d | j o | i	 d  \ } } n | d } } | i
   } | d j o |  i  i   \ } } n d | j } |  i  i | |  | t j o9 y t i |  WqW| d 7} t t |  i  qWXn | o | d t 7} n t t | |  i  d  S(   NR   s    (?)s   , R  R/  (   R*  R   R[  Ri  Rj  t   ENCODING_RAWRJ   t   STR_ENCODING_MODER  Rr  R  R   t   STR_ENCODING_BADt   STR_ENCODING_MODE_SET(   R2   RS  R9   R   R/  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_encoding0  s8    
c   	      C   s~  |  i  o" | d j o |  i t  d  Sn y | d j o4 t |  } |  i i |  t t |  i  d  Sn |  i i	   \ } } t t
 |  i  xw t |  D]i \ } } d t g | t | j } t t g | t } t d | | | t | t | d  f |  i  q WWng t j
 o |  i t  nI t j
 o |  i t  n* t j
 o |  i i t i     n Xd  S(   NR   s    %1s %3d  %5d  %-15s  %si   (   R  Rl   R6  R   R*  R   RJ   t   STR_THREAD_FOCUS_SETR  R   t   STR_ACTIVE_THREADSR  R  R  R  t   STR_STATE_BROKENR  RA  R2  R  R   t   STR_THREAD_NOT_FOUNDR   Rm   R   R  (	   R2   RS  R   Rq  R  Rc  R  R	  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   do_thread70  s,     7c         C   sj   | d j o |  i  t  d  Sn y |  i i |  i  Wn) t j
 o |  i i t i     n Xd  S(   NR   (	   Rl   R  R*  R   R  R   Rm   R   R  (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   do_analyzeV0  s    c         C   s   | d j o1 |  i  i   } t t t |  |  i  d  Sn | t t  j o
 t } n2 | t t  j o
 t } n t t |  i  d  S|  i  i	 |  d  S(   NR   (
   R*  R   RJ   R  R   R  R   R'   R  R   (   R2   RS  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   do_synchrod0  s    

c         C   s   | d j o1 |  i  i   } t t t |  |  i  d  Sn | t t  j o
 t } n2 | t t  j o
 t } n t t |  i  d  S|  i  i	 |  d  S(   NR   (
   R*  R   RJ   t   STR_TRAP_MODER   R  R   R'   R  R   (   R2   RS  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_trapu0  s    

c         C   s   |  i  i   \ } } | d j oB t t g | } t t g | } t t | | f |  i  d  Sn | i	   } t | j o
 t
 } n t | j o
 t } n t | j o
 t } n t | j o
 t
 } n |  i  i | |  d  S(   NR   (   R*  R   R  R  R   R  RJ   t   STR_FORK_MODER  Rk  R'   R   R   (   R2   RS  R   R   R}  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_fork0  s     



c         C   s   | d j oL |  i  i   } | d  j o t t |  i  n t t | |  i  d  Sn | i d  } y( |  i  i |  t t | |  i  Wn# t	 j
 o t t
 |  i  n Xd  S(   NR   s   "'(   R*  R@   R   RJ   t   STR_PASSWORD_NOT_SETR  t   STR_PASSWORD_SETR  R   R   R   (   R2   RS  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_password0  s    c         C   s   | d j o1 |  i  i   } t t t |  |  i  d  Sn | t t  j o
 t } n2 | t t  j o
 t } n t t |  i  d  S|  i  i	 |  t t t |  |  i  d  S(   NR   (
   R*  R   RJ   t   STR_REMOTE_MODER   R  R   R'   R  R   (   R2   RS  R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   do_remote0  s    

c   
      C   s  |  i  i   } | d j ot t |  d j o t t |  i  d  Sn t t |  i  x. | D]& \ } } t d | | f |  i  q^ Wd  Sn | d  d j of | d i   } g  } | D]* \ } } | | j o | | | f q q ~ } |  i  i |  d  Sn y1 | i	 d  \ } } | i   } | i   } Wn$ t
 j
 o |  i t  d  Sn Xg  }	 | D]* \ } } | | j o |	 | | f qjqj~	 } | i | | f  |  i  i |  d  S(   NR   i    s   %s=%si   s   -dt   =(   R*  R   RW   RJ   t   STR_ENVIRONMENT_EMPTYR  t   STR_ENVIRONMENTR  R   Rr  R2  Rl   R  RI  (
   R2   RS  t   envR  R  Rr  t   _kt   _vt   _envR  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_env0  s2     >	>c         C   s   |  i  i   d  S(   N(   R*  R=   (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_stop0  s    c         C   s   | d j o |  i  t  d  Sn |  i i   t j o y |  i d  Wq t i t f j
 o |  i i	 t
 i     q t j
 o |  i i	 t
 i     q |  i i	 t
 i     t t  q Xn t d |  i  t S(   NR   (   Rl   R  R*  R   R;  Rx  R  R+  R   Rm   R   R  R   R  R   RJ   R  (   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_exit0  s    c         C   s   |  i  t  d  S(   N(   R  t   COPYRIGHT_NOTICE(   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   do_copyright1  s    c         C   s   |  i  t t  d  S(   N(   R  t   LICENSE_NOTICEt   COPY_OF_THE_GPL_LICENSE(   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   do_license1  s    c         C   s   |  i  t  d  S(   N(   R  t   CREDITS_NOTICE(   R2   RS  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   do_credits
1  s    c         C   s;   t  i i |  |  | d j o d } |  i |  n d  S(   NR   s  Security:
----------------

password    - Get or set the channel password.
remote      - Get or set "allow connections from remote machines" mode.

Session Control:
-----------------

env         - Display or set the environment setting for new sessions.
host        - Display or change host.
attach      - Display scripts or attach to a script on host.
detach      - Detach from script.
launch      - Start a script and attach to it.
restart     - Restart a script.
stop        - Shutdown the debugged script.
exit        - Exit from debugger.

Debuggee Control:
-----------------

break       - Request an immediate break.
step        - Continue to the next execution line.
next        - Continue to the next execution line in the current frame.
return      - Continue until the debugger is about to return from the frame.
jump        - Jump to a line in the current scope.
go          - Continue execution.

Breakpoints Control:
--------------------

bp          - Set a break point.
bd          - Disable a breakpoint.
be          - Enable a breakpoint.
bc          - Clear (delete) a breakpoint.
bl          - List all breakpoints.
load        - Load session breakpoints.
save        - save session breakpoints.

Misc:
-----

thread      - Display threads or switch to a particular thread.
list        - List source code.
stack       - Display stack trace.
up          - Go up one frame in stack.
down        - Go down one frame in stack.
encoding    - Set the source encoding used by exec and eval commands.
eval        - Evaluate expression in the context of the current frame.
exec        - Execute suite in the context of the current frame.
analyze     - Toggle analyze last exception mode.
trap        - Get or set "trap unhandled exceptions" mode.
fork        - Get or set fork handling mode.
synchro     - Get or set synchronicity mode.

License:
----------------

copyright   - Print copyright notice.
license     - Print license.
credits     - Print credits information.


type help <topic> for futher information.(   R  R  t   do_helpR  (   R2   RS  t   help_notice(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  1  s    @c         C   s   t  d |  i  d  S(   Ns"   copyright

Print copyright notice.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_copyrightV1  s    c         C   s   t  d |  i  d  S(   Ns   license

Print license.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_license\1  s    c         C   s   t  d |  i  d  S(   Ns#   credits

Print credits information.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_creditsb1  s    c         C   s   t  d |  i  d  S(   Nsj   help <cmd>

Print help for command <cmd>.
On the other hand I guess that you already know that, don't you?(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_helph1  s    c         C   s   t  d |  i  d  S(   Ns  analyze

(shorthand - a)

Toggle analyze last exception mode.

The following changes to the debugger behavior apply in analyze mode:
The debugger prompt changes to 'Analyze>'.
'go', 'step', 'next', and 'return' are not allowed.
'thread' does not allow to change the thread focus.
'stack' allows no arguments.
'list' does not accept the '*' (all threads) argument
'stack', 'list', 'eval', 'exec', 'up', and 'down' operate on the thrown 
exception.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_analyzeo1  s    c         C   s   t  d |  i  d  S(   Ns  password <password>

Get or set the channel password.

Communication between the console and the debuggee is always authenticated and
optionally encrypted. The password (A secret known to the console and the
debuggee alone) governs both security methods. The password is never 
communicated between the two components on the communication channel.

A password is always required since unsecured communication between the 
console and the debuggee might expose your machine to attacks.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_password1  s    
c         C   s   t  d |  i  d  S(   Ns  remote [True | False]

Get or set "allow connections from remote machines" mode.

When set to False: 
Newly launched debuggees will listen on localhost only. In this mode, debugger
consoles on remote machines will NOT BE able to see or attach to the debuggee.

When set to True: 
Newly launched debuggees will listen on INADDR_ANY. In this mode, debugger 
consoles on remote machines will BE able to see and attach to the debuggee.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_remote1  s    
c         C   s   t  d |  i  d  S(   Ns   trap [True | False]

Get or set "trap unhandled exceptions" mode.

When set to False: 
Debuggee will ignore unhandled exceptions.

When set to True: 
Debuggee will pause on unhandled exceptions for inspection.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_trap1  s    c         C   s   t  d |  i  d  S(   Ns  synchro [True | False]

Get or set the synchronicity mode.

Traditional Python debuggers that use the inspected thread 
(usually the main thread) to query or modify the script 
name-space have to wait until the script hits a break-point. 
Synchronicity allows the debugger to query and modify the 
script name-space even if its threads are still running or 
blocked in C library code by using special worker threads. 
In some rare cases querying or modifying data in 
synchronicity can crash the script. For example in some 
Linux builds of wxPython querying the state of wx objects 
from a thread other than the GUI thread can crash the 
script. If this happens or if you want to restrict these 
operations to the inspected thread, turn synchronicity off.

Default is True.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_synchro1  s    c         C   s   t  d |  i  d  S(   Ns
  fork [parent | child] [manual | auto]

Get or set fork handling mode.

Without arguments returns the current mode.

When 'parent' is specified the debugger will continue to debug the original
parent process after a fork.

When 'child' is specified the debugger will switch to debug the forked 
child process after a fork.

When 'manual' is specified the debugger will pause before doing a fork.

When 'auto' is specified the debugger will go through the fork without 
pausing and will make the forking decision based on the parent/child 
setting.

WARNING:
On some Posix OS such as FreeBSD, Stepping into the child fork 
can result in termination of the child process since the debugger
uses threading for its operation and on these systems threading and 
forking can conflict.
(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_fork1  s    c         C   s   t  d |  i  d  S(   Ns#   stop

Shutdown the debugged script.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_stop1  s    c         C   s   t  d |  i  d  S(   Ns   launch [-k] <script_name> [<script_args>]

Start script <script_name> and attach to it.

-k  Don't change the current working directory. By default the working
    directory of the launched script is set to its folder.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_launch1  s    c         C   s   t  d |  i  d  S(   Ns?   restart

Restart a script with same arguments from last launch.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_restart1  s    c         C   s   t  d |  i  d  S(   Ns.  attach [<arg>]

Without an argument, 'attach' prints the scripts available for debugging
on the selected host. To select a host use the 'host' command. A script is
considered available for debugging only if it is using the rpdb2 module or
has been executed by the debugger.
If the debugger is already attached to a script, a special character will
mark that script in the list.

When <arg> is an integer the debugger will try to attach to a script with
that pid. 
When <arg> is a string the debugger will try to attach to a script
with that name in the list.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_attach1  s    c         C   s   t  d |  i  d  S(   Nsr   detach

Detach from the script the debugger is currently attached to. The detached
script will continue execution.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_detach 2  s    c         C   s   t  d |  i  d  S(   NsS  break 

(shorthand - b)

Request script to break (pause execution as if it hit a breakpoint). 
The 'break' command returns immdeiately but the break is only established 
when an active thread submits to the debugger control. If a thread is 
doing a system call or executing C code, this will happen only when 
it returns to do python code.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   help_break2  s    c         C   s   t  d |  i  d  S(   Ns+  bp [<filename>':'] (<line> | <scope>) [',' <expr>]

Set a breakpoint.

<filename> - either the filename or the module name. 
<line>     - is the line number to assign the breakpoint to.
<scope>    - is a "fully qualified" function name. That is, not only the 
             function name but also the class name (in case of a member 
             function), such as MyClass.MyMemberFunction.
<expr>     - condition to evaluate in the context of the frame. If it
             evaluates to 'True' the break point will break into the debugger.

In case the <filemame> is omitted, the current file is assumed. In this case 
the debuggee has to be waiting at break point.

Examples:

    bp test_file.py:20
    bp test_file.py:MyClass.Foo
    bp 304

Type 'help break' for more information on breakpoints and threads.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_bp2  s    c         C   s   t  d |  i  d  S(   Ns   be (<id_list> | '*')
        
Enable breakpoints.

<id_list> - is a space delimited list of at least one breakpoint id
'*' - Enable all breakpoints.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_be.2  s    c         C   s   t  d |  i  d  S(   Ns   bd (<id_list> | '*')
        
Disable breakpoints.

<id_list> - is a space delimited list of at least one breakpoint id
'*' - disable all breakpoints.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_bd72  s    c         C   s   t  d |  i  d  S(   Ns   bc (<id_list> | '*')
        
Clear (delete) breakpoints.

<id_list> - is a space delimited list of at least one breakpoint id
'*' - clear all breakpoints.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_bc@2  s    c         C   s   t  d |  i  d  S(   Ns-   bl

List all breakpoints, sorted by their id.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_blI2  s    c         C   s   t  d |  i  d  S(   Ns   load [<filename>]
        
Load breakpoints.

<filename> - optional breakpoints filename. The filename should not include
             a file extension.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_loadO2  s    c         C   s   t  d |  i  d  S(   Ns   save [<filename>]
        
save breakpoints.

<filename> - optional breakpoints filename. The filename should not include
             a file extension.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_saveX2  s    c         C   s   t  d |  i  d  S(   Ns6  go [[<filename>':'] (<line> | <scope>)]

(shorthand - g)

Resume execution of a script that is waiting at break point. 
If an argument is present, continue execution until that argument is reached.

<filename> - is the file name which basically is the script's name without
             the '.py' extension. 
<line>   - is the line number to assign the breakpoint to.
<scope>  - is a "fully qualified" function name. That is, not only the 
           function name but also the class name (in case of a member 
           function), such as MyClass.MyMemberFunction.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_goa2  s    c         C   s   t  d |  i  d  S(   Ns|   exit

Exit the debugger. If the debugger is attached to a script, the debugger
will attempt to detach from the script first.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_exits2  s    c         C   s   t  d |  i  d  S(   Ns  host [<arg>]

Without an argument, 'host' prints the current selected host.
With an argument <arg>, 'host' attempts to resolve <arg> to a known ip 
address or a domain name. If it is successful, that host will become the
selected host. 
The default selected host is the local host.
Subsequent 'attach' commands will be done on the selected host. 

Type 'help attach' for more information.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_host|2  s    	c         C   s   t  d |  i  d  S(   Ns  stack [<tid> | '*']

(shorthand - k)

Without an argument, 'stack' prints the stack trace of the focused thread.
If the thread is waiting at break point a special character will mark the 
focused frame.

<tid> - print the stack of thread <tid> 
'*'   - print the stacks of all active threads.

Type 'help break' for more information on breakpoints and threads.
Type 'help up' or 'help down' for more information on focused frames.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   help_stack2  s    c         C   s   t  d |  i  d  S(   Ns  list [<file_name>:][<line_no> | '+' | '-' | '^' | '*'] [',' <nlines>]

(shorthand - l)

Without an argument, 'list' prints the source lines around the current line
of the focused thread in the focused frame. A special character sequence will 
mark the current line according to the event:

    'C>' - call - A function is called.
    'L>' - line - The interpreter is about to execute a new line of code.
    'R>' - return - A function is about to return.
    'E>' - exception - An exception has been thrown.
    '*>' - running - The thread is running.

If a breakpoint is assigned to a line, that line will be marked with:

    'B' - if the breakpoint is enabled
    'D' - if the breakpoint is disabled

<file_name> - List source from filename    
<line_no>   - Print the source lines around that line number in the same file 
              of the current line.
'+'         - Print the next lines in the file.
'-'         - Print the previous lines in the file.
'^'         - Print the entire file.
'*'         - Print the source lines for each of the active threads.
<nlines>    - Print <nlines> of source

Type 'help break' for more information on breakpoints and threads.
Type 'help up' or 'help down' for more information on focused frames.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_list2  s    c         C   s   t  d |  i  d  S(   Ns  thread [<no> | <tid>]

(shorthand - t)

Without an argument, 'thread' prints the list of known active threads, with
their corresponding state, which can be either 'running' or 
'waiting at break point'. A special character will mark the focused thread.

With an argument <tid>, 'thread' will attempt to set the debugger focus to
the thread of that tid.
With an argument <no>, 'thread' will attempt to set the debugger focus to 
the thread of that order in the thread list.

Type 'help break' for more information on breakpoints and threads.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_thread2  s    c         C   s   t  d |  i  d  S(   NsK   jump <lineno>

(shorthand - j)

Jump to line <lineno> in the current scope.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_jump2  s    c         C   s   t  d |  i  d  S(   Nso   next

(shorthand - n)

Continue execution until the next line in the current function
is reached or it returns.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_next2  s    c         C   s   t  d |  i  d  S(   Ns   step

(shorthand - s)

Execute the current line, stop at the first possible occasion
(either in a function that is called or in the current function).(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_step2  s    c         C   s   t  d |  i  d  S(   NsM   next

(shorthand - r)

Continue execution until the current function returns.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_return2  s    c         C   s   t  d |  i  d  S(   Ns  up

move the debugger focus one frame up the stack of the debugged thread 
(closer to the current, most recently executed frame). Evaluation of 
expressions or execution of statements will be done at the local and global 
name spaces of the focused frame.

Type 'help eval' for more information on evaluation of expressions.
Type 'help exec' for more information on execution of statements.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_up2  s    c         C   s   t  d |  i  d  S(   Ns  down

move the debugger focus one frame down the stack of the debugged thread 
(closer to the current, most recently executed frame). Evaluation of 
expressions or execution of statements will be done at the local and global 
name spaces of the focused frame.

Type 'help eval' for more information on evaluation of expressions.
Type 'help exec' for more information on execution of statements.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_down3  s    c         C   s   t  d |  i  d  S(   Ns  eval <expr>

(shorthand - v)

Evaluate the python expression <expr> under the global and local name spaces
of the currently focused frame.

Example:
'eval locals()' - will display the dictionary of the local variables.

IMPORTANT: Any changes to the global name space will be discarded unless the
focused stack frame is the top most frame.

Type 'help up' or 'help down' for more information on focused frames.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_eval3  s    c         C   s   t  d |  i  d  S(   Ns\  exec <stmt>

(shorthand - x)

Execute the python suite <stmt> under the global and local name spaces
of the currently focused frame.

Example:
'exec i += 1'

IMPORTANT: Any changes to the global name space will be discarded unless the
focused stack frame is the top most frame.

Type 'help up' or 'help down' for more information on focused frames.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt	   help_exec%3  s    c         C   s   t  d |  i  d  S(   Ns  encoding [<encoding> [, raw]]

Set the source encoding for the exec and eval commands.

Without an argument returns the current encoding.

The specified encoding can be either 'auto' or any encoding accepted 
by the codecs module. If 'auto' is specified, the source encoding of 
the active scope will be used, which is utf-8 by default.

The default encoding value is 'auto'.

If 'raw' is specified, strings returned by the eval command
will represent non ASCII characters as an escape sequence.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_encoding83  s    c         C   s   t  d |  i  d  S(   Nsm  env [-d key | key = value] 

Set the environment variables mapping. This mapping is used 
when a new script is launched to modify its environment.

Example for a mapping on Windows: 
env Path = %Path%;c:\mydir

Example for a mapping on Linux: 
env PATH = $PATH:~/mydir

To delete the mapping for PATH
env -d PATH

Without an argument returns the current list of mappings.

Note that the mapping will be evaluated and used to modify 
the environment after the debugger engine at the debuggee
has imported the modules it requires. The order in which the
mappings will be evaluated and applied is: 
last set, last evaluated.(   RJ   R  (   R2   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   help_envI3  s    N(   Rd   Re   R   R'   R4   R   R  R  R  R  R   R  R  t
   complete_vt   complete_exect
   complete_xR  R  R  Rl   R  R  R  R  R  R  R  R	  R  R  R  R  t   do_bR   R  R  t   do_gR  t   do_sR   t   do_nR!  t   do_rR"  t   do_jR$  R(  R)  R*  R/  R1  R5  R=  t   do_kRN  t   do_lRP  RQ  RT  RW  t   do_vRX  RZ  t   do_xR_  Rd  t   do_tRe  t   do_aRf  Rh  Rj  Rm  Ro  Rw  Rx  Ry  t   do_EOFR{  R~  R  R  R  R  R  R  R  t   help_aR  R  R  R  R  R  R  R  R  R  R  t   help_bR  R  R  R  R  R  R  R  t   help_gR  t   help_EOFR  R  t   help_kR  t   help_lR  t   help_tR  t   help_jR  t   help_nR  t   help_sR  t   help_rR  R  R  t   help_vR  t   help_xR  R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   
,  s  ;						(@																	 										"			3	s							)								"						H																																		 										c          O   s   t  |   d j o |  d } n) d | j o | d } n t |  |   S| t i j o t |  |   Sn t |  |   } | d j o | Sn y | i i   | SWn n Xy | i   | SWn n X| S(   Ni    RD   t   gtk(   RW   t   g_importR   R  t   gdkt   threads_init(   R   RC  RD   R	  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRx  h3  s*    
t   rpdb2c          C   s{   t  i d  }  xe |  d  j oW |  i i } |  i i } t | j o% | d j o d |  i j o |  Sn |  i }  q Wd  S(   Ni    Rc  Rh  Rg  (   s	   _evaluates   _execute(	   R   R  R   R  R  R  R\   R}  R  (   RP  Rb   RD   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __find_eval_exec_frame_in_stack3  s     *c          C   s   t    }  |  d  j o t   Sn yO |  i d } |  i d } t i | |  } | d | d | d f } | SWn t   Sn Xd  S(   NR   R  Rn   Ro   R  (   R  R   t   g_sys_exc_infoR}  t
   g_debuggerRM  (   RP  R   R  R`   R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   __exc_info3  s    	R  c          C   s   d  }  t i d  } xg | d  j oY | i i } | i i } t | j o' | i d  p | d j o
 | }  n | i } q W|  S(   Ni    R  Rt  (	   R   R   R  R  R  R  R\   Rl  R  (   R  RP  Rb   RD   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __find_debugger_frame3  s     *
t   CSignalHandlerc           B   s   e  Z d    Z RS(   c   	      C   s   x t  t  d j o t i d  \ } } } t d t |  t |  f  y | | |  Wq t i   \ } } } t |  } | i d  o | i	 d  d } n t
 | d | t |  f  } t i i |  q Xq Wd  S(   Ni    s   Handling pending signal: %s, %ss   <type 'Rp  i   s   %s: %s(   RW   t   g_signals_pendingRT  RT   R   R   R  R~  Rl  Rr  R[  R  R  R  (	   R2   R  R  t   frameobjR  R  Rp   R7  RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  3  s      (   Rd   Re   R  (    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  3  s   c         C   s  t    } | d  j o  t i |   } | |  |  Sn | i i d j oj | i d d j oV y  t i |   } | |  |  SWq t i t	 i
    } | i d t    q Xn t d t |   t |  f  | } x6 | d  j o( | | j o | i } Pn | i } q Wt i |   } t i | |  | f  d | i j o  | i i h  t   d < n t |   } t i i |  |  t i j o t i   o t i d  n d  S(   NRt  RM   Rm  R  s   Intercepted signal: %s, %st   signal_handleri    (   R  R   R  R  R  R  R}  R  R  RR  RS  R  R   RT   R   R  R  RI  R  R  RX  R  R  t   SIGINTR  R  (   R  R  R  R  R  RP  RM   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR  3  s8    	'  	 c         C   s   t  i |  t |    } | S(   N(   t   g_signal_handlersRX   t   g_signal_getsignal(   R  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __getsignal#4  s    R  c         C   sU   t  |   } | t i t i g j o t |  |  | Sn t |  t  | t |  <| S(   N(   R  R  R  R  t   g_signal_signalR  R  (   R  R  t   old_handler(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __signal14  s    
R  c           C   s   t  p t   a n t   S(   N(   Rs  R   R  t	   g_os_fork(    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __fork^4  s    t   forkc         C   s0   t  |   t j o t   d  j a n t |   S(   N(   Rn   R   R   R   R  t	   g_os_exit(   Rx  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __exit4  s    t   _exitc         C   s5   t  i i |   o t o t   a n t |  |  S(   N(   RC   RZ   R  Rs  R   R  t
   g_os_execv(   RZ   R   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRX  4  s    	t   execvc         C   s8   t  i i |   o t o t   a n t |  | |  S(   N(   RC   RZ   R  Rs  R   R  t   g_os_execve(   RZ   R   Rs  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRY  4  s    	t   execvec         C   s   t  d d  |  | |   S(   Nt   depthi   (   R   (   R  R   RC  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRZ  4  s    c         C   s   t  t |  | | f  S(   N(   t   g_thread_start_new_threadRZ  (   R  R   RC  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   __start_new_thread4  s    t   start_new_threadc         C   s;   t  d  j o d  Sn t i |   } t  i | d t d  S(   NR  (   R  R   R   R  R   R'   (   R  RP  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   4  s    c          C   s;   t  d  j o d  Sn t i d  }  t  i |   t i   S(   Ni   (   R  R   R   R  R   RR  RS  (   RP  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   4  s
    c         C   s   t  o d  Sn t d t    t d  j o d  Sn |  p t i   n t i   t i d  t	 i
   t i
   |  p d  Sn t t d  o- t t d  o t i t i   t i  n t i   d  S(   Ns   Entered _atexit() in pid %dg      ?t   killt   SIGKILL(   R  RT   RI  R  R   R  R  RU  RV  R   R5   R  RC   R  R  RH  R  t   abort(   t   fabort(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyRr  4  s     


 c          O   sc   t  |   d j p t  |  d j o t |  |   Sn |  d } | t i j o d  Sn t |  S(   Ni   i    (   RW   t
   __import__R   R  (   R   RC  RD   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   my_pickle_import5  s    &
c          C   s3   t  i t  t d  }  t i |   t t _ d  S(   Ns   (S'\xb3\x95\xf9\x1d\x105c\xc6\xe2t\x9a\xa5_`\xa59'
p0
S"(I0\nI1\nS'5657827'\np0\n(S'server_info'\np1\n(tI0\ntp2\ntp3\n."
p1
tp2
.0000000(   R  RG  t   XML_DATAR   RA  R  R  (   R_   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   workaround_import_deadlock+5  s    c         C   s  t  |   }  zdt i   t d  j	 o7 t i d  } t i d t t	  t i
 |  d  Sn t |   p t t   n | a | a t   | o t   o
 t  n t i d  } t |  } t i d d j oE y t i   t i   g a Wqt j
 o t i   g a qXn t i t  t d t  a t | t |  | |  a t i    t i! | d | Wd  t i"   Xd  S(   Ni   i    R   R  R   (#   R   t   g_server_lockRJ  R  R   R   R  R  R   R'   R   Rh   R   R   R  R;  R  R_  R   R  RZ   RC   R  R  R  R  t   atexitt   registerRr  R   R  R   R   R   RL  (   R   R   R   R   R   R	   RP  Rb   (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyR   35  s8    


c         C   s  t  |  p t  y t |  d  } t i | |  } | o t i t i i |   n | t j o7 t i i	 t i
   d  } | i t |  d  } n Wn- t j
 o! t d |  d d  d  Sn Xt d |  t   | }	 t i i |  o t i i |  }	 n t i i |	  t i d <t   }
 g  } |  D] } | t | |
  qC~ } | t _ t i t  t   a t | t | | | |  a t i   y  t i i  | d d d t! Wn n Xt i" d  } t i# | d t$ d	 | d
 a% t i& d =t' i( d |  d  S(   Ni    R   s   File s    not found.s   Starting server with: %si   RM  R  R  iR  ()   R   Ri   R  R  RX   RC   t   chdirRZ   R  R   R  R   R  R  RJ   RT   R  t   islinkt   realpathR   Rh  R   t   argvR  R  Rr  R   R  R  R   R   Ri  RN  R   R  R   R'   R  R  t   impt   load_source(   R   R7   R   R   R   RG   R`  R  R  t   speR9   Rr  RS  R  RP  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   StartServerp5  sD     		*		
 
c   	      C   sa  t  |   p t  | d  j p t  |  p t  | o t   o t t  d Sn t | | | |  } t |  } | i   t	 i
 d  y= | o | i |   n" |  d j o | i | |   n Wnw t i t f j
 o | i t i     nJ t j
 o | i t i     n% | i t i     t t  n X| i   | i   d  S(   Ni   g      ?R   (   R   Ri   R   R_  RJ   t   STR_ENCRYPTION_SUPPORT_ERRORRg   R   R   RU  RV  Rv   R6   R  R+  R   Rm   R   R  R   R  R   R   R5   (	   R8   t   fAttachR7   R   R   R   R$   t   smRs  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   StartClient5  s.    !


c         C   sM   t  i i t i d  } t d h  | d < |  p d  Sn t t  d  S(   Ni    s   %(rpdb)s [options] [<script-name> [<script-args>...]]

    %(rpdb)s uses the client-server model where the debugger UI/console is
    the client and the debugged script is the server (also called debuggee).
    The client and the server are separate processes and communicate over 
    sockets.

    Example: The following command starts the debugger UI/console and then 
    launches and attaches to the specified script:
    %(rpdb)s some_script.py 

    Options can be a combination of the following:
    -h, --help      Print this help.
    -d, --debuggee  Start the debugged script (server) paused and wait for a 
                    debugger console (client) to attach. 
    -a, --attach    Start the debugger console (client) and attach to the 
                    specified debugged script (server) which is assumed to 
                    be running already.
    -o, --host=     Specify host (or IP address) for remote connections.
    -r, --remote    Allow debuggees to accept connections from remote machines.
    -e, --encrypt   Force encrypted socket communication.
    -p, --pwd=      Specify password for socket communication. 
                    This flag is available only on NT systems. On other 
                    systems the password will be queried interactively 
                    if it is needed.
    -s, --screen    Use the Unix screen utility when starting the debuggee.
                    Note that the debugger should be started as follows:
                    screen rpdb2 -s [options] [<script-name> [<script-args>...]]
    -c, --chdir     Change the working directory to that of the launched 
                    script.
    --debug         Debug prints.

    Note that each option is available in short form (example -e) and in a 
    long form (example --encrypt).

    Options that end with '=' accept an argument that should follow without
    a space. For example to specify 192.168.0.10 as host use the following 
    option: 

        long form: --host=192.168.0.10
        short form: -o192.168.0.10
t   rpdb(   RC   RZ   R[   R   R  RJ   Rf   (   t	   fExtendedt
   scriptName(    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt
   PrintUsage5  s    )c         C   s  t    t   } g  } t i D] } | t | |  q ~ } yP t i | d d d d d d d d d	 d
 d d d d d d d g  \ } } Wn4 t i j
 o% t i   d } t |  d Sn Xt	 } t	 }	 t	 }
 t	 } d  } d  } d  } d  } t	 } t	 } t } x[| D]S\ } } | d8 j o t   d Sn | d9 j o
 t a n | d: j o
 t } n | d; j o
 t }	 n | d< j o
 | } n | d= j o
 t } n | d> j o
 t } n | d? j o
 t	 } n | d@ j o
 | } n | dA j o
 | } n | dB j o
 t a n | dC j o
 t } n | dD j o
 | } n | dE j o
 t	 a qqWd  } d  } d  } d  } d  } | d  j	 o" t i d- j o t t  d Sn | d  j	 o  t |  o t t  d Sn | o% t |  d j o t d.  d Sn | o |	 o t d/  d Sn |	 o% t |  d j o t d0  d Sn |	 o% t |  d j o t d1  d Sn |	 o | o t d2  d Sn | d  j	 o |	 o t d3  d Sn | d  j o
 t } n t |  d j o | o |	 }
 t |  d j } | o! | p |
 o t d4  d Sn | |	 |
 | d j p t  |	 o` t i t j oP y0 t | d  t | d  } t | d  Wqt t f j
 o qXn | d  j	 o  t i t j o t |  } n | p |	 o] t |  oO t t  x4 t o, t t   } t |  o Pn t t  qWt t!  n | p |
 o y] | d  j o> t" |  i# t$  } t% i& |  } t |  } | | d <n t' | d  Wqt j
 o t t( | d  d SqXn | oB | o t)   o t t*  d Sn t+ | | | | | |  n |	 o$ |  | d |	 | | | | |  n~ | o& |  t d5  |	 | | | | |  nQ t |  d j o
 d5 } n d6 d7 i, |  d6 } |  | |	 | | | | |  d S(F   Ni   s   hdao:rtep:sct   helpt   debugeet   debuggeeRv   s   host=t   remotet	   plaintextR8  s   pwd=s   rid=R   R  s   base64=t   nofwtestR  i   s   -hs   --helpi    s   --debugs   -ds	   --debugees
   --debuggees   -as   --attachs   -os   --hosts   -rs   --remotes   -ts   --plaintexts   -es	   --encrypts   -ps   --pwds   --rids   -ss   --screens   -cs   --chdirs   --base64s
   --nofwtestR   sM   --debuggee option requires a script name with optional <script-arg> argumentss1   --debuggee and --attach can not be used together.s4   --attach option requires a script name to attach to.s7   --attach option does not accept <script-arg> arguments.s/   --attach and --remote can not be used together.s/   --host can only be used together with --attach.sJ   -c can only be used when launching or starting a script from command line.R   R  s   " "(   s   -hs   --help(   s   --debug(   s   -ds	   --debugees
   --debuggee(   s   -as   --attach(   s   -os   --host(   s   -rs   --remote(   s   -ts   --plaintext(   s   -es	   --encrypt(   s   -ps   --pwd(   s   --rid(   s   -ss   --screen(   s   -cs   --chdir(   s   --base64(   s
   --nofwtest(-   Rl  Rh  R   R  R   t   getoptt   GetoptErrorR  RJ   R'   R   R   R  R  Rc  RY  RC   RD   t   STR_PASSWORD_NOT_SUPPORTEDRh   R   RW   R(   Ri   Rc  R   R  R  R2  R  R
  Rd  t   STR_PASSWORD_INPUTt   STR_PASSWORD_CONFIRMR   Ri  t   g_safe_base64_fromR'  R,  R  R  R_  R  R  R   (   t   StartClient_funcR9   Rr  RS  R  Rb  R  R`   t   fWrapR  t   fSpawnt   fStartt   encoded_patht   secretR$   R   R7   R   R   R  R  Rn  Rm  R  (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pyt   main	6  s   	-@
	 




















"
 	
 
$&
R  (U  Rf   Rz  R  R|  R}  Rd   t   ImportErrorR  R  R  RG  R  R  R(  Ry  R  RO  Rt  R  R  t   os.pathRC   R  RA  R  R  t   stringRR  RS  R'  R  Rn  Ri  R  R  RU  R  Ru  Ro  R$  R   R  R  R  t   hashlibt   md5R  R  R]  t   popen2t   Crypto.CipherR   R   R   t   TIMEOUT_FIVE_MINUTESR   R'   R   R
   R   R   R   R   R   t   VERSIONR   R!   R    R"   R#   Rg   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   RF  R,  Rh  Rd  Rg  Re  Rc  Rl  R   R   R   R'  R+  R*  R-  R.  Rd  RZ   R   Rf  Rg  R{  Rn  R  R  R  R  R  R  R  RU  R	  RP  RQ  R  R(   R  R  R@  RA  RB  RC  R9  RD  RE  R  R%  R  R  R>  R  R  R  R  R  R  R  t   STR_NO_THREADSRr  RX  R  t   STR_AUTOMATIC_LAUNCH_UNKNOWNR[  t   STR_KILL_NOTICEt   STR_STARTUP_FAILURERY  RV  t   STR_ANALYZE_GLOBALS_WARNINGR2  R0  t   STR_BREAKPOINTS_SAVE_PROBLEMt   STR_BREAKPOINTS_LOAD_PROBLEMt   STR_BREAKPOINTS_NOT_SAVEDt   STR_BREAKPOINTS_NOT_LOADEDR3  R4  t   STR_BAD_FILENAMEt   STR_SOME_BREAKPOINTS_NOT_LOADEDR#  R  R  t   STR_EXCEPTION_NOT_FOUNDR  t   STR_NO_SUCH_BREAKPOINTRc  R7  t   STR_THREAD_NOT_BROKENR`  R6  R  R  R  t   STR_PSYCO_WARNINGR  R  R  R  t   STR_DEBUGGEE_NOT_BROKENR  t   STR_ALREADY_ATTACHEDt   STR_NOT_ATTACHEDt   STR_COMMUNICATION_FAILURER}  t   STR_BAD_MBCS_PATHR  t   STR_FIREWALL_BLOCKt   STR_BAD_VERSIONt   STR_BAD_VERSION2t   STR_UNEXPECTED_DATAt   STR_ACCESS_DENIEDt   STR_ACCESS_DENIED2t   STR_ENCRYPTION_EXPECTEDt   STR_ENCRYPTION_EXPECTED2t   STR_DECRYPTION_FAILUREt   STR_DEBUGGEE_NO_ENCRYPTIONR  R  R  R  R
  t   STR_BAD_DATAt   STR_BAD_FILE_DATAt   STR_ATTACH_FAILEDRy  Rv  Rw  Rx  R  R  R  t   STR_DEBUGGEE_UNKNOWNRu  R  RG  R  R  R  R8  R?  Ra  R,  R-  R  Rk  Rl  R   t   STR_ENCRYPT_MODERn  R\  R^  R]  Rr  Rq  Rb  R  Rg  R  Ri  R  Ri  RR  t   STR_MAX_NAMESPACE_WARNING_TITLEt   STR_MAX_NAMESPACE_WARNING_TYPEt   STR_MAX_NAMESPACE_WARNING_MSGRf  R  R  R   R  t   ENCRYPTION_ENABLEDt   ENCRYPTION_DISABLEDR&  R%  Rx  R  R  R   R  R	  R
  R3  R<  R  R  R  R\   RV  Rb  RS   R  R=  R;  R  R\  Rs  R  R  RY   R  R  R  R*  R(  R)  R+  R'  R  R@  RA  RB  RC  RD  RT  RF  RU  RQ  R  R  R9  R   R[  R[  R  Re  R=  R  R?  R>  R  R  R  R  R  R9  R  R  R  t   DEFAULT_PATH_SUFFIX_LENGTHR  R  R  R  R  R   R  Rc  R~  R  R  R;  R@  R  R+  R|  R  R  Rs  R  R  R  R  R  R  R  R  R  R  R  RY  t	   maketransRj  R  RF  R  RX   R  RD  RQ  RX  RM  R[  R\  R  R   R7  R6  R4  R5  R   R^  RA  Rd  RJ   R   Rh  Rt  R|  Rq  R~  R  R  R  R  R  R  R  R  R  R  R  RT   R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R$  R&  R0  R2  R  R8  R:  R   RA  RB  R  RC  RD  RE  R=  RI  RL  RM  RR  RU  RV  R[  Rh   R_  Ru  R`  Rl  Rt  R  R  RE   R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  t   objectRN  RU  RV  RW  RX  R[  R^  Ra  Rb  Re  Rh  Ri  R0   R.   Rj  Rl  Rn  R+   Rq  Rr  Rs  Rx  R{  R}  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R)  R8  RQ  R\  R  R   Rv  R  R  R  R  R  R  R  R  R  R  R   t   HTTPR  R  t	   TransportR  R  R  R  R)  R&   R  R   Rx  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  RX  R  R  RY  R  R  RZ  R  R  R  R   R   Rr  R  R  R   R  R   R  R  R  t   ret(    (    (    s"   C:\py\_spe\plugins\winpdb\rpdb2.pys   <module>   s^  
 
0				  P
												


					$

																	!
				




											$	.							M			$	#			3					#	/{				"			2	
	#			
						
													%											9$					v 	
		
			

'mK		a	> I'  5       	5c$!kF           e	&			0			7	0		0		0		0		0		0		0	
					=	D	!4