Eric Pouech : dbghelp: Report in module's info when a module' s debug information has been mismatched (dbg and pdb only).

Alexandre Julliard julliard at winehq.org
Mon Oct 20 08:01:00 CDT 2008


Module: wine
Branch: master
Commit: 01e69c71e07b6c2b1576f479d6f06f03dd18df71
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=01e69c71e07b6c2b1576f479d6f06f03dd18df71

Author: Eric Pouech <eric.pouech at orange.fr>
Date:   Sat Oct 18 09:15:03 2008 +0200

dbghelp: Report in module's info when a module's debug information has been mismatched (dbg and pdb only).

---

 dlls/dbghelp/dbghelp_private.h |    3 ++-
 dlls/dbghelp/msc.c             |    9 +++++----
 dlls/dbghelp/path.c            |    5 ++++-
 dlls/dbghelp/pe_module.c       |    2 +-
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h
index 26c3a3d..3eb420e 100644
--- a/dlls/dbghelp/dbghelp_private.h
+++ b/dlls/dbghelp/dbghelp_private.h
@@ -476,7 +476,8 @@ extern BOOL         pdb_fetch_file_info(struct pdb_lookup* pdb_lookup);
 
 /* path.c */
 extern BOOL         path_find_symbol_file(const struct process* pcs, PCSTR full_path,
-                                          const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer);
+                                          const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer,
+                                          BOOL* is_unmatched);
 
 /* pe_module.c */
 extern BOOL         pe_load_nt_header(HANDLE hProc, DWORD base, IMAGE_NT_HEADERS* nth);
diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c
index 1f5058a..2f62fec 100644
--- a/dlls/dbghelp/msc.c
+++ b/dlls/dbghelp/msc.c
@@ -2134,7 +2134,8 @@ static void pdb_convert_symbol_file(const PDB_SYMBOLS* symbols,
 }
 
 static HANDLE open_pdb_file(const struct process* pcs,
-                            const struct pdb_lookup* lookup)
+                            const struct pdb_lookup* lookup,
+                            struct module* module)
 {
     HANDLE      h;
     char        dbg_file_path[MAX_PATH];
@@ -2144,11 +2145,11 @@ static HANDLE open_pdb_file(const struct process* pcs,
     {
     case PDB_JG:
         ret = path_find_symbol_file(pcs, lookup->filename, NULL, lookup->u.jg.timestamp,
-                                    lookup->age, dbg_file_path);
+                                    lookup->age, dbg_file_path, &module->module.PdbUnmatched);
         break;
     case PDB_DS:
         ret = path_find_symbol_file(pcs, lookup->filename, &lookup->u.ds.guid, 0,
-                                    lookup->age, dbg_file_path);
+                                    lookup->age, dbg_file_path, &module->module.PdbUnmatched);
         break;
     }
     if (!ret)
@@ -2403,7 +2404,7 @@ static BOOL pdb_process_internal(const struct process* pcs,
     TRACE("Processing PDB file %s\n", pdb_lookup->filename);
 
     /* Open and map() .PDB file */
-    if ((hFile = open_pdb_file(pcs, pdb_lookup)) == NULL ||
+    if ((hFile = open_pdb_file(pcs, pdb_lookup, msc_dbg->module)) == NULL ||
         ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) == NULL) ||
         ((image = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) == NULL))
     {
diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c
index 3ae4921..e0cfc97 100644
--- a/dlls/dbghelp/path.c
+++ b/dlls/dbghelp/path.c
@@ -612,7 +612,8 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
 }
 
 BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path,
-                           const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer)
+                           const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer,
+                           BOOL* is_unmatched)
 {
     struct module_find  mf;
     WCHAR               full_pathW[MAX_PATH];
@@ -632,6 +633,7 @@ BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path,
     MultiByteToWideChar(CP_ACP, 0, full_path, -1, full_pathW, MAX_PATH);
     filename = file_nameW(full_pathW);
     mf.kind = module_get_type_by_name(filename);
+    *is_unmatched = FALSE;
 
     /* first check full path to file */
     if (module_find_cb(full_pathW, &mf))
@@ -665,6 +667,7 @@ BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path,
     if ((dbghelp_options & SYMOPT_LOAD_ANYTHING) && mf.matched)
     {
         WideCharToMultiByte(CP_ACP, 0, mf.filename, -1, buffer, MAX_PATH, NULL, NULL);
+        *is_unmatched = TRUE;
         return TRUE;
     }
     return FALSE;
diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c
index 7b62529..a79396f 100644
--- a/dlls/dbghelp/pe_module.c
+++ b/dlls/dbghelp/pe_module.c
@@ -94,7 +94,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
 
     TRACE("Processing DBG file %s\n", debugstr_a(dbg_name));
 
-    if (path_find_symbol_file(pcs, dbg_name, NULL, timestamp, 0, tmp) &&
+    if (path_find_symbol_file(pcs, dbg_name, NULL, timestamp, 0, tmp, &module->module.DbgUnmatched) &&
         (hFile = CreateFileA(tmp, GENERIC_READ, FILE_SHARE_READ, NULL,
                              OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE &&
         ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != 0) &&




More information about the wine-cvs mailing list