vagd.gdb.types ============== .. py:module:: vagd.gdb.types Classes ------- .. autoapisummary:: vagd.gdb.types._TypePrinter vagd.gdb.types._TypeRecognizer vagd.gdb.types.TypePrinter Functions --------- .. autoapisummary:: vagd.gdb.types.get_basic_type vagd.gdb.types.has_field vagd.gdb.types.make_enum_dict vagd.gdb.types.deep_items vagd.gdb.types.get_type_recognizers vagd.gdb.types.apply_type_recognizers vagd.gdb.types.register_type_printer Module Contents --------------- .. py:function:: get_basic_type(type_: gdb.Type) -> gdb.Type .. py:function:: has_field(type_: gdb.Type, field: str) -> bool .. py:function:: make_enum_dict(type_: gdb.Type) -> dict[str, int] .. py:function:: deep_items(type_: gdb.Type) -> collections.abc.Iterator[tuple[str, gdb.Field]] .. py:function:: get_type_recognizers() -> list[_TypeRecognizer] .. py:function:: apply_type_recognizers(recognizers: list[_TypeRecognizer], type_obj: gdb.Type) -> str | None .. py:function:: register_type_printer(locus: gdb.Objfile | gdb.Progspace | None, printer: _TypePrinter) -> None .. py:class:: _TypePrinter Bases: :py:obj:`Protocol` Base class for protocol classes. Protocol classes are defined as:: class Proto(Protocol): def meth(self) -> int: ... Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing). For example:: class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:: class GenProto[T](Protocol): def meth(self) -> T: ... .. py:attribute:: enabled :type: bool .. py:attribute:: name :type: str .. py:method:: instantiate() -> _TypeRecognizer | None .. py:class:: _TypeRecognizer Bases: :py:obj:`Protocol` Base class for protocol classes. Protocol classes are defined as:: class Proto(Protocol): def meth(self) -> int: ... Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing). For example:: class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:: class GenProto[T](Protocol): def meth(self) -> T: ... .. py:method:: recognize(__type: gdb.Type) -> str | None .. py:class:: TypePrinter(name: str)