SymbolResolverInit
Description
Initialize a SymbolResolver for the current process. Loads /proc/self/maps once at create time. New ELF files are opened lazily on demand and cached for the resolver’s lifetime.
Parameters
| Name | Direction | Description |
|---|---|---|
out |
out | Populated on success. |
alloc |
in | Allocator backing the ProcMaps, the cache, and any opened ELF files. Must outlive the resolver. |
Success
Returns true.
Failure
Returns false if /proc/self/maps can’t be loaded. out is left zeroed.
Usage example (Cross-references)
Usage examples (Cross-references)
bool symbol_resolver_init(SymbolResolver *out, Allocator *alloc) {
if (!out || !alloc) {
LOG_FATAL("SymbolResolverInit: NULL argument");
}
MemSet(out, 0, sizeof(*out));- In
Backtrace.c:495:
static void format_walk_alloc(Str *out, const StackFrame *frames, size count, Allocator *alloc) {
SymbolResolver res;
if (!SymbolResolverInit(&res, alloc)) {
for (size i = 0; i < count; ++i) {
StrAppendFmt(out, " #{} {x}\n", (u32)i, (u64)frames[i].ip);
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc)))
return false; DefaultAllocator alloc = DefaultAllocatorInit();
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DefaultAllocatorDeinit(&alloc);
return false; DefaultAllocator alloc = DefaultAllocatorInit();
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DefaultAllocatorDeinit(&alloc);
return false; DefaultAllocator alloc = DefaultAllocatorInit();
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DefaultAllocatorDeinit(&alloc);
return false; DefaultAllocator alloc = DefaultAllocatorInit();
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DefaultAllocatorDeinit(&alloc);
return false; DefaultAllocator alloc = DefaultAllocatorInit();
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DefaultAllocatorDeinit(&alloc);
return false; DefaultAllocator alloc = DefaultAllocatorInit();
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DefaultAllocatorDeinit(&alloc);
return false; DefaultAllocator alloc = DefaultAllocatorInit();
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DefaultAllocatorDeinit(&alloc);
return false; DefaultAllocator alloc = DefaultAllocatorInit();
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DefaultAllocatorDeinit(&alloc);
return false; DefaultAllocator alloc = DefaultAllocatorInit();
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DefaultAllocatorDeinit(&alloc);
return false; SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DefaultAllocatorDeinit(&alloc);
return false; SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DefaultAllocatorDeinit(&alloc);
return false; DebugAllocator alloc = DebugAllocatorInit();
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DebugAllocatorDeinit(&alloc);
return false; DebugAllocator alloc = DebugAllocatorInit();
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DebugAllocatorDeinit(&alloc);
return false; DebugAllocator alloc = DebugAllocatorInit();
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DebugAllocatorDeinit(&alloc);
return false; DebugAllocator alloc = DebugAllocatorInit();
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DebugAllocatorDeinit(&alloc);
return false;
SymbolResolver res;
if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
DebugAllocatorDeinit(&alloc);
return false;- In
Backtrace.c:99:
SymbolResolver res;
if (!SymbolResolverInit(&res, alloc_base)) {
DefaultAllocatorDeinit(&alloc);
return false;- In
Backtrace.c:139:
SymbolResolver res;
if (!SymbolResolverInit(&res, alloc_base)) {
DefaultAllocatorDeinit(&alloc);
return false;- In
Backtrace.c:190:
SymbolResolver res;
if (!SymbolResolverInit(&res, alloc_base)) {
DefaultAllocatorDeinit(&alloc);
return false; // (1) Find this process's load base for /proc/self/exe.
SymbolResolver res;
if (!SymbolResolverInit(&res, base)) {
DefaultAllocatorDeinit(&alloc);
return false;- In
Dwarf.c:48:
SymbolResolver res;
if (!SymbolResolverInit(&res, base)) {
DefaultAllocatorDeinit(&alloc);
return false;- In
Dwarf.c:94:
SymbolResolver res;
if (!SymbolResolverInit(&res, base)) {
DefaultAllocatorDeinit(&alloc);
return false;- In
Dwarf.c:157:
SymbolResolver res;
if (!SymbolResolverInit(&res, base)) {
DefaultAllocatorDeinit(&alloc);
return false;
Last updated on