dbghelp: Ensure we can try to load COFF symbols if none is found in other debug formats.
This commit is contained in:
parent
d97e6a47e5
commit
3ced7b8f40
|
@ -3077,10 +3077,9 @@ BOOL dwarf2_parse(struct module* module, unsigned long load_offset,
|
||||||
struct module_format* dwarf2_modfmt;
|
struct module_format* dwarf2_modfmt;
|
||||||
|
|
||||||
if (!dwarf2_init_section(§ion[section_debug], fmap, ".debug_info", &debug_sect))
|
if (!dwarf2_init_section(§ion[section_debug], fmap, ".debug_info", &debug_sect))
|
||||||
{
|
/* no Dwarf debug info here */
|
||||||
/* no Dwarf debug info here, so there's no error */
|
return FALSE;
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
dwarf2_init_section(§ion[section_abbrev], fmap, ".debug_abbrev", &debug_abbrev_sect);
|
dwarf2_init_section(§ion[section_abbrev], fmap, ".debug_abbrev", &debug_abbrev_sect);
|
||||||
dwarf2_init_section(§ion[section_string], fmap, ".debug_str", &debug_str_sect);
|
dwarf2_init_section(§ion[section_string], fmap, ".debug_str", &debug_str_sect);
|
||||||
dwarf2_init_section(§ion[section_line], fmap, ".debug_line", &debug_line_sect);
|
dwarf2_init_section(§ion[section_line], fmap, ".debug_line", &debug_line_sect);
|
||||||
|
|
|
@ -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) */
|
/* 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.PointerToSymbolTable;
|
||||||
offset += (DWORD64)nthdr->FileHeader.NumberOfSymbols * sizeof(IMAGE_SYMBOL) + sizeof(DWORD);
|
offset += (DWORD64)nthdr->FileHeader.NumberOfSymbols * sizeof(IMAGE_SYMBOL);
|
||||||
if (offset > sz) return FALSE;
|
if (offset + sizeof(DWORD) > sz) return FALSE;
|
||||||
/* is string table (following iSym table) inside file size ? */
|
/* is string table (following iSym table) inside file size ? */
|
||||||
offset += *(DWORD*)((const char*)mapping + offset);
|
offset += *(DWORD*)((const char*)mapping + offset);
|
||||||
return offset <= sz;
|
return offset <= sz;
|
||||||
|
|
Loading…
Reference in New Issue