Commit 1acbb1c0 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

dbghelp: Restructure internal PDB information.

parent 982775dd
......@@ -427,21 +427,10 @@ enum pdb_kind {PDB_JG, PDB_DS};
struct pdb_lookup
{
const char* filename;
DWORD age;
enum pdb_kind kind;
union
{
struct
{
DWORD timestamp;
struct PDB_JG_TOC* toc;
} jg;
struct
{
GUID guid;
struct PDB_DS_TOC* toc;
} ds;
} u;
DWORD age;
DWORD timestamp;
GUID guid;
};
struct cpu_stack_walk
......@@ -567,7 +556,7 @@ extern BOOL pe_load_debug_directory(const struct process* pcs,
const BYTE* mapping,
const IMAGE_SECTION_HEADER* sectp, DWORD nsect,
const IMAGE_DEBUG_DIRECTORY* dbg, int nDbg);
extern BOOL pdb_fetch_file_info(struct pdb_lookup* pdb_lookup);
extern BOOL pdb_fetch_file_info(const struct pdb_lookup* pdb_lookup, unsigned* matched);
/* path.c */
extern BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path,
......
......@@ -539,46 +539,27 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
break;
case DMT_PDB:
{
struct pdb_lookup pdb_lookup;
char fn[MAX_PATH];
struct pdb_lookup pdb_lookup;
char fn[MAX_PATH];
WideCharToMultiByte(CP_ACP, 0, buffer, -1, fn, MAX_PATH, NULL, NULL);
pdb_lookup.filename = fn;
if (!pdb_fetch_file_info(&pdb_lookup)) return FALSE;
matched++;
switch (pdb_lookup.kind)
if (mf->guid)
{
case PDB_JG:
if (mf->guid)
{
WARN("Found %s, but wrong PDB version\n", debugstr_w(buffer));
}
else if (pdb_lookup.u.jg.timestamp == mf->dw1)
matched++;
else
WARN("Found %s, but wrong signature: %08x %08x\n",
debugstr_w(buffer), pdb_lookup.u.jg.timestamp, mf->dw1);
break;
case PDB_DS:
if (!mf->guid)
{
WARN("Found %s, but wrong PDB version\n", debugstr_w(buffer));
}
else if (!memcmp(&pdb_lookup.u.ds.guid, mf->guid, sizeof(GUID)))
matched++;
else
WARN("Found %s, but wrong GUID: %s %s\n",
debugstr_w(buffer), debugstr_guid(&pdb_lookup.u.ds.guid),
debugstr_guid(mf->guid));
break;
pdb_lookup.kind = PDB_DS;
pdb_lookup.timestamp = 0;
pdb_lookup.guid = *mf->guid;
}
if (pdb_lookup.age != mf->dw2)
else
{
matched--;
WARN("Found %s, but wrong age: %08x %08x\n",
debugstr_w(buffer), pdb_lookup.age, mf->dw2);
pdb_lookup.kind = PDB_JG;
pdb_lookup.timestamp = mf->dw1;
/* pdb_loopkup.guid = */
}
pdb_lookup.age = mf->dw2;
if (!pdb_fetch_file_info(&pdb_lookup, &matched)) return FALSE;
}
break;
case DMT_DBG:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment