winedbg: Use proper width when printing addresses with leading 0.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2021-10-12 18:11:04 +02:00 committed by Alexandre Julliard
parent 3a869c1f9b
commit 01ddc2f8e4
3 changed files with 11 additions and 11 deletions

View File

@ -791,8 +791,8 @@ void info_win32_virtual(DWORD pid)
type = "";
prot[0] = '\0';
}
dbg_printf("%08lx %08lx %s %s %s\n",
(DWORD_PTR)addr, (DWORD_PTR)addr + mbi.RegionSize - 1, state, type, prot);
dbg_printf("%0*lx %0*lx %s %s %s\n",
ADDRWIDTH, (DWORD_PTR)addr, ADDRWIDTH, (DWORD_PTR)addr + mbi.RegionSize - 1, state, type, prot);
if (addr + mbi.RegionSize < addr) /* wrap around ? */
break;
addr += mbi.RegionSize;
@ -893,10 +893,10 @@ void info_win32_exception(void)
break;
case EXCEPTION_ACCESS_VIOLATION:
if (rec->NumberParameters == 2)
dbg_printf("page fault on %s access to 0x%08lx",
dbg_printf("page fault on %s access to 0x%0*lx",
rec->ExceptionInformation[0] == EXCEPTION_WRITE_FAULT ? "write" :
rec->ExceptionInformation[0] == EXCEPTION_EXECUTE_FAULT ? "execute" : "read",
rec->ExceptionInformation[1]);
ADDRWIDTH, rec->ExceptionInformation[1]);
else
dbg_printf("page fault");
break;
@ -961,15 +961,15 @@ void info_win32_exception(void)
break;
case EXCEPTION_WINE_CXX_EXCEPTION:
if(rec->NumberParameters == 3 && rec->ExceptionInformation[0] == EXCEPTION_WINE_CXX_FRAME_MAGIC)
dbg_printf("C++ exception(object = 0x%08lx, type = 0x%08lx)",
rec->ExceptionInformation[1], rec->ExceptionInformation[2]);
dbg_printf("C++ exception(object = 0x%0*lx, type = 0x%0*lx)",
ADDRWIDTH, rec->ExceptionInformation[1], ADDRWIDTH, rec->ExceptionInformation[2]);
else if(rec->NumberParameters == 4 && rec->ExceptionInformation[0] == EXCEPTION_WINE_CXX_FRAME_MAGIC)
dbg_printf("C++ exception(object = %p, type = %p, base = %p)",
(void*)rec->ExceptionInformation[1], (void*)rec->ExceptionInformation[2],
(void*)rec->ExceptionInformation[3]);
else
dbg_printf("C++ exception with strange parameter count %d or magic 0x%08lx",
rec->NumberParameters, rec->ExceptionInformation[0]);
dbg_printf("C++ exception with strange parameter count %d or magic 0x%0*lx",
rec->NumberParameters, ADDRWIDTH, rec->ExceptionInformation[0]);
break;
default:
dbg_printf("0x%08x", rec->ExceptionCode);

View File

@ -755,7 +755,7 @@ BOOL symbol_info_locals(void)
addr.Mode = AddrModeFlat;
addr.Offset = ihsf.InstructionOffset;
print_address(&addr, FALSE);
dbg_printf(": (%08lx)\n", (DWORD_PTR)ihsf.FrameOffset);
dbg_printf(": (%0*lx)\n", ADDRWIDTH, (DWORD_PTR)ihsf.FrameOffset);
SymEnumSymbols(dbg_curr_process->handle, 0, NULL, info_locals_cb, (void*)(DWORD_PTR)ihsf.FrameOffset);
return TRUE;
@ -778,7 +778,7 @@ static BOOL CALLBACK symbols_info_cb(PSYMBOL_INFO sym, ULONG size, PVOID ctx)
mi.ModuleName[len - 5] = '\0';
}
dbg_printf("%08lx: %s!%s", (ULONG_PTR)sym->Address, mi.ModuleName, sym->Name);
dbg_printf("%0*lx: %s!%s", ADDRWIDTH, (ULONG_PTR)sym->Address, mi.ModuleName, sym->Name);
type.id = sym->TypeIndex;
type.module = sym->ModBase;

View File

@ -571,7 +571,7 @@ static BOOL CALLBACK print_types_cb(PSYMBOL_INFO sym, ULONG size, void* ctx)
struct dbg_type type;
type.module = sym->ModBase;
type.id = sym->TypeIndex;
dbg_printf("Mod: %08lx ID: %08x\n", type.module, type.id);
dbg_printf("Mod: %0*lx ID: %08x\n", ADDRWIDTH, type.module, type.id);
types_print_type(&type, TRUE);
dbg_printf("\n");
return TRUE;