Module: wine Branch: master Commit: 3db11b98b706564dd821f95e9c1b3a7af29f636f URL: http://source.winehq.org/git/wine.git/?a=commit;h=3db11b98b706564dd821f95e9c...
Author: Ken Thomases ken@codeweavers.com Date: Wed Mar 11 09:05:49 2009 -0500
dbghelp: Let stabs_parse call back for real (non-debug) symbol definitions.
---
dlls/dbghelp/dbghelp_private.h | 7 ++++++- dlls/dbghelp/elf_module.c | 3 ++- dlls/dbghelp/pe_module.c | 3 ++- dlls/dbghelp/stabs.c | 17 ++++++++++++++++- 4 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 132a6b9..5d3f401 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -487,9 +487,14 @@ extern unsigned source_new(struct module* module, const char* basedir, const extern const char* source_get(const struct module* module, unsigned idx);
/* stabs.c */ +typedef void (*stabs_def_cb)(struct module* module, unsigned long load_offset, + const char* name, unsigned long offset, + BOOL is_public, BOOL is_global, unsigned char other, + struct symt_compiland* compiland, void* user); extern BOOL stabs_parse(struct module* module, unsigned long load_offset, const void* stabs, int stablen, - const char* strs, int strtablen); + const char* strs, int strtablen, + stabs_def_cb callback, void* user);
/* dwarf.c */ extern BOOL dwarf2_parse(struct module* module, unsigned long load_offset, diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index 820c972..3b6c7cc 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -1039,7 +1039,8 @@ static BOOL elf_load_debug_info_from_map(struct module* module, /* OK, now just parse all of the stabs. */ lret = stabs_parse(module, module->elf_info->elf_addr, stab, elf_get_map_size(&stab_sect), - stabstr, elf_get_map_size(&stabstr_sect)); + stabstr, elf_get_map_size(&stabstr_sect), + NULL, NULL); if (lret) /* and fill in the missing information for stabs */ elf_finish_stabs_info(module, ht_symtab); diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index 4e77790..91c7d80 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -72,7 +72,8 @@ static BOOL pe_load_stabs(const struct process* pcs, struct module* module, RtlImageRvaToVa(nth, mapping, stabs, NULL), stabsize, RtlImageRvaToVa(nth, mapping, stabstr, NULL), - stabstrsize); + stabstrsize, + NULL, NULL); }
TRACE("%s the STABS debug info\n", ret ? "successfully loaded" : "failed to load"); diff --git a/dlls/dbghelp/stabs.c b/dlls/dbghelp/stabs.c index 58c7783..aeac9cb 100644 --- a/dlls/dbghelp/stabs.c +++ b/dlls/dbghelp/stabs.c @@ -1191,7 +1191,8 @@ static void stabs_finalize_function(struct module* module, struct symt_function*
BOOL stabs_parse(struct module* module, unsigned long load_offset, const void* pv_stab_ptr, int stablen, - const char* strs, int strtablen) + const char* strs, int strtablen, + stabs_def_cb callback, void* user) { struct symt_function* curr_func = NULL; struct symt_block* block = NULL; @@ -1547,6 +1548,20 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, case N_OSO: /* Always ignore these, they seem to be used only on Darwin. */ break; + case N_ABS: + /* FIXME: Other definition types (N_TEXT, N_DATA, N_BSS, ...)? */ + if (callback) + { + BOOL is_public = (stab_ptr->n_type & N_EXT); + BOOL is_global = is_public; + + if (*ptr == '_') ptr++; + stab_strcpy(symname, sizeof(symname), ptr); + + callback(module, load_offset, symname, stab_ptr->n_value, + is_public, is_global, stab_ptr->n_other, compiland, user); + } + break; default: ERR("Unknown stab type 0x%02x\n", type); break;