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)
- In
Dwarf.c:47:
SymbolResolver res;
if (!SymbolResolverInit(&res, base)) {
DefaultAllocatorDeinit(&alloc);
return false;- In
Backtrace.c:51:
SymbolResolver res;
if (!SymbolResolverInit(&res, alloc_base)) {
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;- In
Backtrace.c:213:
return;
SymbolResolver res;
if (!SymbolResolverInit(&res, alloc)) {
// Fall back to plain IP dump.
for (size i = 0; i < count; ++i) { // ---------------------------------------------------------------------------
bool SymbolResolverInit(SymbolResolver *out, Allocator *alloc) {
if (!out || !alloc) {
LOG_ERROR("SymbolResolverInit: NULL argument"); bool SymbolResolverInit(SymbolResolver *out, Allocator *alloc) {
if (!out || !alloc) {
LOG_ERROR("SymbolResolverInit: NULL argument");
return false;
}
Last updated on