Skip to content
DwarfFunctionsBuildFromSlices

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).

Usage example (Cross-references)

Usage examples (Cross-references)
        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;
    }
    // ---------------------------------------------------------------------------
    
    bool DwarfFunctionsBuildFromSlices(
        DwarfFunctions *out,
        const u8       *info_bytes,
    ) {
        if (!out || !alloc) {
            LOG_ERROR("DwarfFunctionsBuildFromSlices: NULL argument");
            return false;
        }
        const u8 *str_b    = str_sec ? elf->data + 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);
    }
Last updated on