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__/xmethods.cpython-311.pyc

�

��g'����ddlZddlZ	d�Zd�Zd�Zd�Zd�Zd�Zd�ZGd	�d
ej	��Z
Gd�dej	��ZGd
�dej	��Zd�Z
e
��dS)�Nc�j�	tj|��S#t$rtd||���wxYw)NzInvalid %s regexp: %s)�re�compile�SyntaxError)�	part_name�regexps  �./gdb/command/xmethods.py�validate_xm_regexpr
sJ��F��z�&�!�!�!���F�F�F��1�9�f�E�E�E�F���s��2c��tj|��}t|��}|dkrtd���d}d}d}|dkr|d}|dkr?|d�dd��}|d}t|��dkr|d}|rtd|��}nd}td	|��td
|��|fS)a?Parses the arguments passed to a xmethod command.

    Arguments:
        arg: The argument string passed to a xmethod command.

    Returns:
        A 3-tuple: (<locus matching regular expression>,
                    <matcher matching regular expression>,
                    <name matching regular experession>)
    �zToo many arguments to command.�N�r�;zxmethod name�locuszmatcher name)�gdb�string_to_argv�lenr�splitr
)�arg�argv�argc�locus_regexp�matcher_name_regexp�xm_name_regexp�parts�name_res        r	�parse_xm_command_argsrs�����c�"�"�D��t�9�9�D��a�x�x��:�;�;�;��L����N��q�y�y��A�w���q�y�y��Q��
�
�c�1�%�%��#�A�h���u�:�:��>�>�"�1�X�N���$�^�^�D�D������7�L�1�1��>�+>�?�?����c���d}|gi}|�d��r1||��fd�tjD����|S)a�Returns a dict of matching globally registered xmethods.

    Arguments:
        locus_re: Even though only globally registered xmethods are
                  looked up, they will be looked up only if 'global' matches
                  LOCUS_RE.
        matcher_re: The regular expression matching the names of xmethods.

    Returns:
        A dict of matching globally registered xmethod matchers.  The only
        key in the dict will be 'global'.
    �globalc�H��g|]}��|j���|��S���match�name��.0�m�
matcher_res  �r	�
<listcomp>z.get_global_method_matchers.<locals>.<listcomp>Ss.���"W�"W�"W��j�>N�>N�q�v�>V�>V�"W�1�"W�"W�"Wr)r$�extendr�xmethods)�locus_rer)�	locus_str�xm_dicts `  r	�get_global_method_matchersr0Cs]����I��"�o�G��~�~�h���Y��	��!�!�"W�"W�"W�"W�c�l�"W�"W�"W�X�X�X��Nrc���i}|D]t}t|tj��r|�d��s�2d}n|�|j��s�Pd}|�d|j��}�fd�|jD��||<�u|S)a�Returns a dict of matching registered xmethods in the LOCI.

    Arguments:
        loci: The list of loci to lookup matching xmethods in.
        locus_re: If a locus is an objfile, then xmethod matchers will be
                  looked up in it only if its filename matches the regular
                  expression LOCUS_RE.  If a locus is the current progspace,
                  then xmethod matchers will be looked up in it only if the
                  string "progspace" matches LOCUS_RE.
        matcher_re: The regular expression to match the xmethod matcher
                    names.

    Returns:
        A dict of matching xmethod matchers.  The keys of the dict are the
        filenames of the loci the xmethod matchers belong to.
    �	progspace�objfile� c�H��g|]}��|j���|��Sr"r#r&s  �r	r*z/get_method_matchers_in_loci.<locals>.<listcomp>ss.���T�T�T�A�:�;K�;K�A�F�;S�;S�T�a�T�T�Tr)�
isinstancer�	Progspacer$�filenamer,)�locir-r)r/r�
locus_typer.s  `    r	�get_method_matchers_in_locir;Ws����"�G��
U�
U���e�S�]�+�+�	#��>�>�+�.�.�
��$�J�J��>�>�%�.�1�1�
��"�J�)�z�z�5�>�>�:�	�T�T�T�T���T�T�T��	����Nrc
�N�d�}|sdS|D]�}||s�td|z��||D]t}td|j�||������|js�,|jD]@}|�|�|j��r"td|j�||�������A�u��dS)zPrint a dictionary of xmethods.c��|jsdSdS)Nz [disabled]r
)�enabled)r(s r	�get_status_stringz(print_xm_info.<locals>.get_status_stringzs���y�	� �=��2rNzXmethods in %s:z  z    )�printr%�methodsr$)r/rr?r.�matcherr(s      r	�
print_xm_inforCws����������
G�
G�	��y�!�	��
��)�+�,�,�,��y�)�	G�	G�G��E�g�l�l�,=�,=�g�,F�,F�,F�G�H�H�H��?�
���_�
G�
G���?�g�m�m�A�F�&;�&;�?��E����0A�0A�!�0D�0D�0D�E�F�F�F��
G�		G�	
G�
Grc��|���D]G\}}|D]?}|s||_�|js�|jD]#}|�|j��r||_�$�@�HdS)z>Set the status (enabled/disabled) of a dictionary of xmethods.N)�itemsr>rAr$r%)r/r�statusr.�matchersrBr(s       r	�set_xm_status1rH�s���&�}�}���'�'��	�8��	'�	'�G��
�#)�����?�
���_�
'�
'���=�=���(�(�'� &�A�I��
'�	'�'�'rc�0�t|��\}}}tt||��||��ttt	j��g||��||��ttt	j��||��||��dS)z�Set the status (enabled/disabled) of xmethods matching ARG.
    This is a helper function for enable/disable commands.  ARG is the
    argument string passed to the commands.
    N)rrHr0r;r�current_progspace�objfiles)rrFr-r)rs     r	�
set_xm_statusrL�s���
%:�#�$>�$>�!�H�j�'��-�h�
�C�C�W�f�U�U�U��#�S�%:�%<�%<�$=�x��T�T������
�#�C�L�N�N�H�j�I�I�������rc�(��eZdZdZ�fd�Zd�Z�xZS)�InfoXMethodaiGDB command to list registered xmethod matchers.

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

    LOCUS-REGEXP is a regular expression matching the location of the
    xmethod matchers.  If it is omitted, all registered xmethod matchers
    from all loci are listed.  A locus could be 'global', a regular expression
    matching the current program space's filename, or a regular expression
    matching filenames of objfiles.  Locus could be 'progspace' to specify that
    only xmethods from the current progspace should be listed.

    NAME-REGEXP is a regular expression matching the names of xmethod
    matchers.  If this omitted for a specified locus, then all registered
    xmethods in the locus are listed.  To list only a certain xmethods
    managed by a single matcher, the name regexp can be specified as
    matcher-name-regexp;xmethod-name-regexp.c�n��tt|���dtj��dS)Nzinfo xmethod)�superrN�__init__r�COMMAND_DATA��self�	__class__s �r	rQzInfoXMethod.__init__�s,���
�k�4� � �)�)�.�#�:J�K�K�K�K�Krc�*�t|��\}}}tt||��|��ttt	j��g||��|��ttt	j��||��|��dS)N)rrCr0r;rrJrK)rTr�from_ttyr-r)rs      r	�invokezInfoXMethod.invoke�s���(=�c�(B�(B�%��*�g��0��:�F�F��P�P�P��'��&�(�(�)�8�Z�
�
�
�		
�	
�	
�	�'������*�M�M�w�	
�	
�	
�	
�	
r��__name__�
__module__�__qualname__�__doc__rQrX�
__classcell__�rUs@r	rNrN�sV�������0�0�"L�L�L�L�L�
�
�
�
�
�
�
rrNc�(��eZdZdZ�fd�Zd�Z�xZS)�
EnableXMethoda�GDB command to enable a specified (group of) xmethod(s).

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

    LOCUS-REGEXP is a regular expression matching the location of the
    xmethod matchers.  If it is omitted, all registered xmethods matchers
    from all loci are enabled.  A locus could be 'global', a regular expression
    matching the current program space's filename, or a regular expression
    matching filenames of objfiles.  Locus could be 'progspace' to specify that
    only xmethods from the current progspace should be enabled.

    NAME-REGEXP is a regular expression matching the names of xmethods
    within a given locus.  If this omitted for a specified locus, then all
    registered xmethod matchers in the locus are enabled.  To enable only
    a certain xmethods managed by a single matcher, the name regexp can be
    specified as matcher-name-regexp;xmethod-name-regexp.c�n��tt|���dtj��dS)Nzenable xmethod)rPrarQrrRrSs �r	rQzEnableXMethod.__init__�s-���
�m�T�"�"�+�+�,<�c�>N�O�O�O�O�Orc�&�t|d��dS)NT�rL�rTrrWs   r	rXzEnableXMethod.invoke�s���c�4� � � � � rrYr_s@r	rara�sV�������=�=�"P�P�P�P�P�!�!�!�!�!�!�!rrac�(��eZdZdZ�fd�Zd�Z�xZS)�DisableXMethoda�GDB command to disable a specified (group of) xmethod(s).

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

    LOCUS-REGEXP is a regular expression matching the location of the
    xmethod matchers.  If it is omitted, all registered xmethod matchers
    from all loci are disabled.  A locus could be 'global', a regular
    expression matching the current program space's filename, or a regular
    expression filenames of objfiles. Locus could be 'progspace' to specify
    that only xmethods from the current progspace should be disabled.

    NAME-REGEXP is a regular expression matching the names of xmethods
    within a given locus.  If this omitted for a specified locus, then all
    registered xmethod matchers in the locus are disabled.  To disable
    only a certain xmethods managed by a single matcher, the name regexp
    can be specified as matcher-name-regexp;xmethod-name-regexp.c�n��tt|���dtj��dS)Nzdisable xmethod)rPrgrQrrRrSs �r	rQzDisableXMethod.__init__s-���
�n�d�#�#�,�,�->��@P�Q�Q�Q�Q�Qrc�&�t|d��dS)NFrdres   r	rXzDisableXMethod.invokes���c�5�!�!�!�!�!rrYr_s@r	rgrg�sX�������D�D�"R�R�R�R�R�"�"�"�"�"�"�"rrgc�Z�t��t��t��dS)zInstalls the xmethod commands.N)rNrargr"rr	�register_xmethod_commandsrks&���M�M�M��O�O�O������r)rrr
rr0r;rCrHrL�CommandrNrargrkr"rr	�<module>rms8��"
�	�	�	�
�
�
�
�-�F�F�F�!�!�!�H���(���@G�G�G�0'�'�'�"���& 
� 
� 
� 
� 
�#�+� 
� 
� 
�F!�!�!�!�!�C�K�!�!�!�2"�"�"�"�"�S�[�"�"�"�2���������r

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