Skip to content

PeCodeView

Description

Borrowed handle to the PE’s decoded CodeView debug record. Cross- namespace readers (PdbCache, …) inspect (guid, age, pdb_path) to locate the matching PDB; this is the public seam they go through instead of reaching at self->codeview directly.

Usage example (Cross-references)

Usage examples (Cross-references)
    // On success populates `out_path` (an owned Str the caller frees).
    static bool find_pdb(const Pe *pe, Zstr pe_path, Str *out_path) {
        const PeCodeViewInfo *cv = PeCodeView(pe);
        if (!cv->present || !cv->pdb_path)
            return false;
        // Validate the (GUID, age) pair matches. If the PE and PDB
        // disagree the names are probably stale -- worse than no symbols.
        const PeCodeViewInfo *pe_cv   = PeCodeView(&entry->pe);
        const PdbInfo        *pdb_inf = PdbInfoStream(&entry->pdb);
        if (pe_cv->age != pdb_inf->age || MemCompare(pe_cv->guid, pdb_inf->guid, 16) != 0) {
Last updated on