From 99eb63bd7a41b87d472bb622a5faf24d1fcd91c5 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Fri, 30 Sep 2022 18:14:24 +0200 Subject: [PATCH] dbghelp: Remove address field from symt_compiland. It's mostly always set at 0, and native dbghelp doesn't expose it anyway. Signed-off-by: Eric Pouech --- dlls/dbghelp/coff.c | 3 +-- dlls/dbghelp/dbghelp_private.h | 3 +-- dlls/dbghelp/dwarf.c | 7 ++----- dlls/dbghelp/elf_module.c | 3 +-- dlls/dbghelp/msc.c | 4 ++-- dlls/dbghelp/pe_module.c | 3 +-- dlls/dbghelp/stabs.c | 2 +- dlls/dbghelp/symbol.c | 4 +--- 8 files changed, 10 insertions(+), 19 deletions(-) diff --git a/dlls/dbghelp/coff.c b/dlls/dbghelp/coff.c index 0f29b131a86..efba167081e 100644 --- a/dlls/dbghelp/coff.c +++ b/dlls/dbghelp/coff.c @@ -114,8 +114,7 @@ static int coff_add_file(struct CoffFileSet* coff_files, struct module* module, file = coff_files->files + coff_files->nfiles; file->startaddr = 0xffffffff; file->endaddr = 0; - file->compiland = symt_new_compiland(module, 0, - source_new(module, NULL, filename)); + file->compiland = symt_new_compiland(module, source_new(module, NULL, filename)); file->linetab_offset = -1; file->linecnt = 0; file->entries = NULL; diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 24ac003df71..1e0a3423ea3 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -815,8 +815,7 @@ extern struct symt_ht* extern struct symt_module* symt_new_module(struct module* module) DECLSPEC_HIDDEN; extern struct symt_compiland* - symt_new_compiland(struct module* module, ULONG_PTR address, - unsigned src_idx) DECLSPEC_HIDDEN; + symt_new_compiland(struct module* module, unsigned src_idx) DECLSPEC_HIDDEN; extern struct symt_public* symt_new_public(struct module* module, struct symt_compiland* parent, diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 71163ced733..30cd35076d3 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, low_pc; + struct attribute stmt_list; struct attribute comp_dir; struct attribute language; @@ -2981,15 +2981,12 @@ 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; ctx->language = language.u.uvalue; - ctx->compiland = symt_new_compiland(ctx->module_ctx->module, ctx->module_ctx->load_offset + low_pc.u.uvalue, + ctx->compiland = symt_new_compiland(ctx->module_ctx->module, source_new(ctx->module_ctx->module, comp_dir.u.string, name.u.string)); dwarf2_cache_cuhead(ctx->module_ctx->module->format_info[DFI_DWARF]->u.dwarf2_info, ctx->compiland, &ctx->head); di->symt = &ctx->compiland->symt; diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index 404c7c11dbb..4d96b5c60a7 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -699,8 +699,7 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, { case ELF_STT_FILE: if (symname) - compiland = symt_new_compiland(module, sym.st_value, - source_new(module, NULL, symname)); + compiland = symt_new_compiland(module, source_new(module, NULL, symname)); else compiland = NULL; continue; diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index a5b688bae17..0109e4dd255 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -2504,14 +2504,14 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, case S_OBJNAME: TRACE("S-ObjName-V3 %s\n", sym->objname_v3.name); - compiland = symt_new_compiland(msc_dbg->module, 0 /* FIXME */, + compiland = symt_new_compiland(msc_dbg->module, source_new(msc_dbg->module, NULL, sym->objname_v3.name)); break; case S_OBJNAME_ST: TRACE("S-ObjName-V1 %s\n", terminate_string(&sym->objname_v1.p_name)); - compiland = symt_new_compiland(msc_dbg->module, 0 /* FIXME */, + compiland = symt_new_compiland(msc_dbg->module, source_new(msc_dbg->module, NULL, terminate_string(&sym->objname_v1.p_name))); break; diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index 3e697912718..6b61c1de6e5 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -470,8 +470,7 @@ static BOOL pe_load_coff_symbol_table(struct module* module) if (name[0] == '_') name++; if (!compiland && lastfilename) - compiland = symt_new_compiland(module, 0, - source_new(module, NULL, lastfilename)); + compiland = symt_new_compiland(module, source_new(module, NULL, lastfilename)); if (!(dbghelp_options & SYMOPT_NO_PUBLICS)) symt_new_public(module, compiland, name, FALSE, diff --git a/dlls/dbghelp/stabs.c b/dlls/dbghelp/stabs.c index b22fb714973..badb07e3b5c 100644 --- a/dlls/dbghelp/stabs.c +++ b/dlls/dbghelp/stabs.c @@ -1570,7 +1570,7 @@ BOOL stabs_parse(struct module* module, ULONG_PTR load_offset, { stabs_reset_includes(); source_idx = source_new(module, srcpath, ptr); - compiland = symt_new_compiland(module, 0 /* FIXME */, source_idx); + compiland = symt_new_compiland(module, source_idx); } else { diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index adc36da4a49..7d0cc6005f2 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -228,8 +228,7 @@ struct symt_module* symt_new_module(struct module* module) return sym; } -struct symt_compiland* symt_new_compiland(struct module* module, - ULONG_PTR address, unsigned src_idx) +struct symt_compiland* symt_new_compiland(struct module* module, unsigned src_idx) { struct symt_compiland* sym; struct symt_compiland** p; @@ -240,7 +239,6 @@ struct symt_compiland* symt_new_compiland(struct module* module, { sym->symt.tag = SymTagCompiland; sym->container = module->top; - sym->address = address; sym->source = src_idx; vector_init(&sym->vchildren, sizeof(struct symt*), 32); sym->user = NULL; -- 2.11.4.GIT