From: Eric Pouech epouech@codeweavers.com
Always creating public symbols from export table can be slow.
If we already have some debug information, then exported symbols are likely already present.
In extreme cases, this can reduce significantly loading time of module.
Note: in some (rare) cases, this will change current behavior: - if symbol has no debug inforamtion attached to it (assembly...), then no name will be available for it, - if exported symbol name is different from internal one, then only the internal one will be reported.
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/pe_module.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index 6b5a9a4b425..948708ac5a3 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -477,7 +477,7 @@ static BOOL pe_load_coff_symbol_table(struct module* module)
numsym = fmap->u.pe.file_header.NumberOfSymbols; if (!fmap->u.pe.file_header.PointerToSymbolTable || !numsym) - return TRUE; + return FALSE; if (!(mapping = pe_map_full(fmap, NULL))) return FALSE; isym = (const IMAGE_SYMBOL*)(mapping + fmap->u.pe.file_header.PointerToSymbolTable); /* FIXME: no way to get strtable size */ @@ -779,9 +779,11 @@ BOOL pe_load_debug_info(const struct process* pcs, struct module* module) * in which case we'll rely on the export's on the ELF side */ } - /* FIXME shouldn't we check that? if (!module_get_debug(pcs, module)) */ - if (pe_load_export_debug_info(pcs, module) && !ret) - ret = TRUE; + /* FIXME: + * - only loading export debug info in last resort when none of available format succeeded + * (assuming export debug info is a subset of actual debug infomation). + */ + if (!ret) ret = pe_load_export_debug_info(pcs, module); if (!ret) module->module.SymType = SymNone; return ret; }