From: Eric Pouech Subject: [PATCH 11/12] dbghelp/dwarf: added proper support for DW_FORM_GNU_ref_alt Message-Id: <163178344685.542088.10962499116501203186.stgit@euterpe> Date: Thu, 16 Sep 2021 11:10:47 +0200 In-Reply-To: <163178326421.542088.17939125251680595504.stgit@euterpe> References: <163178326421.542088.17939125251680595504.stgit@euterpe> Signed-off-by: Eric Pouech --- dlls/dbghelp/dwarf.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index c0f4afcb606..fffc7c37c13 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -680,9 +680,16 @@ static BOOL dwarf2_fill_attr(const dwarf2_parse_context_t* ctx, break; case DW_FORM_GNU_ref_alt: - FIXME("Unhandled FORM_GNU_ref_alt\n"); - attr->u.uvalue = 0; - return FALSE; + if (!ctx->module_ctx->dwz) + { + ERR("No DWZ file present for GNU_ref_alt in %s\n", debugstr_w(ctx->module_ctx->module->modulename)); + attr->u.uvalue = 0; + return FALSE; + } + attr->u.uvalue = dwarf2_get_addr(data, ctx->head.offset_size); + TRACE("ref_alt<0x%lx>\n", attr->u.uvalue); + break; + case DW_FORM_GNU_strp_alt: if (ctx->module_ctx->dwz) { @@ -767,6 +774,10 @@ static dwarf2_debug_info_t* dwarf2_jump_to_debug_info(struct attribute* attr) case DW_FORM_ref_addr: ref_ctx = dwarf2_locate_cu(attr->debug_info->unit_ctx->module_ctx, attr->u.uvalue); break; + case DW_FORM_GNU_ref_alt: + if (attr->debug_info->unit_ctx->module_ctx->dwz) + ref_ctx = dwarf2_locate_cu(&attr->debug_info->unit_ctx->module_ctx->dwz->module_ctx, attr->u.uvalue); + break; default: with_other = FALSE; ref_ctx = attr->debug_info->unit_ctx;