Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- programs/winedbg/db_disasm64.c | 5 +---- programs/winedbg/info.c | 2 +- programs/winedbg/memory.c | 6 ++---- programs/winedbg/stack.c | 6 +++--- 4 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/programs/winedbg/db_disasm64.c b/programs/winedbg/db_disasm64.c index 07faed0d146..3c0d55ee218 100644 --- a/programs/winedbg/db_disasm64.c +++ b/programs/winedbg/db_disasm64.c @@ -1603,10 +1603,7 @@ db_disasm(db_addr_t loc, boolean_t altfmt) case Ilq: len = db_lengths[rex & REX_W ? QUAD : LONG]; get_value_inc(imm64, loc, len, FALSE); - if (imm64 >> 32) - db_printf("$0x%x%08x", (DWORD)(imm64 >> 32), (DWORD)imm64); - else - db_printf("$%#x", (DWORD)imm64); + db_printf("$%#I64x", imm64); break;
case O: diff --git a/programs/winedbg/info.c b/programs/winedbg/info.c index dc0e6591f1f..477438d83e3 100644 --- a/programs/winedbg/info.c +++ b/programs/winedbg/info.c @@ -284,7 +284,7 @@ void info_win32_module(DWORD64 base) HeapFree(GetProcessHeap(), 0, im.modules);
if (base && !num_printed) - dbg_printf("'0x%x%08x' is not a valid module address\n", (DWORD)(base >> 32), (DWORD)base); + dbg_printf("'0x%0*I64x' is not a valid module address\n", ADDRWIDTH, base); }
struct class_walker diff --git a/programs/winedbg/memory.c b/programs/winedbg/memory.c index 3d6534a973f..6cd90b236eb 100644 --- a/programs/winedbg/memory.c +++ b/programs/winedbg/memory.c @@ -336,10 +336,8 @@ static void dbg_print_hex(DWORD size, ULONGLONG sv) { if (!sv) dbg_printf("0"); - else if (size > 4 && (sv >> 32)) - dbg_printf("0x%x%08x", (DWORD)(sv >> 32), (DWORD)sv); else - dbg_printf("0x%x", (DWORD)sv); + dbg_printf("%#I64x", sv); }
static void print_typed_basic(const struct dbg_lvalue* lvalue) @@ -595,7 +593,7 @@ void print_address(const ADDRESS64* addr, BOOLEAN with_line) si->MaxNameLen = 256; if (!SymFromAddr(dbg_curr_process->handle, (DWORD_PTR)lin, &disp64, si)) return; dbg_printf(" %s", si->Name); - if (disp64) dbg_printf("+0x%lx", (DWORD_PTR)disp64); + if (disp64) dbg_printf("+0x%I64x", disp64); if (with_line) { IMAGEHLP_LINE64 il; diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c index 1aa681bf7a6..396caf11edd 100644 --- a/programs/winedbg/stack.c +++ b/programs/winedbg/stack.c @@ -286,7 +286,7 @@ static void stack_print_addr_and_args(int nf) DWORD disp;
dbg_printf(" %s", si->Name); - if (disp64) dbg_printf("+0x%lx", (DWORD_PTR)disp64); + if (disp64) dbg_printf("+0x%I64x", disp64);
SymSetContext(dbg_curr_process->handle, &ihsf, NULL); se.first = TRUE; @@ -301,8 +301,8 @@ static void stack_print_addr_and_args(int nf) dbg_printf(" [%s:%u]", il.FileName, il.LineNumber); dbg_printf(" in %s", im.ModuleName); } - else dbg_printf(" in %s (+0x%lx)", - im.ModuleName, (DWORD_PTR)(ihsf.InstructionOffset - im.BaseOfImage)); + else dbg_printf(" in %s (+0x%I64x)", + im.ModuleName, ihsf.InstructionOffset - im.BaseOfImage); }
/******************************************************************