DwarfFunctionsBuildFromSlices
Description
Container-agnostic builder. Same parser, but takes the three section payloads directly. The Mach-O backtrace path uses this to feed bytes from __DWARF,__debug_* sections inside a dSYM bundle.
Any of info_bytes / abbrev_bytes / str_bytes may be NULL when the corresponding section is absent; an empty info_bytes is treated as “no debug info” (success with empty table).
Success
Returns true. *out is populated; empty when there is no .debug_info to parse.
Failure
Returns false on allocator OOM or malformed DWARF. *out is left in the partial state it had reached; caller should DwarfFunctionsDeinit to release it.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
MachoCache.c:122:
u64 str_n = str_sec ? str_sec->size : 0;
e->fns_ok = DwarfFunctionsBuildFromSlices(&e->fns, info_b, info_n, abbrev_b, abbrev_n, str_b, str_n, alloc);
return e->fns_ok;
}- In
DwarfInfo.c:510:
// ---------------------------------------------------------------------------
bool DwarfFunctionsBuildFromSlices(
DwarfFunctions *out,
const u8 *info_bytes,- In
DwarfInfo.c:521:
) {
if (!out || !alloc) {
LOG_FATAL("DwarfFunctionsBuildFromSlices: NULL argument");
}
MemSet(out, 0, sizeof(*out));- In
DwarfInfo.c:655:
const u8 *str_b = str_sec ? BufData(ElfBuf(elf)) + str_sec->offset : NULL;
u64 str_n = str_sec ? str_sec->size : 0;
return DwarfFunctionsBuildFromSlices(out, info_b, info_n, abbrev_b, abbrev_n, str_b, str_n, alloc);
}- In
Dwarf.c:284:
DwarfFunctions fns;
bool built = DwarfFunctionsBuildFromSlices(&fns, info, info_len, kAbbrev, sizeof(kAbbrev), NULL, 0, base);
bool ok = built && VecLen(&fns.entries) == 1;- In
Dwarf.c:316:
DwarfFunctions fns;
bool built = DwarfFunctionsBuildFromSlices(&fns, info, sizeof(info), kAbbrev, sizeof(kAbbrev), NULL, 0, base);
bool ok = !built; // rejected
- In
Dwarf.c:335:
DwarfFunctions fns;
bool built = DwarfFunctionsBuildFromSlices(&fns, info, info_len, NULL, 0, NULL, 0, base);
bool ok = !built;- In
Dwarf.c:357:
DwarfFunctions fns;
bool built = DwarfFunctionsBuildFromSlices(&fns, info, info_len, kAbbrev, sizeof(kAbbrev), NULL, 0, base);
bool ok = !built;- In
Dwarf.c:376:
DwarfFunctions fns;
bool built = DwarfFunctionsBuildFromSlices(&fns, info, info_len, kAbbrev, sizeof(kAbbrev), NULL, 0, base);
bool ok = !built;- In
Dwarf.c:392:
DwarfFunctions fns;
bool built = DwarfFunctionsBuildFromSlices(&fns, NULL, 0, NULL, 0, NULL, 0, base);
bool ok = built && VecLen(&fns.entries) == 0 && DwarfFunctionsResolve(&fns, 0x4000) == NULL;
Last updated on