Sindbad~EG File Manager

Current Path : /usr/local/share/gdb/python/gdb/__pycache__/
Upload File :
Current File : /usr/local/share/gdb/python/gdb/__pycache__/FrameDecorator.cpython-311.pyc

�

��g�-���ddlZGd�de��ZGd�de��ZGd�de��ZGd�d	e��ZGd
�de��ZdS)�Nc�X�eZdZdZd�Zed���Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
dS)�_FrameDecoratorBasezBase class of frame decorators.c��||_dS�N)�_base)�self�bases  �./gdb/FrameDecorator.py�__init__z_FrameDecoratorBase.__init__s
����
�
�
�c���|���}|jrP|jjrD|���tjks"|���tjkrdSdS)zIInternal utility to determine if the frame is special or
        limited.TF)�find_sal�symtab�filename�type�gdb�DUMMY_FRAME�SIGTRAMP_FRAME)�frame�sals  r
�__is_limited_framez&_FrameDecoratorBase.__is_limited_framesc���n�n�����
�	��:�&�	��z�z�|�|�s��.�.��z�z�|�|�s�1�1�1��4��urc�b�t|jd��r|j���SdS)zLReturn any elided frames that this class might be
        wrapping, or None.�elidedN)�hasattrrr�rs r
rz_FrameDecoratorBase.elided-s1���4�:�x�(�(�	'��:�$�$�&�&�&��trc��t|jtj��s.t	|jd��r|j���S|���}|���tjkrdS|���tj	krdS|�
��}t|t��sd}|S)a�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).�functionz<function called from gdb>z<signal handler called>z???)�
isinstancerr�Framerr�inferior_framerrr�name�str)rr�funcs   r
rz_FrameDecoratorBase.function5s����$�*�c�i�0�0�	-��t�z�:�.�.�
-��z�*�*�,�,�,��#�#�%�%���:�:�<�<�3�?�*�*�/�/�
�Z�Z�\�\�S�/�
/�
/�,�,��z�z�|�|���$��$�$�	��D��rc��t|jd��r|j���S|���}|���S)z$Return the address of the frame's pc�address)rrr%r �pc�rrs  r
r%z_FrameDecoratorBase.addressSsK���4�:�y�)�)�	(��:�%�%�'�'�'��#�#�%�%���x�x�z�z�rc��t|jd��r|j���S|���}|�|��rdSt|��}|���S)aReturn 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.�
frame_argsN)rrr)r �%_FrameDecoratorBase__is_limited_frame�	FrameVars�fetch_frame_args�rr�argss   r
r)z_FrameDecoratorBase.frame_args\sw���4�:�|�,�,�	+��:�(�(�*�*�*��#�#�%�%���"�"�5�)�)�	��4�������$�$�&�&�&rc��t|jd��r|j���S|���}|�|��rdSt|��}|���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.�frame_localsN)rrr1r r*r+�fetch_frame_localsr-s   r
r1z _FrameDecoratorBase.frame_localslsw���4�:�~�.�.�	-��:�*�*�,�,�,��#�#�%�%���"�"�5�)�)�	��4�������&�&�(�(�(rc���t|jd��r|j���S|���}|�|��rdS|���}|r|jSdS)z�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 None�lineN)rrr4r r*r�rrrs   r
r4z_FrameDecoratorBase.line|sy��
�4�:�v�&�&�	%��:�?�?�$�$�$��#�#�%�%���"�"�5�)�)�	��4��n�n�����	��8�O��4rc�l�t|jd��r|j���S|jS)z7Return the gdb.Frame underpinning this frame decorator.r )rrr rs r
r z"_FrameDecoratorBase.inferior_frame�s5��
�4�:�/�0�0�	/��:�,�,�.�.�.��z�rN)�__name__�
__module__�__qualname__�__doc__r�staticmethodr*rrr%r)r1r4r �rr
rrs�������)�)�����
�
��\�
�������<���'�'�'� )�)�)� ���$����rrc��eZdZdZd�ZdS)�FrameDecoratora�Basic implementation of a Frame Decorator

    This base frame decorator decorates a frame or another frame
    decorator, and provides convenience methods.  If this object is
    wrapping a frame decorator, defer to that wrapped object's method
    if it has one.  This allows for frame decorators that have
    sub-classed FrameDecorator object, but also wrap other frame
    decorators on the same frame to correctly execute.

    E.g

    If the result of frame filters running means we have one gdb.Frame
    wrapped by multiple frame decorators, all sub-classed from
    FrameDecorator, the resulting hierarchy will be:

    Decorator1
      -- (wraps) Decorator2
        -- (wraps) FrameDecorator
          -- (wraps) gdb.Frame

    In this case we have two frame decorators, both of which are
    sub-classed from FrameDecorator.  If Decorator1 just overrides the
    'function' method, then all of the other methods are carried out
    by the super-class FrameDecorator.  But Decorator2 may have
    overriden other methods, so FrameDecorator will look at the
    'base' parameter and defer to that class's methods.  And so on,
    down the chain.c�<�t|jd��r|j���S|���}|���}|jr|jjs(|���}tj|��S|jjS)��Return the filename associated with this frame, detecting
        and returning the appropriate library name is this is a shared
        library.r)	rrrr rrr&r�
solib_name)rrrr&s    r
rzFrameDecorator.filename�s���
�4�:�z�*�*�	)��:�&�&�(�(�(��#�#�%�%���n�n�����z�	'���!4�	'������B��>�"�%�%�%��:�&�&rN)r7r8r9r:rr<rr
r>r>�s-��������8'�'�'�'�'rr>c��eZdZdZd�Zd�ZdS)�DAPFrameDecoratorzVLike FrameDecorator, but has slightly different results
    for the "filename" method.c���t|jd��r|j���S|���}|���}|j�|j���SdS)r@rN)rrrr rr�fullnamer5s   r
rzDAPFrameDecorator.filename�sm��
�4�:�z�*�*�	)��:�&�&�(�(�(��#�#�%�%���n�n�����:�!��:�&�&�(�(�(��trc���t|jd��r|j���S|���}t	|��}|�d��S)r0r1T)rrr1r r+r2r-s   r
r1zDAPFrameDecorator.frame_locals�s^���4�:�~�.�.�	-��:�*�*�,�,�,��#�#�%�%��������&�&�t�,�,�,rN)r7r8r9r:rr1r<rr
rCrC�s<������"�"����-�-�-�-�-rrCc�$�eZdZdZd�Zd�Zd�ZdS)�SymValueWrapperzkA container class conforming to the Symbol/Value interface
    which holds frame locals or frame arguments.c�"�||_||_dSr)r�sym)rr�symbols   r
rzSymValueWrapper.__init__�s����
�����rc�R�|j�dS|j�|j��S)z5Return the value associated with this symbol, or NoneN)r�read_varrJrs r
�valuezSymValueWrapper.value�s'���:���4��z�"�"�4�8�,�,�,rc��|jS)zOReturn the symbol, or Python text, associated with this
        symbol, or None)rJrs r
rKzSymValueWrapper.symbol�s���x�rN)r7r8r9r:rrNrKr<rr
rHrH�sK������4�4����-�-�-�����rrHc�&�eZdZdZd�Zdd�Zd�ZdS)r+zOUtility class to fetch and store frame local variables, or
    frame arguments.c��||_dSr)rr's  r
rzFrameVars.__init__s
����
�
�
rFc��g}|j}	|���}n#t$rd}YnwxYwd}|��|js|jrn�|D]8}|jr|s�n|js�|�t||�����9|j	�D|snJd}|�
��}|�n1	|���}n#t$rd}YnwxYw|j}|��|S)z�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.NFT)r�block�RuntimeError�	is_global�	is_static�is_argument�is_variable�appendrHr�static_link�
superblock)r�follow_link�lvarsrrS�traversed_linkrJs       r
r2zFrameVars.fetch_frame_localssG�����
��	��K�K�M�M�E�E���	�	�	��E�E�E�	����������
�%�/�
���
:�
:���?��)�!� �!��������_�U�C�8�8�9�9�9�9��~�)�"���!%���)�)�+�+���=��!�!�K�K�M�M�E�E��#�!�!�!� �E�E�E�!�����(��=��@�s� �/�/�$B9�9C�Cc��g}	|j���}n#t$rd}YnwxYw|�P|js|jrnA|D]-}|js�
|�td|�����.|j�n	|j	}|�P|S)z�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)
rrSrTrUrVrWrYrHrr[)rr.rSrJs    r
r,zFrameVars.fetch_frame_args3s���
��	��J�$�$�&�&�E�E���	�	�	��E�E�E�	��������
�%�/�
���
8�
8���������O�D�#�6�6�7�7�7�7��~�)���$�E���"�s��-�-N)F)r7r8r9r:rr2r,r<rr
r+r+�sQ�����������-�-�-�-�^����rr+)r�objectrr>rCrHr+r<rr
�<module>ras�� �
�
�
�B�B�B�B�B�&�B�B�B�J+'�+'�+'�+'�+'�(�+'�+'�+'�\-�-�-�-�-�+�-�-�-�@�����f����.S�S�S�S�S��S�S�S�S�Sr

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists