
mKc           @   s   d  Z  d d k Z d d k Z d d k Z d d d g Z d e f d     YZ d f  d     YZ d   Z d f  d	     YZ	 d
   Z
 d   Z d e f d     YZ d   Z d   Z d   Z d S(   s   Debugger basicsiNt   BdbQuitt   Bdbt
   Breakpointc           B   s   e  Z d  Z RS(   s   Exception to give up completely(   t   __name__t
   __module__t   __doc__(    (    (    s   /usr/lib/python2.6/bdb.pyR    	   s   c           B   s  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 d  Z d   Z d   Z d   Z d   Z d+ d  Z d   Z d   Z d d+ d+ 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+ d'  Z' d+ d+ d(  Z( d)   Z) d*   Z* RS(,   s   Generic Python debugger base class.

    This class takes care of details of the trace facility;
    a derived class should implement user interaction.
    The standard debugger class (pdb.Pdb) is an example.
    c         C   s   h  |  _  h  |  _ d  S(   N(   t   breakst   fncache(   t   self(    (    s   /usr/lib/python2.6/bdb.pyt   __init__   s    	c         C   ss   | d | d d !d j o | S|  i  i |  } | p5 t i i |  } t i i |  } | |  i  | <n | S(   Nt   <i   it   >(   R   t   gett   ost   patht   abspatht   normcase(   R   t   filenamet   canonic(    (    s   /usr/lib/python2.6/bdb.pyR      s    c         C   s3   d d  k  } | i   d  |  _ |  i d  d   d  S(   Ni(   t	   linecachet
   checkcachet   Nonet   botframet   _set_stopinfo(   R   R   (    (    s   /usr/lib/python2.6/bdb.pyt   reset$   s    
	c         C   s   |  i  o d  S| d j o |  i |  S| d j o |  i | |  S| d j o |  i | |  S| d j o |  i | |  S| d j o |  i S| d j o |  i S| d j o |  i Sd Gt |  GH|  i S(	   Nt   linet   callt   returnt	   exceptiont   c_callt   c_exceptiont   c_returns*   bdb.Bdb.dispatch: unknown debugging event:(   t   quittingt   dispatch_linet   dispatch_callt   dispatch_returnt   dispatch_exceptiont   trace_dispatcht   repr(   R   t   framet   eventt   arg(    (    s   /usr/lib/python2.6/bdb.pyR%   *   s$    
c         C   sL   |  i  |  p |  i |  o% |  i |  |  i o
 t  qE n |  i S(   N(   t	   stop_heret
   break_heret	   user_lineR    R    R%   (   R   R'   (    (    s   /usr/lib/python2.6/bdb.pyR!   >   s
     
 c         C   st   |  i  d  j o | i |  _  |  i S|  i |  p |  i |  p d  S|  i | |  |  i o
 t  n |  i S(   N(	   R   R   t   f_backR%   R*   t   break_anywheret	   user_callR    R    (   R   R'   R)   (    (    s   /usr/lib/python2.6/bdb.pyR"   D   s     
 
c         C   sO   |  i  |  p | |  i j o( |  i | |  |  i o
 t  qH n |  i S(   N(   R*   t   returnframet   user_returnR    R    R%   (   R   R'   R)   (    (    s   /usr/lib/python2.6/bdb.pyR#   Q   s
     
 c         C   s?   |  i  |  o( |  i | |  |  i o
 t  q8 n |  i S(   N(   R*   t   user_exceptionR    R    R%   (   R   R'   R)   (    (    s   /usr/lib/python2.6/bdb.pyR$   W   s
    
 c         C   sh   | |  i  j o | i |  i j Sx@ | d  j	 o2 | |  i  j	 o" | |  i j o t S| i } q$ Wt S(   N(   t	   stopframet   f_linenot
   stoplinenoR   R   t   TrueR-   t   False(   R   R'   (    (    s   /usr/lib/python2.6/bdb.pyR*   a   s     c         C   s   |  i  | i i  } | |  i j o t S| i } | |  i | j o) | i i } | |  i | j o t Sn t | | |  \ } } | o< | i |  _	 | o$ | i
 o |  i t | i   n t St Sd  S(   N(   R   t   f_codet   co_filenameR   R7   R4   t   co_firstlinenot	   effectivet   numbert	   currentbpt	   temporaryt   do_cleart   strR6   (   R   R'   R   t   linenot   bpt   flag(    (    s   /usr/lib/python2.6/bdb.pyR+   l   s    		c         C   s   t  d  d  S(   Ns)   subclass of bdb must implement do_clear()(   t   NotImplementedError(   R   R)   (    (    s   /usr/lib/python2.6/bdb.pyR?      s    c         C   s   |  i  | i i  |  i j S(   N(   R   R8   R9   R   (   R   R'   (    (    s   /usr/lib/python2.6/bdb.pyR.      s    c         C   s   d S(   sn   This method is called when there is the remote possibility
        that we ever need to stop in this function.N(    (   R   R'   t   argument_list(    (    s   /usr/lib/python2.6/bdb.pyR/      s    c         C   s   d S(   s9   This method is called when we stop or break at this line.N(    (   R   R'   (    (    s   /usr/lib/python2.6/bdb.pyR,      s    c         C   s   d S(   s5   This method is called when a return trap is set here.N(    (   R   R'   t   return_value(    (    s   /usr/lib/python2.6/bdb.pyR1      s    c         C   s   | \ } } } d  S(   N(    (   R   R'   t   exc_infot   exc_typet	   exc_valuet   exc_traceback(    (    s   /usr/lib/python2.6/bdb.pyR2      s    ic         C   s(   | |  _  | |  _ d |  _ | |  _ d  S(   Ni    (   R3   R0   R    R5   (   R   R3   R0   R5   (    (    s   /usr/lib/python2.6/bdb.pyR      s    			c         C   s   |  i  | | | i d  d S(   sx   Stop when the line with the line no greater than the current one is
        reached or when returning from current framei   N(   R   R4   (   R   R'   (    (    s   /usr/lib/python2.6/bdb.pyt	   set_until   s    c         C   s   |  i  d d  d S(   s   Stop after one line of code.N(   R   R   (   R   (    (    s   /usr/lib/python2.6/bdb.pyt   set_step   s    c         C   s   |  i  | d  d S(   s2   Stop on the next line in or below the given frame.N(   R   R   (   R   R'   (    (    s   /usr/lib/python2.6/bdb.pyt   set_next   s    c         C   s   |  i  | i |  d S(   s)   Stop when returning from the given frame.N(   R   R-   (   R   R'   (    (    s   /usr/lib/python2.6/bdb.pyt
   set_return   s    c         C   su   | d j o t i   i } n |  i   x* | o" |  i | _ | |  _ | i } q- W|  i   t i	 |  i  d S(   sp   Start debugging from `frame`.

        If frame is not specified, debugging starts from caller's frame.
        N(
   R   t   syst	   _getframeR-   R   R%   t   f_traceR   RL   t   settrace(   R   R'   (    (    s   /usr/lib/python2.6/bdb.pyt	   set_trace   s    
 	
c         C   so   |  i  |  i d   |  i pN t i d   t i   i } x/ | o# | |  i j	 o | ` | i } q< Wn d  S(   N(	   R   R   R   R   RO   RR   RP   R-   RQ   (   R   R'   (    (    s   /usr/lib/python2.6/bdb.pyt   set_continue   s    
 c         C   s/   |  i  |  _ d  |  _ d |  _ t i d   d  S(   Ni   (   R   R3   R   R0   R    RO   RR   (   R   (    (    s   /usr/lib/python2.6/bdb.pyt   set_quit   s    		i    c   
      C   s   |  i  |  } d d  k } | i | |  } | p d | | f S| |  i j o g  |  i | <n |  i | } | | j o | i |  n t | | | | |  }	 d  S(   Nis   Line %s:%d does not exist(   R   R   t   getlineR   t   appendR   (
   R   R   RA   R>   t   condt   funcnameR   R   t   listRB   (    (    s   /usr/lib/python2.6/bdb.pyt	   set_break   s    	c         C   s   |  i  |  } | |  i j o	 d | S| |  i | j o d | | f Sx& t i | | f D] } | i   q` Wt i i | | f  p |  i | i |  n |  i | p |  i | =n d  S(   Ns   There are no breakpoints in %ss   There is no breakpoint at %s:%d(   R   R   R   t   bplistt   deleteMet   has_keyt   remove(   R   R   RA   RB   (    (    s   /usr/lib/python2.6/bdb.pyt   clear_break   s    		 c      	   C   su   y t  |  } Wn d | SXy t i | } Wn t j
 o d | SX| p	 d | S|  i | i | i  d  S(   Ns"   Non-numeric breakpoint number (%s)s#   Breakpoint number (%d) out of ranges   Breakpoint (%d) already deleted(   t   intR   t
   bpbynumbert
   IndexErrorR`   t   fileR   (   R   R)   R<   RB   (    (    s   /usr/lib/python2.6/bdb.pyt   clear_bpbynumber   s    	
	c         C   s|   |  i  |  } | |  i j o	 d | SxC |  i | D]4 } t i | | f } x | D] } | i   qV Wq6 W|  i | =d  S(   Ns   There are no breakpoints in %s(   R   R   R   R\   R]   (   R   R   R   t   blistRB   (    (    s   /usr/lib/python2.6/bdb.pyt   clear_all_file_breaks  s    	  c         C   sE   |  i  p d Sx& t i D] } | o | i   q q Wh  |  _  d  S(   Ns   There are no breakpoints(   R   R   Rb   R]   (   R   RB   (    (    s   /usr/lib/python2.6/bdb.pyt   clear_all_breaks  s    

 c         C   s0   |  i  |  } | |  i j o | |  i | j S(   N(   R   R   (   R   R   RA   (    (    s   /usr/lib/python2.6/bdb.pyt	   get_break  s    c         C   sK   |  i  |  } | |  i j o( | |  i | j o t i | | f p g  S(   N(   R   R   R   R\   (   R   R   RA   (    (    s   /usr/lib/python2.6/bdb.pyt
   get_breaks"  s    c         C   s3   |  i  |  } | |  i j o |  i | Sg  Sd  S(   N(   R   R   (   R   R   (    (    s   /usr/lib/python2.6/bdb.pyt   get_file_breaks(  s    c         C   s   |  i  S(   N(   R   (   R   (    (    s   /usr/lib/python2.6/bdb.pyt   get_all_breaks/  s    c         C   s  g  } | o | i  | j o | i } n xF | d  j	 o8 | i | | i f  | |  i j o Pn | i } q- W| i   t d t	 |  d  } x4 | d  j	 o& | i | i  | i
 f  | i } q W| d  j o t d t	 |  d  } n | | f S(   Ni    i   (   t   tb_framet   tb_nextR   RW   R4   R   R-   t   reverset   maxt   lent	   tb_lineno(   R   t   ft   tt   stackt   i(    (    s   /usr/lib/python2.6/bdb.pyt	   get_stack5  s$     
 s   : c         C   s<  d d  k  } d d  k } | \ } } |  i | i i  } d | | f } | i i o | | i i } n | d } d | i j o | i d }	 n d  }	 |	 o | | i |	  } n | d } d | i j o. | i d }
 | d } | | i |
  } n | i | | | i	  } | o | | | i
   } n | S(   Nis   %s(%r)s   <lambda>t   __args__s   ()t
   __return__s   ->(   R   R&   R   R8   R9   t   co_namet   f_localsR   RV   t	   f_globalst   strip(   R   t   frame_linenot   lprefixR   R&   R'   RA   R   t   st   argst   rvR   (    (    s   /usr/lib/python2.6/bdb.pyt   format_stack_entryI  s*    


 c      
   B   s   | d  j o d d  k } | i } n | d  j o
 | } n |  i   e i |  i  e | e i	  p | d } n z( y | | | UWn e
 j
 o n XWd  d |  _ e i d   Xd  S(   Nis   
i   (   R   t   __main__t   __dict__R   RO   RR   R%   t
   isinstancet   typest   CodeTypeR    R    (   R   t   cmdt   globalst   localsR   (    (    s   /usr/lib/python2.6/bdb.pyt   rune  s     

 		c         C   s   | d  j o d d  k } | i } n | d  j o
 | } n |  i   t i |  i  t | t i	  p | d } n z. y t
 | | |  SWn t j
 o n XWd  d |  _ t i d   Xd  S(   Nis   
i   (   R   R   R   R   RO   RR   R%   R   R   R   t   evalR    R    (   R   t   exprR   R   R   (    (    s   /usr/lib/python2.6/bdb.pyt   runevalw  s     

 		c         C   s   |  i  | | |  d  S(   N(   R   (   R   R   R   R   (    (    s   /usr/lib/python2.6/bdb.pyt   runctx  s    c      	   O   sk   |  i    t i |  i  d  } z- y | | |   } Wn t j
 o n XWd  d |  _ t i d   X| S(   Ni   (   R   RO   RR   R%   R   R    R    (   R   t   funcR   t   kwdst   res(    (    s   /usr/lib/python2.6/bdb.pyt   runcall  s    
 		N(+   R   R   R   R	   R   R   R%   R!   R"   R#   R$   R*   R+   R?   R.   R/   R,   R1   R2   R   RK   RL   RM   RN   R   RS   RT   RU   R[   R`   Re   Rg   Rh   Ri   Rj   Rk   Rl   Rw   R   R   R   R   R   (    (    (    s   /usr/lib/python2.6/bdb.pyR      sR   		
						
																		
							c           C   s   t    i   d  S(   N(   R   RS   (    (    (    s   /usr/lib/python2.6/bdb.pyRS     s    c           B   s\   e  Z d  Z d Z h  Z d g Z d d d d  Z d   Z d   Z	 d   Z
 d d  Z RS(	   s  Breakpoint class

    Implements temporary breakpoints, ignore counts, disabling and
    (re)-enabling, and conditionals.

    Breakpoints are indexed by number through bpbynumber and by
    the file,line tuple using bplist.  The former points to a
    single instance of class Breakpoint.  The latter points to a
    list of such instances since there may be more than one
    breakpoint per line.

    i   i    c         C   s   | |  _  d  |  _ | |  _ | |  _ | |  _ | |  _ d |  _ d |  _ d |  _	 t
 i |  _ t
 i d t
 _ |  i i |   |  i i | | f  o |  i | | f i |   n |  g |  i | | f <d  S(   Ni   i    (   RY   R   t   func_first_executable_lineRd   R   R>   RX   t   enabledt   ignoret   hitsR   t   nextR<   Rb   RW   R\   R^   (   R   Rd   R   R>   RX   RY   (    (    s   /usr/lib/python2.6/bdb.pyR	     s    									c         C   sV   |  i  |  i f } d  |  i |  i <|  i | i |   |  i | p |  i | =n d  S(   N(   Rd   R   R   Rb   R<   R\   R_   (   R   t   index(    (    s   /usr/lib/python2.6/bdb.pyR]     s
    c         C   s   d |  _  d  S(   Ni   (   R   (   R   (    (    s   /usr/lib/python2.6/bdb.pyt   enable  s    c         C   s   d |  _  d  S(   Ni    (   R   (   R   (    (    s   /usr/lib/python2.6/bdb.pyt   disable  s    c         C   s  | d  j o t i } n |  i o
 d } n d } |  i o | d } n | d } | d |  i | |  i |  i f IJ|  i o | d |  i f IJn |  i	 o | d |  i	 IJn |  i
 o; |  i
 d j o
 d	 } n d
 } | d |  i
 | f IJn d  S(   Ns   del  s   keep s   yes  s   no   s   %-4dbreakpoint   %s at %s:%ds   	stop only if %ss   	ignore next %d hitsi   R   t    s!   	breakpoint already hit %d time%s(   R   RO   t   stdoutR>   R   R<   Rd   R   RX   R   R   (   R   t   outt   dispt   ss(    (    s   /usr/lib/python2.6/bdb.pyt   bpprint  s(    






 
N(   R   R   R   R   R\   R   Rb   R	   R]   R   R   R   (    (    (    s   /usr/lib/python2.6/bdb.pyR     s   				c         C   sx   |  i  p |  i | i j o t St S| i i |  i  j o t S|  i p | i |  _ n |  i | i j o t St S(   s;   Check whether we should break here because of `b.funcname`.(   RY   R   R4   R7   R6   R8   Rz   R   (   t   bR'   (    (    s   /usr/lib/python2.6/bdb.pyt   checkfuncname  s    

c         C   s'  t  i |  | f } xt d t |   D] } | | } | i d j o q) n t | |  p q) n | i d | _ | i p5 | i d j o | i d | _ q) q| d f Sq) yX t	 | i | i
 | i  } | o2 | i d j o | i d | _ q| d f Sn Wq) | d f SXq) Wd S(   s   Determine which breakpoint for this file:line is to be acted upon.

    Called only if we know there is a bpt at this
    location.  Returns breakpoint that was triggered and a flag
    that indicates if it is ok to delete a temporary bp.

    i    i   N(   NN(   R   R\   t   rangeRq   R   R   R   RX   R   R   R|   R{   R   (   Rd   R   R'   t	   possiblesRv   R   t   val(    (    s   /usr/lib/python2.6/bdb.pyR;     s0     

t   Tdbc           B   s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C   s.   | i  i } | p
 d } n d G| G| GHd  S(   Ns   ???s   +++ call(   R8   Rz   (   R   R'   R   t   name(    (    s   /usr/lib/python2.6/bdb.pyR/   G  s     
c         C   s   d d  k  } | i i } | p
 d } n |  i | i i  } | i | | i | i  } d G| G| i G| Gd G| i   GHd  S(   Nis   ???s   +++t   :(	   R   R8   Rz   R   R9   RV   R4   R|   R}   (   R   R'   R   R   t   fnR   (    (    s   /usr/lib/python2.6/bdb.pyR,   K  s     
c         C   s   d G| GHd  S(   Ns
   +++ return(    (   R   R'   t   retval(    (    s   /usr/lib/python2.6/bdb.pyR1   R  s    c         C   s   d G| GH|  i    d  S(   Ns   +++ exception(   RT   (   R   R'   t	   exc_stuff(    (    s   /usr/lib/python2.6/bdb.pyR2   T  s    	(   R   R   R/   R,   R1   R2   (    (    (    s   /usr/lib/python2.6/bdb.pyR   F  s   			c         C   s*   d G|  Gd GHt  |  d  } d G| GHd  S(   Ns   foo(t   )i
   s   bar returned(   t   bar(   t   nt   x(    (    s   /usr/lib/python2.6/bdb.pyt   fooX  s    c         C   s   d G|  Gd GH|  d S(   Ns   bar(R   i   (    (   t   a(    (    s   /usr/lib/python2.6/bdb.pyR   ]  s    c          C   s   t    }  |  i d  d  S(   Ns   import bdb; bdb.foo(10)(   R   R   (   Rt   (    (    s   /usr/lib/python2.6/bdb.pyt   testa  s    	(   R   RO   R   R   t   __all__t	   ExceptionR    R   RS   R   R   R;   R   R   R   R   (    (    (    s   /usr/lib/python2.6/bdb.pyt   <module>   s    	T		5		