tools/gdb/util/class_methods.py
def CreateTypeResolver(type_desc):
    """Creates a callback which resolves to the appropriate type when
    invoked.

    This is a helper to allow specifying simple types as strings when
    writing function descriptions. For complex cases, a callback can be
    passed which will be invoked when template instantiation is known.

    Args:
      type_desc: A callback generating the type or a string description of
          the type to lookup. Supported types are classes in the
          template_classes array (e.g. T) which will be looked up when those
          templated classes are known, or globally visible type names (e.g.
          int, base::Foo).

          Types can be modified by appending a '*' or '&' to denote a
          pointer or reference.

          If a callback is used, the callback will be passed an array of the
          instantiated template types.

    Note:
      This does not parse complex types such as std::vector<T>::iterator,
      to refer to types like these you must currently write a callback
      which constructs the appropriate type.
    """
    if callable(type_desc):
      return type_desc
    if type_desc == 'void':
      return lambda T: None
    if type_desc[-1] == '&':
      inner_resolver = CreateTypeResolver(type_desc[:-1])
      return lambda template_types: inner_resolver(template_types).reference()
    if type_desc[-1] == '*':
      inner_resolver = CreateTypeResolver(type_desc[:-1])
      return lambda template_types: inner_resolver(template_types).pointer()
    try:
      template_index = template_types.index(type_desc)
      return operator.itemgetter(template_index)
    except ValueError:
      return lambda template_types: gdb.lookup_type(type_desc)
Creates a callback which resolves to the appropriate type when
    invoked.

    This is a helper to allow specifying simple types as strings when
    writing function descriptions. For complex cases, a callback can be
    passed which will be invoked when template instantiation is known.

    Args:
      type_desc: A callback generating the type or a string description of
          the type to lookup. Supported types are classes in the
          template_classes array (e.g. T) which will be looked up when those
          templated classes are known, or globally visible type names (e.g.
          int, base::Foo).

          Types can be modified by appending a '*' or '&' to denote a
          pointer or reference.

          If a callback is used, the callback will be passed an array of the
          instantiated template types.

    Note:
      This does not parse complex types such as std::vector<T>::iterator,
      to refer to types like these you must currently write a callback
      which constructs the appropriate type.
    
Creates a callback which resolves to the appropriate type when
invoked.

This is a helper to allow specifying simple types as strings when
writing function descriptions. For complex cases, a callback can be
passed which will be invoked when template instantiation is known.
Creates a callback which resolves to the appropriate type when invoked . This is a helper to allow specifying simple types as strings when writing function descriptions . For complex cases a callback can be passed which will be invoked when template instantiation is known .
def CreateTypeResolver(type_desc):
    if callable(type_desc):
      return type_desc
    if type_desc == 'void':
      return lambda T: None
    if type_desc[-1] == '&':
      inner_resolver = CreateTypeResolver(type_desc[:-1])
      return lambda template_types: inner_resolver(template_types).reference()
    if type_desc[-1] == '*':
      inner_resolver = CreateTypeResolver(type_desc[:-1])
      return lambda template_types: inner_resolver(template_types).pointer()
    try:
      template_index = template_types.index(type_desc)
      return operator.itemgetter(template_index)
    except ValueError:
      return lambda template_types: gdb.lookup_type(type_desc)
def CreateTypeResolver ( type_desc ) : if callable ( type_desc ) : return type_desc if type_desc == 'void' : return lambda T : None if type_desc [ - 1 ] == '&' : inner_resolver = CreateTypeResolver ( type_desc [ : - 1 ] ) return lambda template_types : inner_resolver ( template_types ) . reference ( ) if type_desc [ - 1 ] == '*' : inner_resolver = CreateTypeResolver ( type_desc [ : - 1 ] ) return lambda template_types : inner_resolver ( template_types ) . pointer ( ) try : template_index = template_types . index ( type_desc ) return operator . itemgetter ( template_index ) except ValueError : return lambda template_types : gdb . lookup_type ( type_desc )
Creates a callback which resolves to the appropriate type when
invoked.
Creates a callback which resolves to the appropriate type when invoked .
"""Creates a callback which resolves to the appropriate type when
    invoked.

    This is a helper to allow specifying simple types as strings when
    writing function descriptions. For complex cases, a callback can be
    passed which will be invoked when template instantiation is known.

    Args:
      type_desc: A callback generating the type or a string description of
          the type to lookup. Supported types are classes in the
          template_classes array (e.g. T) which will be looked up when those
          templated classes are known, or globally visible type names (e.g.
          int, base::Foo).

          Types can be modified by appending a '*' or '&' to denote a
          pointer or reference.

          If a callback is used, the callback will be passed an array of the
          instantiated template types.

    Note:
      This does not parse complex types such as std::vector<T>::iterator,
      to refer to types like these you must currently write a callback
      which constructs the appropriate type.
    """
type_desc
A callback generating the type or a string description of
the type to lookup. Supported types are classes in the
template_classes array  which will be looked up when those
templated classes are known, or globally visible type names .

Types can be modified by appending a '*' or '&' to denote a
pointer or reference.

If a callback is used, the callback will be passed an array of the
instantiated template types.
A callback generating the type or a string description of the type to lookup . Supported types are classes in the template_classes array which will be looked up when those templated classes are known or globally visible type names . Types can be modified by appending a ' * ' or ' & ' to denote a pointer or reference . If a callback is used the callback will be passed an array of the instantiated template types .