Skip to content

PdbCacheInit

Description

Initialize an empty cache. The allocator argument is optional inside a Scope block (defaults to MisraScope).

Success

Yields a PdbCache whose entries Vec is empty and ready for Resolve.

Failure

Cannot fail at construction; first allocator OOM surfaces from later entries growth.

Usage example (Cross-references)

Usage examples (Cross-references)
    #    if FEATURE_PARSER_PDB
        bool     pdb_cache_ok = (alloc != NULL);
        PdbCache pdb_cache    = pdb_cache_ok ? PdbCacheInit(alloc) : (PdbCache) {0};
    #    else
        (void)alloc;
        }
    
        PdbCache cache = PdbCacheInit(base);
    
        // module_base = 0x140000000 -> RVA = (ip - base). For func at
        tmp_path_join(missing, sizeof(missing), "misra_pdbcache_missing_xyz.exe");
    
        PdbCache cache = PdbCacheInit(base);
        Zstr     name  = NULL;
        bool     ok    = !PdbCacheResolve(&cache, (Zstr)missing, 0, 0x1000, &name, NULL);
        bool ok = false;
        if (wrote) {
            PdbCache  cache = PdbCacheInit(base);
            const u64 mbase = 0x140000000ull;
            Zstr      name  = NULL;
        bool ok = false;
        if (wrote) {
            PdbCache cache = PdbCacheInit(base);
            Zstr     name  = NULL;
            // PE opens, PDB lookup fails -> resolve returns false.
        bool ok = false;
        if (wrote) {
            PdbCache cache = PdbCacheInit(base);
            Zstr     name  = NULL;
            // PDB opens but GUID/age disagree -> resolve rejects it.
        bool ok = false;
        if (wrote) {
            PdbCache  cache = PdbCacheInit(base);
            const u64 mbase = 0x140000000ull;
            Zstr      name  = NULL;
        bool ok = false;
        if (wrote) {
            PdbCache  cache = PdbCacheInit(base);
            const u64 mbase = 0x140000000ull;
            Zstr      name  = NULL;
        bool ok = false;
        if (wrote) {
            PdbCache  cache = PdbCacheInit(base);
            const u64 mbase = 0x140000000ull;
            Zstr      name  = NULL;
        bool ok = false;
        if (wrote) {
            PdbCache  cache = PdbCacheInit(base);
            const u64 mbase = 0x140000000ull;
            Zstr      name  = NULL;
        bool ok = false;
        if (wrote) {
            PdbCache  cache = PdbCacheInit(base);
            const u64 mbase = 0x140000000ull;
            StrInitStack(mod, 1100) {
        bool ok = false;
        if (wrote) {
            PdbCache  cache = PdbCacheInit(base);
            const u64 mbase = 0x140000000ull;
            Zstr      name  = NULL;
        bool ok = false;
        if (wrote) {
            PdbCache cache = PdbCacheInit(a);
            Zstr     name  = NULL;
            ok             = !PdbCacheResolve(&cache, (Zstr)pe_path, 0x140000000ull, 0x140001100ull, &name, NULL);
        bool ok = false;
        if (wrote) {
            PdbCache  cache = PdbCacheInit(base);
            const u64 mbase = 0x140000000ull;
            Zstr      na    = NULL;
        bool ok = false;
        if (wrote) {
            PdbCache  cache = PdbCacheInit(base);
            const u64 mbase = 0x140000000ull;
            Zstr      name  = NULL;
            return false;             // precondition: the targeting needs a single slot
    
        PdbCache cache = PdbCacheInit(&bp);
        Zstr     name  = NULL;
        if (PdbCacheResolve(&cache, (char *)"/x", 0, 0x1000, &name, NULL))
Last updated on