crash.infra.lookup module
*************************

class crash.infra.lookup.DelayedMinimalSymbol(name: str, wait_for_target: bool = True)

   Bases: "DelayedValue"

   A DelayedValue that handles minimal symbols.

   Parameters:
      **name** -- The name of the minimal symbol

class crash.infra.lookup.DelayedMinimalSymval(name: str, wait_for_target: bool = True)

   Bases: "DelayedMinimalSymbol"

   A DelayedMinimalSymbol that returns the address of the minimal
   symbol as an "int".

   Parameters:
      **name** -- The name of the minimal symbol.

   callback(value: MinSymbol) -> None

class crash.infra.lookup.DelayedSymbol(name: str, wait_for_target: bool = True)

   Bases: "DelayedValue"

   A DelayedValue that handles symbols.

   Parameters:
      **name** -- The name of the symbol

class crash.infra.lookup.DelayedSymval(name: str, wait_for_target: bool = True)

   Bases: "DelayedSymbol"

   A "DelayedSymbol" that returns the "gdb.Value" associated with the
   symbol.

   Parameters:
      **name** -- The name of the symbol.

   callback(value: Symbol) -> None

class crash.infra.lookup.DelayedType(name: str, wait_for_target: bool = True, block: Block = None)

   Bases: "DelayedValue"

   A DelayedValue for types.

   Parameters:
      **name** -- The name of the type.

   callback(value: Type) -> None

class crash.infra.lookup.DelayedValue(name: str, wait_for_target: bool = True, **kwargs: Any)

   Bases: "object"

   A generic class for making class attributes available that describe
   to-be-loaded symbols, minimal symbols, and types.

   attach_callback(cbcls: Type[NamedCallback], **kwargs: Any) -> None

   callback(value: Any) -> None

   get() -> Any

class crash.infra.lookup.MinimalSymbolCallback(name: str, callback: Callable[[Any], bool | None], wait_for_target: bool = True, symbol_file: str = None)

   Bases: "NamedCallback"

   A callback that executes when the named minimal symbol is
   discovered in the objfile and returns the "gdb.MinSymbol".

   The callback must accept a "gdb.MinSymbol" and return "bool" or
   "None".

   Parameters:
      * **name** -- The name of the minimal symbol to discover

      * **callback** -- The callback to execute when the minimal
        symbol is discovered

      * **symbol_file** (*optional*) -- Name of the symbol file to use

   check_ready() -> MinSymbol | None

      Returns the result of looking up the minimal symbol when a new
      object file is loaded.

      Returns:
         The requested minimal symbol

      Return type:
         "gdb.MinSymbol"

class crash.infra.lookup.NamedCallback(name: str, callback: Callable[[Any], bool | None], wait_for_target: bool = True, **kwargs: Any)

   Bases: "ObjfileEventCallback"

   A base class for Callbacks with names

   This cannot be used directly since it does not provide a method for
   "ObjfileEventCallback.callback()".

   Parameters:
      * **name** -- The name of the symbol or type to be resolved.

      * **callback** -- A function to call with the result of the
        derived class's "ObjfileEventCallback.check_ready()" method.

      * **attrname** (*optional*) -- A name safe for use as an
        attribute name. If unspecified, defaults to the same string as
        name.

   name

      The name of the symbol or type being resolved.

      Type:
         "str"

   attrname

      The name of symbol or type being resolved translated for use as
      an attribute name.

      Type:
         "str"

   callback(result: Any) -> None | bool

      The callback for handling the sucessful result of
      "check_ready()".

      It indirectly calls the callback specified in the constructor.

      Parameters:
         **result** -- The result returned from "check_ready()"

      Returns:
         If "None" or "True", the callback succeeded and will be
         completed and removed. Otherwise, the callback will stay
         connected for future completion.

      Return type:
         "None" or "bool"

class crash.infra.lookup.SymbolCallback(name: str, callback: Callable[[Any], bool | None], wait_for_target: bool = True, domain: int = 0)

   Bases: "NamedCallback"

   A callback that executes when the named symbol is discovered in the
   objfile and returns the "gdb.Symbol".

   The callback must accept a "gdb.Symbol" and return "bool" or
   "None".

   Parameters:
      * **name** -- The name of the symbol to discover

      * **callback** -- The callback to execute when the symbol is
        discovered

      * **domain** (*optional*) -- The domain to search for the
        symbol.  The value is assumed to be one of the value
        associated with "gdb.Symbol" constant, i.e. SYMBOL_*_DOMAIN.

   check_ready() -> Symbol | None

      Returns the result of looking up the symbol when a new object
      file is loaded.

      Returns:
         The requested symbol

      Return type:
         "gdb.Symbol"

class crash.infra.lookup.SymvalCallback(name: str, callback: Callable[[Any], bool | None], wait_for_target: bool = True, domain: int = 0)

   Bases: "SymbolCallback"

   A callback that executes when the named symbol is discovered in the
   objfile and returns the "gdb.Value" associated with the
   "gdb.Symbol".

   The callback must accept a "gdb.Value" and return "bool" or "None".

   See "SymbolCallback" for arguments.

   check_ready() -> Value | None

      After successfully looking up the "gdb.Symbol", returns the
      "gdb.Value" associated with it.

      Returns:
         The value associated with the requested symbol

      Return type:
         "gdb.Value"

class crash.infra.lookup.TypeCallback(name: str, callback: Callable[[Any], bool | None], wait_for_target: bool = True, block: Block = None, **kwargs: Any)

   Bases: "NamedCallback"

   A callback that executes when the named type is discovered in the
   objfile and returns the "gdb.Type" associated with it.

   The callback must accept a "gdb.Type" and return "bool" or "None".

   Parameters:
      * **name** -- The name of the type to discover

      * **callback** -- The callback to execute when the type is
        discovered

      * **block** (*optional*) -- The "gdb.Block" to search for the
        symbol

   check_ready() -> Type | None

      The method that derived classes implement for detecting when the
      conditions required to call the callback have been met.

      Returns:
         This method can return an arbitrary object.  It will be
         passed untouched to "callback()" if the result is anything
         other than "None" or "False".

      Return type:
         "object"

   static resolve_type(name: str) -> Tuple[str, str, bool]

      This function takes a C type name and translates it into a
      3-tuple that contains the basic type name, the type name
      translated to a form suitable for an attribute name, and whether
      the type corresponds to a pointer.

      The basic type name has all leading and trailing whitespace
      stripped, and any "*" removed.

      The attribute type name takes that base, removes the leading
      "struct" for structure types, removes any leading or trailing
      whitespace, replaces internal spaces with underscores, and
      appends a "_type" or "_p_type" suffix, depending on whether the
      type is a pointer type.

      Some examples:

      * "struct foo" → "foo_type"

      * "struct foo *" → "foo_p_type"

      * "unsigned long" → "unsigned_long_type"

      *Notes*:
         * Multiple levels of pointers are not handled properly.  In
              practice this means that "struct foo *" and "struct foo
              **" can't be used simultaneously.  This is typically not
              a problem.

         * Unions are not handled as a special case as structs are.  A
              union type would use an attribute name of
              "union_foo_type".

      Returns:
         A 3-tuple consisting of the basic type name, the name
         formatted for use as an attribute name, and whether the type
         is a pointer type.

      Return type:
         ("str", "str", "bool")
