NAME gdb.types - Utilities for working with gdb.Types. CLASSES builtins.object TypePrinter class TypePrinter(builtins.object) | The base class for type printers. | | Instances of this type can be used to substitute type names during | 'ptype'. | | A type printer must have at least 'name' and 'enabled' attributes, | and supply an 'instantiate' method. | | The 'instantiate' method must either return None, or return an | object which has a 'recognize' method. This method must accept a | gdb.Type argument and either return None, meaning that the type | was not recognized, or a string naming the type. | | Methods defined here: | | __init__(self, name) | Initialize self. See help(type(self)) for accurate signature. | | instantiate(self) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) FUNCTIONS apply_type_recognizers(recognizers, type_obj) Apply the given list of type recognizers to the type TYPE_OBJ. If any recognizer in the list recognizes TYPE_OBJ, returns the name given by the recognizer. Otherwise, this returns None. deep_items(type_) Return an iterator that recursively traverses anonymous fields. Arguments: type_: The type to traverse. It should be one of gdb.TYPE_CODE_STRUCT or gdb.TYPE_CODE_UNION. Returns: an iterator similar to gdb.Type.iteritems(), i.e., it returns pairs of key, value, but for any anonymous struct or union field that field is traversed recursively, depth-first. get_basic_type(type_) Return the "basic" type of a type. Arguments: type_: The type to reduce to its basic type. Returns: type_ with const/volatile is stripped away, and typedefs/references converted to the underlying type. get_type_recognizers() Return a list of the enabled type recognizers for the current context. has_field(type_, field) Return True if a type has the specified field. Arguments: type_: The type to examine. It must be one of gdb.TYPE_CODE_STRUCT, gdb.TYPE_CODE_UNION. field: The name of the field to look up. Returns: True if the field is present either in type_ or any baseclass. Raises: TypeError: The type is not a struct or union. make_enum_dict(enum_type) Return a dictionary from a program's enum type. Arguments: enum_type: The enum to compute the dictionary for. Returns: The dictionary of the enum. Raises: TypeError: The type is not an enum. register_type_printer(locus, printer) Register a type printer. PRINTER is the type printer instance. LOCUS is either an objfile, a program space, or None, indicating global registration. FILE /opt/gsrc/packages/gdb-7.11.1/share/gdb/python/gdb/types.py