From: Eric Pouech epouech@codeweavers.com
And store DBI offset to function from old PDB backend (to be used by new PDB backend during migration).
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/coff.c | 6 +++--- dlls/dbghelp/dbghelp_private.h | 4 +++- dlls/dbghelp/dwarf.c | 4 ++-- dlls/dbghelp/elf_module.c | 2 +- dlls/dbghelp/macho_module.c | 2 +- dlls/dbghelp/msc.c | 15 +++++++++------ dlls/dbghelp/stabs.c | 4 ++-- dlls/dbghelp/symbol.c | 16 ++++++++++------ 8 files changed, 31 insertions(+), 22 deletions(-)
diff --git a/dlls/dbghelp/coff.c b/dlls/dbghelp/coff.c index aa7273db24e..65ed3b7def2 100644 --- a/dlls/dbghelp/coff.c +++ b/dlls/dbghelp/coff.c @@ -285,7 +285,7 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) nampnt, msc_dbg->module->module.BaseOfImage + base + coff_sym->Value, 0 /* FIXME */, - 0 /* FIXME */)->symt); + 0 /* FIXME */, 0)->symt); continue; }
@@ -318,13 +318,13 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) coff_add_symbol(&coff_files.files[j], &symt_new_function(msc_dbg->module, compiland, nampnt, msc_dbg->module->module.BaseOfImage + base + coff_sym->Value, - 0 /* FIXME */, 0 /* FIXME */)->symt); + 0 /* FIXME */, 0 /* FIXME */, 0)->symt); } else { symt_new_function(msc_dbg->module, NULL, nampnt, msc_dbg->module->module.BaseOfImage + base + coff_sym->Value, - 0 /* FIXME */, 0 /* FIXME */); + 0 /* FIXME */, 0 /* FIXME */, 0); } i += naux; continue; diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 54ea829e21b..86e990b422f 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -299,6 +299,7 @@ struct symt_function struct vector vlines; struct vector vchildren; /* locals, params, blocks, start/end, labels, inline sites */ struct symt_function* next_inlinesite;/* linked list of inline sites in this function */ + DWORD_PTR user; /* free to use by debug info backends */ unsigned num_ranges; struct addr_range ranges[]; }; @@ -922,13 +923,14 @@ extern struct symt_function* struct symt_compiland* parent, const char* name, ULONG_PTR addr, ULONG_PTR size, - symref_t type); + symref_t type, DWORD_PTR user); extern struct symt_function* symt_new_inlinesite(struct module* module, struct symt_function* func, struct symt* parent, const char* name, symref_t type, + DWORD_PTR user, unsigned num_ranges); extern void symt_add_func_line(struct module* module, struct symt_function* func, diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 2361df37647..831c56af63b 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2242,7 +2242,7 @@ static void dwarf2_parse_inlined_subroutine(dwarf2_subprogram_t* subpgm, subpgm->top_func, subpgm->current_block ? &subpgm->current_block->symt : &subpgm->current_func->symt, dwarf2_get_cpp_name(di, name.u.string), - symt_ptr_to_symref(dwarf2_parse_subroutine_type(di)), num_ranges); + symt_ptr_to_symref(dwarf2_parse_subroutine_type(di)), 0, num_ranges); subpgm->current_func = inlined; subpgm->current_block = NULL;
@@ -2452,7 +2452,7 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_debug_info_t* di) subpgm.top_func = symt_new_function(di->unit_ctx->module_ctx->module, di->unit_ctx->compiland, dwarf2_get_cpp_name(di, name.u.string), addr_ranges[0].low, addr_ranges[0].high - addr_ranges[0].low, - symt_ptr_to_symref(dwarf2_parse_subroutine_type(di))); + symt_ptr_to_symref(dwarf2_parse_subroutine_type(di)), 0); if (num_addr_ranges > 1) WARN("Function %s has multiple address ranges, only using the first one\n", debugstr_a(name.u.string)); free(addr_ranges); diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index b62fca9fc3e..8053f7a5a9a 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -960,7 +960,7 @@ static int elf_new_wine_thunks(struct module* module, const struct hash_table* h { case ELF_STT_FUNC: symt_new_function(module, ste->compiland, ste->ht_elt.name, - addr, ste->sym.st_size, 0); + addr, ste->sym.st_size, 0, 0); break; case ELF_STT_OBJECT: loc.kind = loc_absolute; diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c index b14591beb66..152dd16284f 100644 --- a/dlls/dbghelp/macho_module.c +++ b/dlls/dbghelp/macho_module.c @@ -1190,7 +1190,7 @@ static void macho_finish_stabs(struct module* module, struct hash_table* ht_symt if (ste->is_code) { symt_new_function(module, ste->compiland, ste->ht_elt.name, - ste->addr, 0, 0); + ste->addr, 0, 0, 0); } else { diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 8b346f0043f..d9a4934696d 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -2188,6 +2188,7 @@ static struct symt_function* codeview_create_inline_site(const struct msc_debug_ struct symt_function* top_func, struct symt* container, cv_itemid_t inlinee, + DWORD_PTR user, const unsigned char* annot, const unsigned char* last_annot) { @@ -2214,14 +2215,14 @@ static struct symt_function* codeview_create_inline_site(const struct msc_debug_ inlined = symt_new_inlinesite(msc_dbg->module, top_func, container, cvt->func_id_v3.name, codeview_get_symref(msc_dbg->module, cvt->func_id_v3.type), - num_ranges); + user, num_ranges); break; case LF_MFUNC_ID: /* FIXME we just declare a function, not a method */ inlined = symt_new_inlinesite(msc_dbg->module, top_func, container, cvt->mfunc_id_v3.name, codeview_get_symref(msc_dbg->module, cvt->mfunc_id_v3.type), - num_ranges); + user, num_ranges); break; default: FIXME("unsupported inlinee kind %x\n", cvt->generic.id); @@ -2438,7 +2439,7 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, terminate_string(&sym->proc_v1.p_name), codeview_get_address(msc_dbg, sym->proc_v1.segment, sym->proc_v1.offset), sym->proc_v1.proc_len, - codeview_get_symref(msc_dbg->module, sym->proc_v1.proctype)))) + codeview_get_symref(msc_dbg->module, sym->proc_v1.proctype), i))) { curr_func = top_func; loc.kind = loc_absolute; @@ -2455,7 +2456,7 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, terminate_string(&sym->proc_v2.p_name), codeview_get_address(msc_dbg, sym->proc_v2.segment, sym->proc_v2.offset), sym->proc_v2.proc_len, - codeview_get_symref(msc_dbg->module, sym->proc_v2.proctype)))) + codeview_get_symref(msc_dbg->module, sym->proc_v2.proctype), i))) { curr_func = top_func; loc.kind = loc_absolute; @@ -2472,7 +2473,7 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, sym->proc_v3.name, codeview_get_address(msc_dbg, sym->proc_v3.segment, sym->proc_v3.offset), sym->proc_v3.proc_len, - codeview_get_symref(msc_dbg->module, sym->proc_v3.proctype)))) + codeview_get_symref(msc_dbg->module, sym->proc_v3.proctype), i))) { curr_func = top_func; loc.kind = loc_absolute; @@ -2742,6 +2743,7 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, struct symt_function* inlined = codeview_create_inline_site(msc_dbg, cvmod, top_func, block ? &block->symt : &curr_func->symt, sym->inline_site_v3.inlinee, + i, sym->inline_site_v3.binaryAnnotations, (const unsigned char*)sym + length); if (inlined) @@ -2763,6 +2765,7 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, struct symt_function* inlined = codeview_create_inline_site(msc_dbg, cvmod, top_func, block ? &block->symt : &curr_func->symt, sym->inline_site2_v3.inlinee, + i, sym->inline_site2_v3.binaryAnnotations, (const unsigned char*)sym + length); if (inlined) @@ -2826,7 +2829,7 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, struct symt_function* pfunc = (struct symt_function*)parent; top_func = symt_new_function(msc_dbg->module, compiland, pfunc->hash_elt.name, codeview_get_address(msc_dbg, sym->sepcode_v3.sect, sym->sepcode_v3.off), - sym->sepcode_v3.length, pfunc->type); + sym->sepcode_v3.length, pfunc->type, i); curr_func = top_func; } else diff --git a/dlls/dbghelp/stabs.c b/dlls/dbghelp/stabs.c index efd2bb2f943..ea5bed152e6 100644 --- a/dlls/dbghelp/stabs.c +++ b/dlls/dbghelp/stabs.c @@ -1547,11 +1547,11 @@ BOOL stabs_parse(struct module* module, ULONG_PTR load_offset, n_value ? (load_offset + n_value - curr_func->ranges[0].low) : 0); } - func_type = symt_new_function_signature(module, + func_type = symt_new_function_signature(module, stabs_parse_type(ptr), -1); curr_func = symt_new_function(module, compiland, symname, load_offset + n_value, 0, - symt_ptr_to_symref(&func_type->symt)); + symt_ptr_to_symref(&func_type->symt), 0); pending_flush(&pending_func, module, curr_func, NULL); } else diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index ade18cc0a94..cf6bfe8c037 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -322,18 +322,20 @@ static struct symt_function* init_function_or_inlinesite(struct module* module, struct symt* container, const char* name, symref_t sig_type, + DWORD_PTR user, unsigned num_ranges) { struct symt_function* sym;
if ((sym = pool_alloc(&module->pool, offsetof(struct symt_function, ranges[num_ranges])))) { - sym->symt.tag = tag; + sym->symt.tag = tag; sym->hash_elt.name = pool_strdup(&module->pool, name); - sym->container = container; - sym->type = sig_type; + sym->container = container; + sym->type = sig_type; vector_init(&sym->vlines, sizeof(struct line_info), 0); vector_init(&sym->vchildren, sizeof(struct symt*), 0); + sym->user = user; sym->num_ranges = num_ranges; } return sym; @@ -343,13 +345,14 @@ struct symt_function* symt_new_function(struct module* module, struct symt_compiland* compiland, const char* name, ULONG_PTR addr, ULONG_PTR size, - symref_t sig_type) + symref_t sig_type, DWORD_PTR user) { struct symt_function* sym;
TRACE_(dbghelp_symt)("Adding global function %s:%s @%Ix-%Ix\n", debugstr_w(module->modulename), debugstr_a(name), addr, addr + size - 1); - if ((sym = init_function_or_inlinesite(module, SymTagFunction, &compiland->symt, name, sig_type, 1))) + + if ((sym = init_function_or_inlinesite(module, SymTagFunction, &compiland->symt, name, sig_type, user, 1))) { struct symt** p; sym->ranges[0].low = addr; @@ -370,12 +373,13 @@ struct symt_function* symt_new_inlinesite(struct module* module, struct symt* container, const char* name, symref_t sig_type, + DWORD_PTR user, unsigned num_ranges) { struct symt_function* sym;
TRACE_(dbghelp_symt)("Adding inline site %s\n", debugstr_a(name)); - if ((sym = init_function_or_inlinesite(module, SymTagInlineSite, container, name, sig_type, num_ranges))) + if ((sym = init_function_or_inlinesite(module, SymTagInlineSite, container, name, sig_type, user, num_ranges))) { struct symt** p; assert(container);