Skip to content

Symbol

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

lookup_frame_symbol(name, *, type=SymbolLookupType.ANY)

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

lookup_symbol(name, *, prefer_static=False, type=SymbolLookupType.ANY, objfile_endswith=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_symbol_addr(name, *, prefer_static=False, type=SymbolLookupType.ANY, objfile_endswith=None)

lookup_symbol_value(name, *, prefer_static=False, type=SymbolLookupType.ANY, objfile_endswith=None)

resolve_addr(addr)

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.