Skip to content
DwarfFunctionsResolve

DwarfFunctionsResolve

Description

Find the function whose [low_pc, high_pc) range contains vaddr (file-relative).

Success

Returns a pointer to the matching entry. Valid until DwarfFunctionsDeinit.

Failure

Returns NULL when no entry covers vaddr.

Usage example (Cross-references)

Usage examples (Cross-references)
        bool           ok    = false;
        if (built && fns.entries.length > 0) {
            const DwarfFunction *f = DwarfFunctionsResolve(&fns, file_relative);
            ok                     = f && f->name && ZstrFindSubstring(f->name, expect_name) != NULL;
            DwarfFunctionsDeinit(&fns);
        bool           ok    = false;
        if (built && fns.entries.length > 0) {
            const DwarfFunction *f = DwarfFunctionsResolve(&fns, file_relative);
            ok = f != NULL && f->name != NULL && ZstrFindSubstring(f->name, "dwarf_marker_helper") != NULL;
            DwarfFunctionsDeinit(&fns);
            // (3) dSYM's DWARF .debug_info function table.
            if (entry_build_dwarf(entry, self->allocator)) {
                const DwarfFunction *f = DwarfFunctionsResolve(&entry->fns, file_relative);
                if (f && f->name) {
                    *out_name = f->name;
            const DwarfFunction *f = NULL;
            if (cache_entry->functions_ok) {
                f = DwarfFunctionsResolve(&cache_entry->functions, file_relative);
            }
            if (!f && cache_entry->has_sidecar) {
                }
                if (cache_entry->sidecar_functions_ok) {
                    f = DwarfFunctionsResolve(&cache_entry->sidecar_functions, file_relative);
                }
            }
    }
    
    const DwarfFunction *DwarfFunctionsResolve(const DwarfFunctions *self, u64 vaddr) {
        if (!self || self->entries.length == 0)
            return NULL;
Last updated on