[PATCH 13/13] programs/winedbg: in print_hex, don't print bits not included in size

Eric Pouech eric.pouech at gmail.com
Wed Dec 1 08:30:53 CST 2021


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

---
 programs/winedbg/memory.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/programs/winedbg/memory.c b/programs/winedbg/memory.c
index f7baf3e6381..1653736e919 100644
--- a/programs/winedbg/memory.c
+++ b/programs/winedbg/memory.c
@@ -337,7 +337,8 @@ static void dbg_print_hex(DWORD size, ULONGLONG sv)
     if (!sv)
         dbg_printf("0");
     else
-        dbg_printf("%#I64x", sv);
+        /* clear unneeded high bits, esp. sign extension */
+        dbg_printf("%#I64x", sv & (~0LLU >> (64 - 8 * size)));
 }
 
 static void print_typed_basic(const struct dbg_lvalue* lvalue)




More information about the wine-devel mailing list