Eric Pouech : dbghelp: Ensure we can try to load COFF symbols if none is found in other debug formats .

Alexandre Julliard julliard at winehq.org
Mon Jun 28 11:01:17 CDT 2010


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

Author: Eric Pouech <eric.pouech at orange.fr>
Date:   Sat Jun 26 22:54:07 2010 +0200

dbghelp: Ensure we can try to load COFF symbols if none is found in other debug formats.

---

 dlls/dbghelp/dwarf.c     |    7 +++----
 dlls/dbghelp/pe_module.c |    4 ++--
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index 6daf7d7..4d7ec0d 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -3077,10 +3077,9 @@ BOOL dwarf2_parse(struct module* module, unsigned long load_offset,
     struct module_format* dwarf2_modfmt;
 
     if (!dwarf2_init_section(&section[section_debug],  fmap, ".debug_info", &debug_sect))
-    {
-        /* no Dwarf debug info here, so there's no error */
-        return TRUE;
-    }
+        /* no Dwarf debug info here */
+        return FALSE;
+
     dwarf2_init_section(&section[section_abbrev], fmap, ".debug_abbrev", &debug_abbrev_sect);
     dwarf2_init_section(&section[section_string], fmap, ".debug_str",    &debug_str_sect);
     dwarf2_init_section(&section[section_line],   fmap, ".debug_line",   &debug_line_sect);
diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c
index a46193c..18cec9a 100644
--- a/dlls/dbghelp/pe_module.c
+++ b/dlls/dbghelp/pe_module.c
@@ -183,8 +183,8 @@ static BOOL pe_is_valid_pointer_table(const IMAGE_NT_HEADERS* nthdr, const void*
 
     /* is the iSym table inside file size ? (including first DWORD of string table, which is its size) */
     offset = (DWORD64)nthdr->FileHeader.PointerToSymbolTable;
-    offset += (DWORD64)nthdr->FileHeader.NumberOfSymbols * sizeof(IMAGE_SYMBOL) + sizeof(DWORD);
-    if (offset > sz) return FALSE;
+    offset += (DWORD64)nthdr->FileHeader.NumberOfSymbols * sizeof(IMAGE_SYMBOL);
+    if (offset + sizeof(DWORD) > sz) return FALSE;
     /* is string table (following iSym table) inside file size ? */
     offset += *(DWORD*)((const char*)mapping + offset);
     return offset <= sz;




More information about the wine-cvs mailing list