dbghelp: Keep compiland's address for Dwarf debug format.

Partly reverting 99eb63bd7a
(it's still needed on Dwarf for blocks with multiple
non-contiguous address ranges).

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
This commit is contained in:
Eric Pouech 2022-10-07 11:39:59 +02:00 committed by Alexandre Julliard
parent 96c3f58783
commit 6f8ba8119a
2 changed files with 6 additions and 1 deletions

View file

@ -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);

View file

@ -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;