DwarfFunctions
Description
Function-name index built from .debug_info + .debug_abbrev (+ .debug_str for indirect names). Entries are sorted by low_pc to allow a binary-search lookup.
Fields
| Name | Description |
|---|---|
allocator |
Allocator backing entries + string_pool. |
entries |
Sorted-by-low_pc list of DwarfFunction rows. |
string_pool |
Owned buffer holding function-name strings that entries.name borrows from. We copy because DWARF strings can come from either inline byte-strings or the separately-located .debug_str section. |
Usage example (Cross-references)
Usage examples (Cross-references)
// (4) DwarfFunctions on the stripped copy MUST find the name.
DwarfFunctions fns;
bool built = DwarfFunctionsBuildFromElf(&fns, &stripped, base);
bool ok = false;- In
Dwarf.c:169:
}
DwarfFunctions fns;
bool built = DwarfFunctionsBuildFromElf(&fns, &elf, base);
bool ok = false;- In
DwarfInfo.c:573:
bool DwarfFunctionsBuildFromSlices(
DwarfFunctions *out,
const u8 *info_bytes,
u64 info_size,- In
DwarfInfo.c:705:
}
bool DwarfFunctionsBuildFromElf(DwarfFunctions *out, const ElfFile *elf, Allocator *alloc) {
if (!out || !elf || !alloc) {
LOG_ERROR("DwarfFunctionsBuildFromElf: NULL argument");- In
DwarfInfo.c:723:
}
const DwarfFunction *DwarfFunctionsResolve(const DwarfFunctions *self, u64 vaddr) {
if (!self || self->entries.length == 0)
return NULL;- In
DwarfInfo.c:743:
}
void DwarfFunctionsDeinit(DwarfFunctions *self) {
if (!self)
return;- In
MachoCache.h:37:
MachoFile dsym;
bool dsym_open;
DwarfFunctions fns;
bool fns_built;
bool fns_ok; // when .symtab and .dynsym yield no name. Built for both main and
// sidecar if either lookup misses.
DwarfFunctions functions;
bool functions_built;
bool functions_ok; bool functions_built;
bool functions_ok;
DwarfFunctions sidecar_functions;
bool sidecar_functions_built;
bool sidecar_functions_ok;- In
Dwarf.h:314:
DwarfFunctionEntries entries;
Str string_pool;
} DwarfFunctions;
///
- In
Dwarf.h:330:
/// TAGS: Parser, DWARF, Info
///
bool DwarfFunctionsBuildFromElf(DwarfFunctions *out, const ElfFile *elf, Allocator *alloc);
///
- In
Dwarf.h:344:
///
bool DwarfFunctionsBuildFromSlices(
DwarfFunctions *out,
const u8 *info_bytes,
u64 info_size,- In
Dwarf.h:364:
/// TAGS: Parser, DWARF, Lookup
///
const DwarfFunction *DwarfFunctionsResolve(const DwarfFunctions *self, u64 vaddr);
void DwarfFunctionsDeinit(DwarfFunctions *self);- In
Dwarf.h:366:
const DwarfFunction *DwarfFunctionsResolve(const DwarfFunctions *self, u64 vaddr);
void DwarfFunctionsDeinit(DwarfFunctions *self);
#endif // MISRA_PARSERS_DWARF_H
Last updated on