Commit 3db11b98 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

dbghelp: Let stabs_parse call back for real (non-debug) symbol definitions.

parent 82a3f8fc
......@@ -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,
......
......@@ -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);
......
......@@ -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");
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment