Skip to content

PdbOpen

Description

Open and parse a PDB from disk.

Success

Returns true; parser owns the read-in buffer.

Failure

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

Usage example (Cross-references)

Usage examples (Cross-references)
            return false;
        }
        bool ok = PdbOpen(&entry->pdb, &pdb_path, alloc);
        StrDeinit(&pdb_path);
        if (!ok)
    bool pdb_open(Pdb *out, Zstr path, Allocator *alloc) {
        if (!out || !path || !alloc) {
            LOG_FATAL("PdbOpen: NULL argument (contract violation)");
        }
        Buf data = BufInit(alloc);
        if (FileReadAndClose(path, &data) < 0) {
            BufDeinit(&data);
            LOG_ERROR("PdbOpen: failed to read {}", path);
            return false;
        }
    
        Pdb  pdb;
        bool ok = PdbOpen(&pdb, X_TMP_VALID, base);
        if (ok) {
            ok = VecLen(&pdb.functions) == 2 && pdb.info.signature == 0xfeedface;
    
        Pdb  pdb;
        bool ok = !PdbOpen(&pdb, X_TMP_JUNK, base);
    
        DefaultAllocatorDeinit(&alloc);
Last updated on