Sindbad~EG File Manager
�
��g�8 � �� � d Z ddlZddlZddlZd� Zd� Z G d� dej � � Zd� Zd� Z dd
�Z
d� Zd� Zd
� Z
G d� dej � � Z G d� dej � � Zd� Z e� � dS )z.GDB commands for working with pretty-printers.� Nc �z � t j | � � }t |� � }d}d}d}|dk rt d� � �|dk r|d }|dk r?|d � dd� � }|d }t |� � dk r|d } t j |� � }n # t $ r t d |z � � �w xY w t j |� � }n # t $ r t d
|z � � �w xY w|�6 t j |� � } n"# t $ r t d|z � � �w xY wd} ||| fS )a� Internal utility to parse a pretty-printer command argv.
Arguments:
arg: The arguments to the command. The format is:
[object-regexp [name-regexp]].
Individual printers in a collection are named as
printer-name;subprinter-name.
Returns:
The result is a 3-tuple of compiled regular expressions, except that
the resulting compiled subprinter regexp is None if not provided.
Raises:
SyntaxError: an error processing ARG
� N� ztoo many arguments� r � �;zinvalid object regexp: %szinvalid name regexp: %szinvalid subname regexp: %s)�gdb�string_to_argv�len�SyntaxError�split�re�compile)
�arg�argv�argc�
object_regexp�name_regexp�subname_regexp�name_subname� object_re�name_re�
subname_res
� ./gdb/command/pretty_printers.py�parse_printer_regexpsr s� � �"