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}; ...@@ -427,21 +427,10 @@ enum pdb_kind {PDB_JG, PDB_DS};
struct pdb_lookup struct pdb_lookup
{ {
const char* filename; const char* filename;
DWORD age;
enum pdb_kind kind; enum pdb_kind kind;
union DWORD age;
{ DWORD timestamp;
struct GUID guid;
{
DWORD timestamp;
struct PDB_JG_TOC* toc;
} jg;
struct
{
GUID guid;
struct PDB_DS_TOC* toc;
} ds;
} u;
}; };
struct cpu_stack_walk struct cpu_stack_walk
...@@ -567,7 +556,7 @@ extern BOOL pe_load_debug_directory(const struct process* pcs, ...@@ -567,7 +556,7 @@ extern BOOL pe_load_debug_directory(const struct process* pcs,
const BYTE* mapping, const BYTE* mapping,
const IMAGE_SECTION_HEADER* sectp, DWORD nsect, const IMAGE_SECTION_HEADER* sectp, DWORD nsect,
const IMAGE_DEBUG_DIRECTORY* dbg, int nDbg); 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 */ /* path.c */
extern BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path, 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) ...@@ -539,46 +539,27 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
break; break;
case DMT_PDB: case DMT_PDB:
{ {
struct pdb_lookup pdb_lookup; struct pdb_lookup pdb_lookup;
char fn[MAX_PATH]; char fn[MAX_PATH];
WideCharToMultiByte(CP_ACP, 0, buffer, -1, fn, MAX_PATH, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, buffer, -1, fn, MAX_PATH, NULL, NULL);
pdb_lookup.filename = fn; pdb_lookup.filename = fn;
if (!pdb_fetch_file_info(&pdb_lookup)) return FALSE; if (mf->guid)
matched++;
switch (pdb_lookup.kind)
{ {
case PDB_JG: pdb_lookup.kind = PDB_DS;
if (mf->guid) pdb_lookup.timestamp = 0;
{ pdb_lookup.guid = *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;
} }
if (pdb_lookup.age != mf->dw2) else
{ {
matched--; pdb_lookup.kind = PDB_JG;
WARN("Found %s, but wrong age: %08x %08x\n", pdb_lookup.timestamp = mf->dw1;
debugstr_w(buffer), pdb_lookup.age, mf->dw2); /* pdb_loopkup.guid = */
} }
pdb_lookup.age = mf->dw2;
if (!pdb_fetch_file_info(&pdb_lookup, &matched)) return FALSE;
} }
break; break;
case DMT_DBG: 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