[PATCH 1/9] dbghelp/dwarf: in DW_AT_ranges, the values are relative to the start of the CU

Eric Pouech eric.pouech at gmail.com
Fri Sep 17 03:33:20 CDT 2021


(and not the module, as most of the other addresses)

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---
 dlls/dbghelp/dwarf.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index f67efc43993..3009dead905 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -1222,6 +1222,9 @@ static BOOL dwarf2_read_range(dwarf2_parse_context_t* ctx, const dwarf2_debug_in
             high = dwarf2_parse_addr_head(&traverse, &ctx->head);
             if (low == 0 && high == 0) break;
             if (low == ULONG_MAX) FIXME("unsupported yet (base address selection)\n");
+            /* range values are relative to start of compilation unit */
+            low += ctx->compiland->address - ctx->module_ctx->load_offset;
+            high += ctx->compiland->address - ctx->module_ctx->load_offset;
             if (low  < *plow)  *plow = low;
             if (high > *phigh) *phigh = high;
         }




More information about the wine-devel mailing list