Module: wine Branch: master Commit: 6f8ba8119ae6d40621e499d8d34d5379eccad084 URL: https://gitlab.winehq.org/wine/wine/-/commit/6f8ba8119ae6d40621e499d8d34d537...
Author: Eric Pouech eric.pouech@gmail.com Date: Fri Oct 7 11:39:59 2022 +0200
dbghelp: Keep compiland's address for Dwarf debug format.
Partly reverting 99eb63bd7a41b87d472bb622a5faf24d1fcd91c5 (it's still needed on Dwarf for blocks with multiple non-contiguous address ranges).
Signed-off-by: Eric Pouech eric.pouech@gmail.com
---
dlls/dbghelp/dwarf.c | 6 +++++- dlls/dbghelp/symbol.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index af703c90f9e..92229552929 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2970,7 +2970,7 @@ static BOOL dwarf2_parse_compilation_unit(dwarf2_parse_context_t* ctx) struct vector* children; dwarf2_debug_info_t* child = NULL; unsigned int i; - struct attribute stmt_list; + struct attribute stmt_list, low_pc; struct attribute comp_dir; struct attribute language;
@@ -2981,6 +2981,9 @@ static BOOL dwarf2_parse_compilation_unit(dwarf2_parse_context_t* ctx) if (!dwarf2_find_attribute(di, DW_AT_comp_dir, &comp_dir)) comp_dir.u.string = NULL;
+ if (!dwarf2_find_attribute(di, DW_AT_low_pc, &low_pc)) + low_pc.u.uvalue = 0; + if (!dwarf2_find_attribute(di, DW_AT_language, &language)) language.u.uvalue = DW_LANG_C;
@@ -2988,6 +2991,7 @@ static BOOL dwarf2_parse_compilation_unit(dwarf2_parse_context_t* ctx)
ctx->compiland = symt_new_compiland(ctx->module_ctx->module, source_new(ctx->module_ctx->module, comp_dir.u.string, name.u.string)); + ctx->compiland->address = ctx->module_ctx->load_offset + low_pc.u.uvalue; dwarf2_cache_cuhead(ctx->module_ctx->module->format_info[DFI_DWARF]->u.dwarf2_info, ctx->compiland, &ctx->head); di->symt = &ctx->compiland->symt; children = dwarf2_get_di_children(di); diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index a020c0b2a57..98e25a32b30 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -239,6 +239,7 @@ struct symt_compiland* symt_new_compiland(struct module* module, unsigned src_id { sym->symt.tag = SymTagCompiland; sym->container = module->top; + sym->address = 0; sym->source = src_idx; vector_init(&sym->vchildren, sizeof(struct symt*), 32); sym->user = NULL;