From 0e3dba2a7ae7de844908647907eeefa0ca64b67c Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Sat, 24 Feb 2024 09:19:38 +0100 Subject: [PATCH] dbghelp: Relax failure conditions. dbghelp tests build PDB files, without hash table in TPI stream, but also no types. Native is able to load these PDB files. So, don't fail when loading a PDB without a TPI hash table and without any types. Signed-off-by: Eric Pouech --- dlls/dbghelp/msc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 4d310cd0f21..aeaa55cc713 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -3351,12 +3351,14 @@ static BOOL pdb_init_type_parse(const struct msc_debug_info* msc_dbg, ERR("-Unsupported hash of size %u\n", ctp->header.hash_value_size); return FALSE; } - ctp->hash_stream = pdb_read_stream(pdb_file, ctp->header.hash_stream); - /* FIXME always present? if not reconstruct ?*/ - if (!ctp->hash_stream) + if (!(ctp->hash_stream = pdb_read_stream(pdb_file, ctp->header.hash_stream))) { - ERR("-Missing hash table in PDB file\n"); - return FALSE; + if (ctp->header.last_index > ctp->header.first_index) + { + /* may be reconstruct hash table ? */ + FIXME("-No hash table, while types exist\n"); + return FALSE; + } } ctp->module = msc_dbg->module; @@ -3388,7 +3390,7 @@ static BOOL pdb_init_type_parse(const struct msc_debug_info* msc_dbg, /* parse the remap table * => move listed type_id at first position of their hash buckets so that we force remap to them */ - if (ctp->header.type_remap_size) + if (ctp->hash_stream && ctp->header.type_remap_size) { const unsigned* remap = (const unsigned*)((const BYTE*)ctp->hash_stream + ctp->header.type_remap_offset); unsigned i, capa, count_present;