Commit 01ddc2f8 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

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

parent 3a869c1f
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment