Skip to content

symbol ¤

Looking up addresses for function names / symbols, and vice-versa.

Functions:

lookup_symbol_addr ¤

lookup_symbol_addr(
    name: str,
    *,
    prefer_static: bool = False,
    type: SymbolLookupType = ANY,
    objfile_endswith: str | None = None,
) -> int | None

lookup_symbol_value ¤

lookup_symbol_value(
    name: str,
    *,
    prefer_static: bool = False,
    type: SymbolLookupType = ANY,
    objfile_endswith: str | None = None,
) -> int | None

lookup_symbol ¤

lookup_symbol(
    name: str,
    *,
    prefer_static: bool = False,
    type: SymbolLookupType = ANY,
    objfile_endswith: str | None = None,
) -> Value | None

Returns the address of the given symbol, cast-ed to the appropriate symbol type.

This function searches for (SymbolLookupType.ANY): - Function names - Variable names - (gdb only) Typedef names (if you need please use aglib.typeinfo.load) - (gdb only) Enum values (if you need please use aglib.typeinfo.enum_member)

The lookup order is as follows (default): 1. Global scope within the current module 2. Global static scope within the current module 3. Global scope in other modules 4. Global static scope in other modules

lookup_frame_symbol ¤

lookup_frame_symbol(name: str, *, type: SymbolLookupType = ANY) -> Value | None

Returns the address of the given symbol, cast-ed to the appropriate symbol type.

This function searches for (SymbolLookupType.ANY): - Function names - Variable names - (gdb only, please don't use) Typedef names - (gdb only, please don't use) Enum values

The lookup order is as follows: 1. Local scope 2. Global scope within the current module 3. Global static scope within the current module 4. Global scope in other modules 5. Global static scope in other modules

resolve_addr ¤

resolve_addr(addr: int) -> str | None

Resolves an address to its corresponding symbol name, if available.

Note: - This function does not resolve TLS (Thread-Local Storage) addresses or addresses with local scope.

Resolution is performed in the following order: - Global scope symbols.