
\Kc           @   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.5/bdb.pyR    	   s   c           B   sv  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( 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.5/bdb.pyt   __init__   s    	c         C   sv   | d | d d !d j o | Sn |  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.5/bdb.pyR      s    c         C   s>   d d  k  } | i   d  |  _ d  |  _ d  |  _ d |  _ d  S(   Nii    (   t	   linecachet
   checkcachet   Nonet   botframet	   stopframet   returnframet   quitting(   R   R   (    (    s   /usr/lib/python2.5/bdb.pyt   reset$   s    
			c         C   s   |  i  o d  Sn | d j o |  i |  Sn | d j o |  i | |  Sn | d j o |  i | |  Sn | d j o |  i | |  Sn | d j o |  i Sn | d j o |  i Sn | d j o |  i Sn d Gt |  GH|  i S(	   Nt   linet   callt   returnt	   exceptiont   c_callt   c_exceptiont   c_returns*   bdb.Bdb.dispatch: unknown debugging event:(   R   t   dispatch_linet   dispatch_callt   dispatch_returnt   dispatch_exceptiont   trace_dispatcht   repr(   R   t   framet   eventt   arg(    (    s   /usr/lib/python2.5/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.5/bdb.pyR"   @   s
     
 c         C   sz   |  i  d  j o | i |  _  |  i Sn |  i |  p |  i |  p d  Sn |  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.5/bdb.pyR#   F   s     
 
c         C   sO   |  i  |  p | |  i j o( |  i | |  |  i o
 t  qH n |  i S(   N(   R+   R   t   user_returnR   R    R&   (   R   R(   R*   (    (    s   /usr/lib/python2.5/bdb.pyR$   S   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.5/bdb.pyR%   Y   s
    
 c         C   sb   | |  i  j o t Sn xC | d  j	 o5 | |  i  j	 o% | |  i j o t Sn | i } q Wt S(   N(   R   t   TrueR   R   R.   t   False(   R   R(   (    (    s   /usr/lib/python2.5/bdb.pyR+   c   s     c         C   s   |  i  | i i  } | |  i j o t Sn | i } | |  i | j o, | i i } | |  i | j o t Sqv n t | | |  \ } } | o? | i |  _	 | o$ | i
 o |  i t | i   n t Sn t Sd  S(   N(   R   t   f_codet   co_filenameR   R4   t   f_linenot   co_firstlinenot	   effectivet   numbert	   currentbpt	   temporaryt   do_cleart   strR3   (   R   R(   R   t   linenot   bpt   flag(    (    s   /usr/lib/python2.5/bdb.pyR,   n   s    	c         C   s   t  d  d  S(   Ns)   subclass of bdb must implement do_clear()(   t   NotImplementedError(   R   R*   (    (    s   /usr/lib/python2.5/bdb.pyR=      s    c         C   s   |  i  i |  i | i i   S(   N(   R   t   has_keyR   R5   R6   (   R   R(   (    (    s   /usr/lib/python2.5/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.5/bdb.pyR0      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.5/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.5/bdb.pyR1      s    c         C   s   | \ } } } d S(   sm   This method is called if an exception occurs,
        but only if we are to stop at or just below this level.N(    (   R   R(   t   .2t   exc_typet	   exc_valuet   exc_traceback(    (    s   /usr/lib/python2.5/bdb.pyR2      s    c         C   s   d |  _ d |  _ d |  _ d S(   s   Stop after one line of code.i    N(   R   R   R   R   (   R   (    (    s   /usr/lib/python2.5/bdb.pyt   set_step   s    		c         C   s   | |  _  d |  _ d |  _ d S(   s2   Stop on the next line in or below the given frame.i    N(   R   R   R   R   (   R   R(   (    (    s   /usr/lib/python2.5/bdb.pyt   set_next   s    		c         C   s"   | i  |  _ | |  _ d |  _ d S(   s)   Stop when returning from the given frame.i    N(   R.   R   R   R   (   R   R(   (    (    s   /usr/lib/python2.5/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   RJ   t   settrace(   R   R(   (    (    s   /usr/lib/python2.5/bdb.pyt	   set_trace   s    
 	
c         C   sz   |  i  |  _ d  |  _ d |  _ |  i pN t i d   t i   i	 } x/ | o# | |  i  j	 o | `
 | i	 } qG Wn d  S(   Ni    (   R   R   R   R   R   R   RM   RP   RN   R.   RO   (   R   R(   (    (    s   /usr/lib/python2.5/bdb.pyt   set_continue   s    		
 c         C   s/   |  i  |  _ d  |  _ d |  _ t i d   d  S(   Ni   (   R   R   R   R   R   RM   RP   (   R   (    (    s   /usr/lib/python2.5/bdb.pyt   set_quit   s    		i    c   
      C   s   |  i  |  } d d  k } | i | |  } | p d | | f Sn | |  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   R?   R<   t   condt   funcnameR   R   t   listR@   (    (    s   /usr/lib/python2.5/bdb.pyt	   set_break   s    c         C   s   |  i  |  } | |  i j o d | Sn | |  i | j o d | | f Sn x& t i | | f D] } | i   qf 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   deleteMeRC   t   remove(   R   R   R?   R@   (    (    s   /usr/lib/python2.5/bdb.pyt   clear_break   s     c      	   C   s~   y t  |  } Wn d | Sn Xy t i | } Wn t j
 o d | Sn X| p d | Sn |  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:   R@   (    (    s   /usr/lib/python2.5/bdb.pyt   clear_bpbynumber   s    c         C   s   |  i  |  } | |  i j o d | Sn xC |  i | D]4 } t i | | f } x | D] } | i   qY Wq9 W|  i | =d  S(   Ns   There are no breakpoints in %s(   R   R   R   RZ   R[   (   R   R   R   t   blistR@   (    (    s   /usr/lib/python2.5/bdb.pyt   clear_all_file_breaks
  s      c         C   sH   |  i  p d Sn x& t i D] } | o | i   q q Wh  |  _  d  S(   Ns   There are no breakpoints(   R   R   R_   R[   (   R   R@   (    (    s   /usr/lib/python2.5/bdb.pyt   clear_all_breaks  s    

 c         C   s0   |  i  |  } | |  i j o | |  i | j S(   N(   R   R   (   R   R   R?   (    (    s   /usr/lib/python2.5/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   RZ   (   R   R   R?   (    (    s   /usr/lib/python2.5/bdb.pyt
   get_breaks!  s    c         C   s6   |  i  |  } | |  i j o |  i | Sn g  Sd  S(   N(   R   R   (   R   R   (    (    s   /usr/lib/python2.5/bdb.pyt   get_file_breaks'  s    c         C   s   |  i  S(   N(   R   (   R   (    (    s   /usr/lib/python2.5/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| | f S(   Ni    i   (   t   tb_framet   tb_nextR   RU   R7   R   R.   t   reverset   maxt   lent	   tb_lineno(   R   t   ft   tt   stackt   i(    (    s   /usr/lib/python2.5/bdb.pyt	   get_stack4  s      
 s   : c         C   s6  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 | |  } | o | | | i	   } n | S(   Nis   %s(%r)s   <lambda>t   __args__s   ()t
   __return__s   ->(
   R   R'   R   R5   R6   t   co_namet   f_localsR   RT   t   strip(   R   t   frame_linenot   lprefixR   R'   R(   R?   R   t   st   argst   rvR   (    (    s   /usr/lib/python2.5/bdb.pyt   format_stack_entryF  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   RM   RP   R&   t
   isinstancet   typest   CodeTypeR    R   (   R   t   cmdt   globalst   localsR   (    (    s   /usr/lib/python2.5/bdb.pyt   runb  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   RM   RP   R&   R   R   R   t   evalR    R   (   R   t   exprR   R   R   (    (    s   /usr/lib/python2.5/bdb.pyt   runevalu  s     

		c         C   s   |  i  | | |  d  S(   N(   R   (   R   R   R   R   (    (    s   /usr/lib/python2.5/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   RM   RP   R&   R   R    R   (   R   t   funcR}   t   kwdst   res(    (    s   /usr/lib/python2.5/bdb.pyt   runcall  s    
		N()   R   R   R   R	   R   R   R&   R"   R#   R$   R%   R+   R,   R=   R/   R0   R-   R1   R2   RJ   RK   RL   R   RQ   RR   RS   RY   R]   Rb   Rd   Re   Rf   Rg   Rh   Ri   Rt   R   R   R   R   R   (    (    (    s   /usr/lib/python2.5/bdb.pyR      sN   		
						
																
							c           C   s   t    i   d  S(   N(   R   RQ   (    (    (    s   /usr/lib/python2.5/bdb.pyRQ     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    (   RW   R   t   func_first_executable_lineRa   R   R<   RV   t   enabledt   ignoret   hitsR   t   nextR:   R_   RU   RZ   RC   (   R   Ra   R   R<   RV   RW   (    (    s   /usr/lib/python2.5/bdb.pyR	     s    									c         C   sV   |  i  |  i f } d  |  i |  i <|  i | i |   |  i | p |  i | =n d  S(   N(   Ra   R   R   R_   R:   RZ   R\   (   R   t   index(    (    s   /usr/lib/python2.5/bdb.pyR[     s
    c         C   s   d |  _  d  S(   Ni   (   R   (   R   (    (    s   /usr/lib/python2.5/bdb.pyt   enable  s    c         C   s   d |  _  d  S(   Ni    (   R   (   R   (    (    s   /usr/lib/python2.5/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   RM   t   stdoutR<   R   R:   Ra   R   RV   R   R   (   R   t   outt   dispt   ss(    (    s   /usr/lib/python2.5/bdb.pyt   bpprint  s(    






 
N(   R   R   R   R   RZ   R   R_   R	   R[   R   R   R   (    (    (    s   /usr/lib/python2.5/bdb.pyR     s   				c         C   s   |  i  p# |  i | i j o t Sn t Sn | i i |  i  j o t Sn |  i p | i |  _ n |  i | i j o t Sn t S(   s;   Check whether we should break here because of `b.funcname`.(   RW   R   R7   R4   R3   R5   Rw   R   (   t   bR(   (    (    s   /usr/lib/python2.5/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 Sq) Xq) 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   RZ   t   rangeRn   R   R   R   RV   R   R   t	   f_globalsRx   R   (   Ra   R   R(   t	   possiblesRs   R   t   val(    (    s   /usr/lib/python2.5/bdb.pyR9     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(   R5   Rw   (   R   R(   R}   t   name(    (    s   /usr/lib/python2.5/bdb.pyR0   G  s     
c         C   sy   d d  k  } | i i } | p
 d } n |  i | i i  } | i | | i  } d G| G| i G| Gd G| i   GHd  S(   Nis   ???s   +++t   :(   R   R5   Rw   R   R6   RT   R7   Ry   (   R   R(   R   R   t   fnR   (    (    s   /usr/lib/python2.5/bdb.pyR-   K  s     
c         C   s   d G| GHd  S(   Ns
   +++ return(    (   R   R(   t   retval(    (    s   /usr/lib/python2.5/bdb.pyR1   R  s    c         C   s   d G| GH|  i    d  S(   Ns   +++ exception(   RR   (   R   R(   t	   exc_stuff(    (    s   /usr/lib/python2.5/bdb.pyR2   T  s    	(   R   R   R0   R-   R1   R2   (    (    (    s   /usr/lib/python2.5/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.5/bdb.pyt   fooX  s    c         C   s   d G|  Gd GH|  d S(   Ns   bar(R   i   (    (   t   a(    (    s   /usr/lib/python2.5/bdb.pyR   ]  s    c          C   s   t    }  |  i d  d  S(   Ns   import bdb; bdb.foo(10)(   R   R   (   Rq   (    (    s   /usr/lib/python2.5/bdb.pyt   testa  s    	(   R   RM   R   R   t   __all__t	   ExceptionR    R   RQ   R   R   R9   R   R   R   R   (    (    (    s   /usr/lib/python2.5/bdb.pys   <module>   s    	T		5		