Current File : //usr/share/gdb/python/gdb/command/__pycache__/unwinders.cpython-39.pyc
a

ɱZh�@sxddlZddlZdd�Zdd�ZGdd�dej�Zdd	�Zd
d�ZGdd
�d
ej�ZGdd�dej�Z	dd�Z
e
�dS)�NcCs4zt�|�WSty.td||f��Yn0dS)NzInvalid %s regexp: %s.)�re�compile�SyntaxError)ZexpZidstring�r�./usr/share/gdb/python/gdb/command/unwinders.py�validate_regexpsrcCs^t�|�}t|�}|dkr"td��d}d}|dkrJ|d}|dkrJ|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.��rZlocus�unwinder)�gdbZstring_to_argv�lenrr)�arg�argvZargcZlocus_regexpZname_regexprrr�parse_unwinder_command_argss
�rcs0eZdZdZ�fdd�Zdd�Zdd�Z�ZS)�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.cstt|��dtj�dS)Nz
info unwinder)�superr�__init__r�
COMMAND_STACK��self��	__class__rrrIszInfoUnwinder.__init__cCsF|sdSt|�|D],}|�|j�rtd|j|jr6dndf�qdS)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  %s%sr	z [disabled])�print�match�name�enabled)r�title�	unwinders�name_rerrrr�list_unwindersLs��zInfoUnwinder.list_unwinderscCs�t|�\}}|�d�r&|�dtj|�|�d�rNt��}|�d|j|j|�t��D]&}|�|j�rV|�d|j|j|�qVdS)N�globalzGlobal:�	progspacez
Progspace %s:zObjfile %s:)rrr r�frame_unwinders�current_progspace�filename�objfiles)rr�from_tty�locus_rerZcp�objfilerrr�invoke^s

��zInfoUnwinder.invoke)�__name__�
__module__�__qualname__�__doc__rr r*�
__classcell__rrrrr:srcCs,d}|D]}|�|j�r||_|d7}q|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
)rrr)rr�flag�totalrrrr�do_enable_unwinder1ns
r2cCs�t|�\}}d}|�d�r,|ttj||�7}|�d�rL|tt��j||�7}t��D]"}|�|j�rT|t|j||�7}qT|dkr�t��t	d||dkr�dnd|r�dnd	f�d
S)zEnable/disable unwinder(s).rr!r"z%d unwinder%s %sr
r	�srZdisabledN)
rrr2rr#r$r&r%Zinvalidate_cached_framesr)rr0r(rr1r)rrr�do_enable_unwinder�s$

���r4cs(eZdZdZ�fdd�Zdd�Z�ZS)�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.cstt|��dtj�dS)Nzenable unwinder)rr5rrrrrrrr�szEnableUnwinder.__init__cCst|d�dS)�&GDB calls this to perform the command.TN�r4�rrr'rrrr*�szEnableUnwinder.invoke�r+r,r-r.rr*r/rrrrr5�sr5cs(eZdZdZ�fdd�Zdd�Z�ZS)�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.cstt|��dtj�dS)Nzdisable unwinder)rr:rrrrrrrr�szDisableUnwinder.__init__cCst|d�dS)r6FNr7r8rrrr*�szDisableUnwinder.invoker9rrrrr:�sr:cCst�t�t�dS)zInstalls the unwinder commands.N)rr5r:rrrr�register_unwinder_commands�sr;)rrrrZCommandrr2r4r5r:r;rrrr�<module>s4