Skip to content
DwarfCfiBuildFromElf

DwarfCfiBuildFromElf

Description

Parse the .eh_frame section of an already-opened ElfFile.

Parameters

Name Direction Description
out out Populated on success.
elf in ELF file to read from. Borrowed.
alloc in Allocator backing the CIE / FDE vectors.

Success

Returns true. out->fdes.length may be 0 if the binary lacks a .eh_frame section (very unusual on modern Linux).

Failure

Returns false; logs the failing step. out is left zeroed.

Usage example (Cross-references)

Usage examples (Cross-references)
    
        DwarfCfi cfi;
        bool     built = DwarfCfiBuildFromElf(&cfi, &elf, base);
        bool     ok    = false;
        if (built) {
        if (!cache_entry->cfi_built) {
            cache_entry->cfi_built = true;
            cache_entry->cfi_ok    = DwarfCfiBuildFromElf(&cache_entry->cfi, &cache_entry->elf, self->allocator);
        }
        if (!cache_entry->cfi_ok)
    // ---------------------------------------------------------------------------
    
    bool DwarfCfiBuildFromElf(DwarfCfi *out, const ElfFile *elf, Allocator *alloc) {
        if (!out || !elf || !alloc) {
            LOG_ERROR("DwarfCfiBuildFromElf: NULL argument");
    bool DwarfCfiBuildFromElf(DwarfCfi *out, const ElfFile *elf, Allocator *alloc) {
        if (!out || !elf || !alloc) {
            LOG_ERROR("DwarfCfiBuildFromElf: NULL argument");
            return false;
        }
Last updated on