Module: wine Branch: master Commit: a6f1f7be7e11192557acc4d960e39e6992640cf1 URL: https://gitlab.winehq.org/wine/wine/-/commit/a6f1f7be7e11192557acc4d960e39e6...
Author: Eric Pouech eric.pouech@gmail.com Date: Tue Nov 1 10:39:57 2022 +0100
dbghelp: No longer pass inline site's address upon creation.
Instead use the first address of the first defined range of address.
Signed-off-by: Eric Pouech eric.pouech@gmail.com
---
dlls/dbghelp/dbghelp_private.h | 1 - dlls/dbghelp/dwarf.c | 4 +++- dlls/dbghelp/msc.c | 33 +++++---------------------------- dlls/dbghelp/symbol.c | 5 ++--- 4 files changed, 10 insertions(+), 33 deletions(-)
diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index daf15732877..d1ca5d38868 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -850,7 +850,6 @@ extern struct symt_inlinesite* struct symt_function* func, struct symt* parent, const char* name, - ULONG_PTR addr, struct symt* type) DECLSPEC_HIDDEN; 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 f9ffa374dbc..cc31cc7912c 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2141,13 +2141,15 @@ 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), - adranges[0].low, &sig_type->symt); + &sig_type->symt); subpgm->current_func = (struct symt_function*)inlined; subpgm->current_block = NULL;
for (i = 0; i < num_adranges; ++i) symt_add_inlinesite_range(subpgm->ctx->module_ctx->module, inlined, adranges[i].low, adranges[i].high); + /* temporary: update address field */ + inlined->func.address = adranges[0].low; free(adranges);
children = dwarf2_get_di_children(di); diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 872b0e70b58..39beaf80c12 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -2101,7 +2101,7 @@ static struct symt_inlinesite* codeview_create_inline_site(const struct msc_debu const union codeview_type* cvt; struct symt_inlinesite* inlined; struct cv_binannot cvba; - BOOL srcok, found = FALSE; + BOOL srcok; unsigned offset, line, srcfile; const struct CV_Checksum_t* chksms;
@@ -2111,42 +2111,17 @@ static struct symt_inlinesite* codeview_create_inline_site(const struct msc_debu return NULL; }
- /* grasp first code offset in binary annotation to compute inline site start address */ - cvba.annot = annot; - cvba.last_annot = last_annot; - while (codeview_advance_binannot(&cvba)) - if (cvba.opcode == BA_OP_CodeOffset || - cvba.opcode == BA_OP_ChangeCodeOffset || - cvba.opcode == BA_OP_ChangeCodeOffsetAndLineOffset) - { - offset = cvba.arg1; - found = TRUE; - break; - } - else if (cvba.opcode == BA_OP_ChangeCodeLengthAndCodeOffset) - { - offset = cvba.arg2; - found = TRUE; - break; - } - - if (!found) - { - WARN("Couldn't find start address of inlined\n"); - return NULL; - } - switch (cvt->generic.id) { case LF_FUNC_ID: inlined = symt_new_inlinesite(msc_dbg->module, top_func, container, - cvt->func_id_v3.name, top_func->address + offset, + cvt->func_id_v3.name, codeview_get_type(cvt->func_id_v3.type, FALSE)); 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, top_func->address + offset, + cvt->mfunc_id_v3.name, codeview_get_type(cvt->mfunc_id_v3.type, FALSE)); break; default: @@ -2228,6 +2203,8 @@ static struct symt_inlinesite* codeview_create_inline_site(const struct msc_debu if (range->low == range->high) WARN("pending empty range at end of %s inside %s\n", inlined->func.hash_elt.name, top_func->hash_elt.name); + /* temporary: update address field */ + inlined->func.address = ((struct addr_range*)vector_at(&inlined->vranges, 0))->low; } return inlined; } diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 6e6c35e9b98..082eec2a555 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -362,17 +362,16 @@ struct symt_inlinesite* symt_new_inlinesite(struct module* module, struct symt_function* func, struct symt* container, const char* name, - ULONG_PTR addr, struct symt* sig_type) { struct symt_inlinesite* sym;
- TRACE_(dbghelp_symt)("Adding inline site %s @%Ix\n", name, addr); + TRACE_(dbghelp_symt)("Adding inline site %s\n", name); if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) { struct symt** p; assert(container); - init_function_or_inlinesite(&sym->func, module, SymTagInlineSite, container, name, addr, 0, sig_type); + init_function_or_inlinesite(&sym->func, module, SymTagInlineSite, container, name, 0, 0, sig_type); vector_init(&sym->vranges, sizeof(struct addr_range), 2); /* FIXME: number of elts => to be set on input */ /* chain inline sites */ sym->func.next_inlinesite = func->next_inlinesite;