Sindbad~EG File Manager

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

�

��g���ddlZddlZd�Zd�ZGd�dej��Zd�Zd�ZGd�d	ej��ZGd
�dej��Z	d�Z
e
��dS)
�Nc�t�	tj|��S#t$rtd|�d|�d����wxYw)NzInvalid z	 regexp: �.)�re�compile�SyntaxError)�exp�idstrings  �./gdb/command/unwinders.py�validate_regexprsR��F��z�#������F�F�F��k�h�h�h����D�E�E�E�F���s��!7c���tj|��}t|��}|dkrtd���d}d}|dkr|d}|dkr|d}t	|d��t	|d��fS)a$Internal utility to parse unwinder command argv.

    Arguments:
        arg: The arguments to the command. The format is:
             [locus-regexp [name-regexp]]

    Returns:
        A 2-tuple of compiled regular expressions.

    Raises:
        SyntaxError: an error processing ARG
    �zToo many arguments.��r�locus�unwinder)�gdb�string_to_argv�lenrr)�arg�argv�argc�locus_regexp�name_regexps     r
�parse_unwinder_command_argsrs�����c�"�"�D��t�9�9�D��a�x�x��/�0�0�0��L��K��q�y�y��A�w���1�9�9��q�'�K���g�.�.���Z�0�0���c�.��eZdZdZ�fd�Zd�Zd�Z�xZS)�InfoUnwindera6GDB command to list unwinders.

    Usage: info unwinder [LOCUS-REGEXP [NAME-REGEXP]]

    LOCUS-REGEXP is a regular expression matching the location of the
    unwinder.  If it is omitted, all registered unwinders from all
    loci are listed.  A locus can be 'global', 'progspace' to list
    the unwinders from the current progspace, or a regular expression
    matching filenames of objfiles.

    NAME-REGEXP is a regular expression to filter unwinder names.  If
    this omitted for a specified locus, then all registered unwinders
    in the locus are listed.c�n��tt|���dtj��dS)Nz
info unwinder)�superr�__init__r�
COMMAND_STACK��self�	__class__s �r
r zInfoUnwinder.__init__Js,���
�l�D�!�!�*�*�?�C�<M�N�N�N�N�Nrc��|sdSt|��|D]>}|�|j��r"td|j�|jrdnd�����?dS)z�Lists the unwinders whose name matches regexp.

        Arguments:
            title: The line to print before the list.
            unwinders: The list of the unwinders.
            name_re: unwinder name filter.
        Nz  rz [disabled])�print�match�name�enabled)r#�title�	unwinders�name_rers     r
�list_unwinderszInfoUnwinder.list_unwindersMs~���	��F�
�e����!�	�	�H��}�}�X�]�+�+�
����}�}�H�,<�&O�b�b�-�&O�Q�����	�	rc���t|��\}}|�d��r!|�dtj|��|�d��r7tj��}|�d|jz|j|��tj��D]@}|�|j��r$|�d|jz|j|���AdS)N�globalzGlobal:�	progspacez
Progspace %s:zObjfile %s:)rr'r-r�frame_unwinders�current_progspace�filename�objfiles)r#r�from_tty�locus_rer,�cp�objfiles       r
�invokezInfoUnwinder.invoke_s���7��<�<���'��>�>�(�#�#�	I����	�3�+>��H�H�H��>�>�+�&�&�	��&�(�(�B�����"�+�-�r�/A�7�
�
�
��|�~�~�	�	�G��~�~�g�.�/�/�
��#�#�!�G�$4�4�g�6M�w�����	�	r)�__name__�
__module__�__qualname__�__doc__r r-r9�
__classcell__�r$s@r
rr;se������� � �O�O�O�O�O����$
�
�
�
�
�
�
rrc�`�d}|D](}|�|j��r||_|dz
}�)|S)z�Enable/disable unwinders whose names match given regex.

    Arguments:
        unwinders: The list of unwinders.
        name_re: Unwinder name filter.
        flag: Enable/disable.

    Returns:
        The number of unwinders affected.
    rr)r'r(r))r+r,�flag�totalrs     r
�do_enable_unwinder1rCosE��
�E������=�=���'�'�	�#�H���Q�J�E���Lrc��t|��\}}d}|�d��r|ttj||��z
}|�d��r*|ttj��j||��z
}tj��D]5}|�|j��r|t|j||��z
}�6|dkrtj��td||dkrdnd|rdnd	fz��d
S)zEnable/disable unwinder(s).rr/r0z%d unwinder%s %srr�sr)�disabledN)
rr'rCrr1r2r4r3�invalidate_cached_framesr&)rrAr6r,rBr8s      r
�do_enable_unwinderrH�s.��5�c�:�:��X�w�
�E��~�~�h���I�
�$�S�%8�'�4�H�H�H���~�~�k�"�"�
�
�$��!�#�#�3�W�d�
�
�	
���<�>�>�Q�Q���>�>�'�*�+�+�	Q��(��)@�'�4�P�P�P�E���q�y�y��$�&�&�&�	�����
�
�"�"��$�-N�Y�Y�J�
O�	P�����rc�(��eZdZdZ�fd�Zd�Z�xZS)�EnableUnwindera�GDB command to enable unwinders.

    Usage: enable unwinder [LOCUS-REGEXP [NAME-REGEXP]]

    LOCUS-REGEXP is a regular expression specifying the unwinders to
    enable.  It can 'global', 'progspace', or the name of an objfile
    within that progspace.

    NAME_REGEXP is a regular expression to filter unwinder names.  If
    this omitted for a specified locus, then all registered unwinders
    in the locus are affected.c�n��tt|���dtj��dS)Nzenable unwinder)rrJr rr!r"s �r
r zEnableUnwinder.__init__�s-���
�n�d�#�#�,�,�->��@Q�R�R�R�R�Rrc�&�t|d��dS)�&GDB calls this to perform the command.TN�rH�r#rr5s   r
r9zEnableUnwinder.invoke�s���3��%�%�%�%�%r�r:r;r<r=r r9r>r?s@r
rJrJ�sV�������
"�
"�S�S�S�S�S�&�&�&�&�&�&�&rrJc�(��eZdZdZ�fd�Zd�Z�xZS)�DisableUnwindera�GDB command to disable the specified unwinder.

    Usage: disable unwinder [LOCUS-REGEXP [NAME-REGEXP]]

    LOCUS-REGEXP is a regular expression specifying the unwinders to
    disable.  It can 'global', 'progspace', or the name of an objfile
    within that progspace.

    NAME_REGEXP is a regular expression to filter unwinder names.  If
    this omitted for a specified locus, then all registered unwinders
    in the locus are affected.c�n��tt|���dtj��dS)Nzdisable unwinder)rrRr rr!r"s �r
r zDisableUnwinder.__init__�s-���
�o�t�$�$�-�-�.@�#�BS�T�T�T�T�Trc�&�t|d��dS)rMFNrNrOs   r
r9zDisableUnwinder.invoke�s���3��&�&�&�&�&rrPr?s@r
rRrR�sV�������
"�
"�U�U�U�U�U�'�'�'�'�'�'�'rrRc�Z�t��t��t��dS)zInstalls the unwinder commands.N)rrJrR�rr
�register_unwinder_commandsrW�s)���N�N�N����������r)rrrr�CommandrrCrHrJrRrWrVrr
�<module>rYs��"
�	�	�	�
�
�
�
�F�F�F����<1�1�1�1�1�3�;�1�1�1�h���&���*&�&�&�&�&�S�[�&�&�&�*'�'�'�'�'�c�k�'�'�'�*���������r

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