[PATCH 04/12] dbghelp/dwarf: Now properly handling DW_FORM_GNU_strp_alt
Eric Pouech
eric.pouech at gmail.com
Thu Sep 16 04:10:03 CDT 2021
(string located in an alternate DWZ file)
Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
---
dlls/dbghelp/dwarf.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index af0244c8311..e3d1e35c179 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -682,9 +682,27 @@ static BOOL dwarf2_fill_attr(const dwarf2_parse_context_t* ctx,
attr->u.uvalue = 0;
return FALSE;
case DW_FORM_GNU_strp_alt:
- FIXME("Unhandled FORM_GNU_strp_alt\n");
- attr->u.string = NULL;
- return FALSE;
+ if (ctx->module_ctx->dwz)
+ {
+ ULONG_PTR ofs = dwarf2_get_addr(data, ctx->head.offset_size);
+ if (ofs < ctx->module_ctx->dwz->sections[section_string].size)
+ {
+ attr->u.string = (const char*)ctx->module_ctx->dwz->sections[section_string].address + ofs;
+ TRACE("strp_alt<%s>\n", debugstr_a(attr->u.string));
+ }
+ else
+ {
+ ERR("out of bounds strp_alt: 0x%lx 0x%x (%u)\n", ofs, ctx->module_ctx->dwz->sections[section_string].size, ctx->head.offset_size);
+ attr->u.string = "<<outofbounds-strpalt>>";
+ }
+ }
+ else
+ {
+ ERR("No DWZ file present for GNU_strp_alt in %s\n", debugstr_w(ctx->module_ctx->module->modulename));
+ attr->u.string = "<<noDWZ-strpalt>>";
+ }
+ break;
+
default:
FIXME("Unhandled attribute form %lx\n", abbrev_attr->form);
break;
More information about the wine-devel
mailing list