Current File : //usr/share/gdb/python/gdb/FrameDecorator.pyc
�
�� Rc@sRddlZdefd��YZdefd��YZdefd��YZdS(i����NtFrameDecoratorcBsneZdZd�Zed��Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
RS(s)Basic implementation of a Frame DecoratorcCs
||_dS(N(t_base(tselftbase((s+/usr/share/gdb/python/gdb/FrameDecorator.pyt__init__3scCsU|j�}|jsM|jjsM|j�tjksM|j�tjkrQtStS(sIInternal utility to determine if the frame is special or
        limited.(	tfind_saltsymtabtfilenamettypetgdbtDUMMY_FRAMEtSIGTRAMP_FRAMEtTruetFalse(tframetsal((s+/usr/share/gdb/python/gdb/FrameDecorator.pyt_is_limited_frame6scCs#t|jd�r|jj�SdS(sLReturn any elided frames that this class might be
        wrapping, or None.telidedN(thasattrRRtNone(R((s+/usr/share/gdb/python/gdb/FrameDecorator.pyRDs
cCs�t|jtj�s7t|jd�r7|jj�Sn|j�}|j�tjkr\dS|j�tj	krudS|j�}|dkr�|j�}|St|�S(s� Return the name of the frame's function or an address of
        the function of the frame.  First determine if this is a
        special frame.  If not, try to determine filename from GDB's
        frame internal function API.  Finally, if a name cannot be
        determined return the address.  If this function returns an
        address, GDB will attempt to determine the function name from
        its internal minimal symbols store (for example, for inferiors
        without debug-info).tfunctions<function called from gdb>s<signal handler called>N(
t
isinstanceRR	tFrameRRtinferior_frameRR
RRtpctstr(RRtfuncR((s+/usr/share/gdb/python/gdb/FrameDecorator.pyRLscCs5t|jd�r|jj�S|j�}|j�S(s% Return the address of the frame's pctaddress(RRRRR(RR((s+/usr/share/gdb/python/gdb/FrameDecorator.pyRqs
cCsut|jd�r|jj�S|j�}|j�}|jsN|jjrg|j�}tj|�S|jjSdS(s� Return the filename associated with this frame, detecting
        and returning the appropriate library name is this is a shared
        library.RN(	RRRRRRRR	t
solib_name(RRRR((s+/usr/share/gdb/python/gdb/FrameDecorator.pyRzs

cCsTt|jd�r|jj�S|j�}|j|�r>dSt|�}|j�S(s Return an iterable of frame arguments for this frame, if
        any.  The iterable object contains objects conforming with the
        Symbol/Value interface.  If there are no frame arguments, or
        if this frame is deemed to be a special case, return None.t
frame_argsN(RRRRRRt	FrameVarstfetch_frame_args(RRtargs((s+/usr/share/gdb/python/gdb/FrameDecorator.pyR�s
cCsTt|jd�r|jj�S|j�}|j|�r>dSt|�}|j�S(s Return an iterable of local variables for this frame, if
        any.  The iterable object contains objects conforming with the
        Symbol/Value interface.  If there are no frame locals, or if
        this frame is deemed to be a special case, return None.tframe_localsN(RRR!RRRRtfetch_frame_locals(RRR ((s+/usr/share/gdb/python/gdb/FrameDecorator.pyR!�s
cCs_t|jd�r|jj�S|j�}|j|�r>dS|j�}|rW|jSdSdS(s� Return line number information associated with the frame's
        pc.  If symbol table/line information does not exist, or if
        this frame is deemed to be a special case, return NonetlineN(RRR#RRRR(RRR((s+/usr/share/gdb/python/gdb/FrameDecorator.pyR#�s
cCs&t|jd�r|jj�S|jS(s8 Return the gdb.Frame underpinning this frame decorator.R(RRR(R((s+/usr/share/gdb/python/gdb/FrameDecorator.pyR�s
(t__name__t
__module__t__doc__RtstaticmethodRRRRRRR!R#R(((s+/usr/share/gdb/python/gdb/FrameDecorator.pyRs 			%						tSymValueWrappercBs)eZdZd�Zd�Zd�ZRS(skA container class conforming to the Symbol/Value interface
    which holds frame locals or frame arguments.cCs||_||_dS(N(tsymtval(Rtsymboltvalue((s+/usr/share/gdb/python/gdb/FrameDecorator.pyR�s	cCs|jS(s6 Return the value associated with this symbol, or None(R*(R((s+/usr/share/gdb/python/gdb/FrameDecorator.pyR,�scCs|jS(sP Return the symbol, or Python text, associated with this
        symbol, or None(R)(R((s+/usr/share/gdb/python/gdb/FrameDecorator.pyR+�s(R$R%R&RR,R+(((s+/usr/share/gdb/python/gdb/FrameDecorator.pyR(�s		RcBs2eZdZd�Zd�Zd�Zd�ZRS(sOUtility class to fetch and store frame local variables, or
    frame arguments.cCs\||_ittj6ttj6ttj6ttj6ttj6ttj6ttj	6|_
dS(N(RRR	tSYMBOL_LOC_STATICtSYMBOL_LOC_REGISTERtSYMBOL_LOC_ARGtSYMBOL_LOC_REF_ARGtSYMBOL_LOC_LOCALtSYMBOL_LOC_REGPARM_ADDRtSYMBOL_LOC_COMPUTEDtsymbol_class(RR((s+/usr/share/gdb/python/gdb/FrameDecorator.pyR�s	





cCs/t|t�rtS|j}|jj|t�S(s� Local utility method to determine if according to Symbol
        type whether it should be included in the iterator.  Not all
        symbols are fetched, and only symbols that return
        True from this method should be fetched.(Rt
basestringRt
addr_classR4tgetR
(RR)tsym_type((s+/usr/share/gdb/python/gdb/FrameDecorator.pytfetch_b�s		cCs�g}y|jj�}Wntk
r2d}nXxw|dkr�|jsT|jrXPnxE|D]=}|jrtq_n|j|�r_|jt	|d��q_q_W|j
}q6W|S(s�Public utility method to fetch frame local variables for
        the stored frame.  Frame arguments are not fetched.  If there
        are no frame local variables, return an empty list.N(RtblocktRuntimeErrorRt	is_globalt	is_statictis_argumentR9tappendR(t
superblock(RtlvarsR:R)((s+/usr/share/gdb/python/gdb/FrameDecorator.pyR"�s


	
cCs�g}y|jj�}Wntk
r2d}nXx,|dkra|jdkrUPn|j}q6W|dkr�x6|D]+}|js�qun|jt|d��quWn|S(s�Public utility method to fetch frame arguments for the
        stored frame.  Frame arguments are the only type fetched.  If
        there are no frame argument variables, return an empty list.N(	RR:R;RRR@R>R?R((RR R:R)((s+/usr/share/gdb/python/gdb/FrameDecorator.pyRs



	(R$R%R&RR9R"R(((s+/usr/share/gdb/python/gdb/FrameDecorator.pyR�s
			(R	tobjectRR(R(((s+/usr/share/gdb/python/gdb/FrameDecorator.pyt<module>s�