Eric Pouech : dbghelp/dwarf: Properly detect base address selection in AT_ranges.

Alexandre Julliard julliard at winehq.org
Tue Sep 21 15:59:04 CDT 2021


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

Author: Eric Pouech <eric.pouech at gmail.com>
Date:   Tue Sep 21 07:59:54 2021 +0200

dbghelp/dwarf: Properly detect base address selection in AT_ranges.

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

---

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

diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index 3009dead905..5f433e1d872 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -1209,26 +1209,28 @@ static BOOL dwarf2_read_range(dwarf2_parse_context_t* ctx, const dwarf2_debug_in
     {
         dwarf2_traverse_context_t   traverse;
         ULONG_PTR                   low, high;
+        const ULONG_PTR             UMAX = ~(ULONG_PTR)0u;
 
         traverse.data = ctx->module_ctx->sections[section_ranges].address + range.u.uvalue;
         traverse.end_data = ctx->module_ctx->sections[section_ranges].address +
             ctx->module_ctx->sections[section_ranges].size;
 
-        *plow  = ULONG_MAX;
+        *plow  = UMAX;
         *phigh = 0;
         while (traverse.data + 2 * ctx->head.word_size < traverse.end_data)
         {
             low = dwarf2_parse_addr_head(&traverse, &ctx->head);
             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");
+            if (low == (ctx->head.word_size == 8 ? (~(DWORD64)0u) : (DWORD64)(~0u)))
+                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;
         }
-        if (*plow == ULONG_MAX || *phigh == 0) {FIXME("no entry found\n"); return FALSE;}
+        if (*plow == UMAX || *phigh == 0) {FIXME("no entry found\n"); return FALSE;}
         if (*plow == *phigh) {FIXME("entry found, but low=high\n"); return FALSE;}
 
         return TRUE;




More information about the wine-cvs mailing list