Skip to content

MachoBuf

Description

Borrowed handle to the parser’s owned byte buffer. Cross-namespace readers (MachoCache’s DWARF builder, …) need section bytes off the loaded file; this is the public seam they go through instead of reaching at self->data directly.

Usage example (Cross-references)

Usage examples (Cross-references)
        const MachoSection *str_sec    = MachoFindSection(&e->dsym, "__DWARF", "__debug_str");
    
        const u8 *info_b   = info_sec ? BufData(MachoBuf(&e->dsym)) + info_sec->offset : NULL;
        u64       info_n   = info_sec ? info_sec->size : 0;
        const u8 *abbrev_b = abbrev_sec ? BufData(MachoBuf(&e->dsym)) + abbrev_sec->offset : NULL;
        const u8 *info_b   = info_sec ? BufData(MachoBuf(&e->dsym)) + info_sec->offset : NULL;
        u64       info_n   = info_sec ? info_sec->size : 0;
        const u8 *abbrev_b = abbrev_sec ? BufData(MachoBuf(&e->dsym)) + abbrev_sec->offset : NULL;
        u64       abbrev_n = abbrev_sec ? abbrev_sec->size : 0;
        const u8 *str_b    = str_sec ? BufData(MachoBuf(&e->dsym)) + str_sec->offset : NULL;
        const u8 *abbrev_b = abbrev_sec ? BufData(MachoBuf(&e->dsym)) + abbrev_sec->offset : NULL;
        u64       abbrev_n = abbrev_sec ? abbrev_sec->size : 0;
        const u8 *str_b    = str_sec ? BufData(MachoBuf(&e->dsym)) + str_sec->offset : NULL;
        u64       str_n    = str_sec ? str_sec->size : 0;
Last updated on