Eric Pouech : dbghelp/dwarf: Handle DW_FORM_GNU_strp_alt (string located in an alternate DWZ file).

Alexandre Julliard julliard at winehq.org
Thu Sep 16 15:34:31 CDT 2021


Module: wine
Branch: master
Commit: 9f74ac4b3b8d0e1496ddc0730c8e88291f41df1b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9f74ac4b3b8d0e1496ddc0730c8e88291f41df1b

Author: Eric Pouech <eric.pouech at gmail.com>
Date:   Thu Sep 16 11:10:03 2021 +0200

dbghelp/dwarf: Handle DW_FORM_GNU_strp_alt (string located in an alternate DWZ file).

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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-cvs mailing list