winedbg: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-02-07 08:40:49 +01:00 committed by Alexandre Julliard
parent c4b0c89b78
commit b0319099d0
13 changed files with 101 additions and 102 deletions

View File

@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = winedbg.exe
IMPORTS = dbghelp advapi32
DELAYIMPORTS = comdlg32 shell32 comctl32 user32 gdi32 ws2_32

View File

@ -143,7 +143,7 @@ static void be_i386_all_print_context(HANDLE hThread, const dbg_ctx_t *pctx)
dbg_printf(" FLSW:%04x", LOWORD(ctx->FloatSave.StatusWord));
/* Isolate the condition code bits - note they are not contiguous */
dbg_printf("(CC:%d%d%d%d", (ctx->FloatSave.StatusWord & 0x00004000) >> 14,
dbg_printf("(CC:%ld%ld%ld%ld", (ctx->FloatSave.StatusWord & 0x00004000) >> 14,
(ctx->FloatSave.StatusWord & 0x00000400) >> 10,
(ctx->FloatSave.StatusWord & 0x00000200) >> 9,
(ctx->FloatSave.StatusWord & 0x00000100) >> 8);
@ -176,7 +176,7 @@ static void be_i386_all_print_context(HANDLE hThread, const dbg_ctx_t *pctx)
dbg_printf(")\n");
/* Here are the rest of the registers */
dbg_printf(" FLES:%08x FLDO:%08x FLDS:%08x FLCNS:%08x\n",
dbg_printf(" FLES:%08lx FLDO:%08lx FLDS:%08lx FLCNS:%08lx\n",
ctx->FloatSave.ErrorSelector,
ctx->FloatSave.DataOffset,
ctx->FloatSave.DataSelector,
@ -194,7 +194,7 @@ static void be_i386_all_print_context(HANDLE hThread, const dbg_ctx_t *pctx)
xmm_area = (XSAVE_FORMAT *) &ctx->ExtendedRegisters;
dbg_printf(" mxcsr: %04x (", xmm_area->MxCsr );
dbg_printf(" mxcsr: %04lx (", xmm_area->MxCsr );
for (cnt = 0; cnt < 16; cnt++)
if (xmm_area->MxCsr & (1 << cnt)) dbg_printf( " %s", mxcsr_flags[cnt] );
dbg_printf(" )\n");
@ -251,11 +251,11 @@ static void be_i386_print_context(HANDLE hThread, const dbg_ctx_t *pctx, int all
break;
case AddrModeFlat:
case AddrMode1632:
dbg_printf("\n EIP:%08x ESP:%08x EBP:%08x EFLAGS:%08x(%s)\n",
dbg_printf("\n EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx(%s)\n",
ctx->Eip, ctx->Esp, ctx->Ebp, ctx->EFlags, buf);
dbg_printf(" EAX:%08x EBX:%08x ECX:%08x EDX:%08x\n",
dbg_printf(" EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n",
ctx->Eax, ctx->Ebx, ctx->Ecx, ctx->Edx);
dbg_printf(" ESI:%08x EDI:%08x\n",
dbg_printf(" ESI:%08lx EDI:%08lx\n",
ctx->Esi, ctx->Edi);
break;
}

View File

@ -89,7 +89,7 @@ static void be_x86_64_print_context(HANDLE hThread, const dbg_ctx_t *pctx,
buf[i] = ' ';
dbg_printf("Register dump:\n");
dbg_printf(" rip:%016I64x rsp:%016I64x rbp:%016I64x eflags:%08x (%s)\n",
dbg_printf(" rip:%016I64x rsp:%016I64x rbp:%016I64x eflags:%08lx (%s)\n",
ctx->Rip, ctx->Rsp, ctx->Rbp, ctx->EFlags, buf);
dbg_printf(" rax:%016I64x rbx:%016I64x rcx:%016I64x rdx:%016I64x\n",
ctx->Rax, ctx->Rbx, ctx->Rcx, ctx->Rdx);
@ -142,7 +142,7 @@ static void be_x86_64_print_context(HANDLE hThread, const dbg_ctx_t *pctx,
if (ctx->u.FltSave.StatusWord & 0x00000080) dbg_printf(" #ES"); /* Error Summary */
if (ctx->u.FltSave.StatusWord & 0x00008000) dbg_printf(" #FB"); /* FPU Busy */
dbg_printf(")\n");
dbg_printf(" flerr:%04x:%08x fldata:%04x:%08x\n",
dbg_printf(" flerr:%04x:%08lx fldata:%04x:%08lx\n",
ctx->u.FltSave.ErrorSelector, ctx->u.FltSave.ErrorOffset,
ctx->u.FltSave.DataSelector, ctx->u.FltSave.DataOffset );
@ -154,7 +154,7 @@ static void be_x86_64_print_context(HANDLE hThread, const dbg_ctx_t *pctx,
}
dbg_printf("\n");
dbg_printf(" mxcsr: %04x (", ctx->u.FltSave.MxCsr );
dbg_printf(" mxcsr: %04lx (", ctx->u.FltSave.MxCsr );
for (i = 0; i < 16; i++)
if (ctx->u.FltSave.MxCsr & (1 << i)) dbg_printf( " %s", mxcsr_flags[i] );
dbg_printf(" )\n");

View File

@ -445,7 +445,7 @@ static LONG WINAPI wine_dbg_cmd(EXCEPTION_POINTERS *eptr)
dbg_interrupt_debuggee();
return EXCEPTION_CONTINUE_EXECUTION;
default:
dbg_printf("\nException %x\n", eptr->ExceptionRecord->ExceptionCode);
dbg_printf("\nException %lx\n", eptr->ExceptionRecord->ExceptionCode);
break;
}

View File

@ -126,7 +126,7 @@ static void gdbctx_delete_xpoint(struct gdb_context *gdbctx, struct dbg_thread *
struct backend_cpu *cpu = process->be_cpu;
if (!cpu->remove_Xpoint(process->handle, process->process_io, ctx, x->type, x->addr, x->value, x->size))
ERR("%04x:%04x: Couldn't remove breakpoint at:%p/%x type:%d\n", process->pid, thread ? thread->tid : ~0, x->addr, x->size, x->type);
ERR("%04lx:%04lx: Couldn't remove breakpoint at:%p/%x type:%d\n", process->pid, thread ? thread->tid : ~0, x->addr, x->size, x->type);
list_remove(&x->entry);
HeapFree(GetProcessHeap(), 0, x);
@ -142,13 +142,13 @@ static void gdbctx_insert_xpoint(struct gdb_context *gdbctx, struct dbg_thread *
if (!cpu->insert_Xpoint(process->handle, process->process_io, ctx, type, addr, &value, size))
{
ERR("%04x:%04x: Couldn't insert breakpoint at:%p/%x type:%d\n", process->pid, thread->tid, addr, size, type);
ERR("%04lx:%04lx: Couldn't insert breakpoint at:%p/%x type:%d\n", process->pid, thread->tid, addr, size, type);
return;
}
if (!(x = HeapAlloc(GetProcessHeap(), 0, sizeof(struct gdb_xpoint))))
{
ERR("%04x:%04x: Couldn't allocate memory for breakpoint at:%p/%x type:%d\n", process->pid, thread->tid, addr, size, type);
ERR("%04lx:%04lx: Couldn't allocate memory for breakpoint at:%p/%x type:%d\n", process->pid, thread->tid, addr, size, type);
return;
}
@ -415,12 +415,12 @@ static void dbg_thread_set_single_step(struct dbg_thread *thread, BOOL enable)
if (!backend->get_context(thread->handle, &ctx))
{
ERR("get_context failed for thread %04x:%04x\n", thread->process->pid, thread->tid);
ERR("get_context failed for thread %04lx:%04lx\n", thread->process->pid, thread->tid);
return;
}
backend->single_step(&ctx, enable);
if (!backend->set_context(thread->handle, &ctx))
ERR("set_context failed for thread %04x:%04x\n", thread->process->pid, thread->tid);
ERR("set_context failed for thread %04lx:%04lx\n", thread->process->pid, thread->tid);
}
static unsigned char signal_from_debug_event(DEBUG_EVENT* de)
@ -467,7 +467,7 @@ static unsigned char signal_from_debug_event(DEBUG_EVENT* de)
case EXCEPTION_WINE_NAME_THREAD:
return HOST_SIGTRAP;
default:
ERR("Unknown exception code 0x%08x\n", ec);
ERR("Unknown exception code 0x%08lx\n", ec);
return HOST_SIGABRT;
}
}
@ -494,12 +494,12 @@ static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* e
if (gdbctx->process->process_io->read( gdbctx->process->handle,
threadname->szName, name, sizeof(name), &read) && read == sizeof(name))
{
fprintf(stderr, "Thread ID=%04x renamed to \"%.9s\"\n",
fprintf(stderr, "Thread ID=%04lx renamed to \"%.9s\"\n",
threadname->dwThreadID, name);
}
}
else
ERR("Cannot set name of thread %04x\n", threadname->dwThreadID);
ERR("Cannot set name of thread %04lx\n", threadname->dwThreadID);
return TRUE;
}
case EXCEPTION_INVALID_HANDLE:
@ -536,7 +536,7 @@ static BOOL handle_debug_event(struct gdb_context* gdbctx, BOOL stop_on_dll_load
QueryFullProcessImageNameW( gdbctx->process->handle, 0, u.buffer, &size );
dbg_set_process_name(gdbctx->process, u.buffer);
fprintf(stderr, "%04x:%04x: create process '%s'/%p @%p (%u<%u>)\n",
fprintf(stderr, "%04lx:%04lx: create process '%s'/%p @%p (%lu<%lu>)\n",
de->dwProcessId, de->dwThreadId,
dbg_W2A(u.buffer, -1),
de->u.CreateProcessInfo.lpImageName,
@ -548,7 +548,7 @@ static BOOL handle_debug_event(struct gdb_context* gdbctx, BOOL stop_on_dll_load
if (!dbg_init(gdbctx->process->handle, u.buffer, TRUE))
ERR("Couldn't initiate DbgHelp\n");
fprintf(stderr, "%04x:%04x: create thread I @%p\n", de->dwProcessId,
fprintf(stderr, "%04lx:%04lx: create thread I @%p\n", de->dwProcessId,
de->dwThreadId, de->u.CreateProcessInfo.lpStartAddress);
dbg_load_module(gdbctx->process->handle, de->u.CreateProcessInfo.hFile, u.buffer,
@ -562,7 +562,7 @@ static BOOL handle_debug_event(struct gdb_context* gdbctx, BOOL stop_on_dll_load
case LOAD_DLL_DEBUG_EVENT:
fetch_module_name( de->u.LoadDll.lpImageName, de->u.LoadDll.lpBaseOfDll,
u.buffer, ARRAY_SIZE(u.buffer) );
fprintf(stderr, "%04x:%04x: loads DLL %s @%p (%u<%u>)\n",
fprintf(stderr, "%04lx:%04lx: loads DLL %s @%p (%lu<%lu>)\n",
de->dwProcessId, de->dwThreadId,
dbg_W2A(u.buffer, -1),
de->u.LoadDll.lpBaseOfDll,
@ -575,7 +575,7 @@ static BOOL handle_debug_event(struct gdb_context* gdbctx, BOOL stop_on_dll_load
return TRUE;
case UNLOAD_DLL_DEBUG_EVENT:
fprintf(stderr, "%08x:%08x: unload DLL @%p\n",
fprintf(stderr, "%08lx:%08lx: unload DLL @%p\n",
de->dwProcessId, de->dwThreadId, de->u.UnloadDll.lpBaseOfDll);
SymUnloadModule(gdbctx->process->handle,
(DWORD_PTR)de->u.UnloadDll.lpBaseOfDll);
@ -584,7 +584,7 @@ static BOOL handle_debug_event(struct gdb_context* gdbctx, BOOL stop_on_dll_load
return TRUE;
case EXCEPTION_DEBUG_EVENT:
TRACE("%08x:%08x: exception code=0x%08x\n", de->dwProcessId,
TRACE("%08lx:%08lx: exception code=0x%08lx\n", de->dwProcessId,
de->dwThreadId, de->u.Exception.ExceptionRecord.ExceptionCode);
if (handle_exception(gdbctx, &de->u.Exception))
@ -592,7 +592,7 @@ static BOOL handle_debug_event(struct gdb_context* gdbctx, BOOL stop_on_dll_load
break;
case CREATE_THREAD_DEBUG_EVENT:
fprintf(stderr, "%08x:%08x: create thread D @%p\n", de->dwProcessId,
fprintf(stderr, "%08lx:%08lx: create thread D @%p\n", de->dwProcessId,
de->dwThreadId, de->u.CreateThread.lpStartAddress);
dbg_add_thread(gdbctx->process,
@ -602,14 +602,14 @@ static BOOL handle_debug_event(struct gdb_context* gdbctx, BOOL stop_on_dll_load
return TRUE;
case EXIT_THREAD_DEBUG_EVENT:
fprintf(stderr, "%08x:%08x: exit thread (%u)\n",
fprintf(stderr, "%08lx:%08lx: exit thread (%lu)\n",
de->dwProcessId, de->dwThreadId, de->u.ExitThread.dwExitCode);
if ((thread = dbg_get_thread(gdbctx->process, de->dwThreadId)))
dbg_del_thread(thread);
return TRUE;
case EXIT_PROCESS_DEBUG_EVENT:
fprintf(stderr, "%08x:%08x: exit process (%u)\n",
fprintf(stderr, "%08lx:%08lx: exit process (%lu)\n",
de->dwProcessId, de->dwThreadId, de->u.ExitProcess.dwExitCode);
dbg_del_process(gdbctx->process);
@ -620,17 +620,17 @@ static BOOL handle_debug_event(struct gdb_context* gdbctx, BOOL stop_on_dll_load
memory_get_string(gdbctx->process,
de->u.DebugString.lpDebugStringData, TRUE,
de->u.DebugString.fUnicode, u.bufferA, sizeof(u.bufferA));
fprintf(stderr, "%08x:%08x: output debug string (%s)\n",
fprintf(stderr, "%08lx:%08lx: output debug string (%s)\n",
de->dwProcessId, de->dwThreadId, debugstr_a(u.bufferA));
return TRUE;
case RIP_EVENT:
fprintf(stderr, "%08x:%08x: rip error=%u type=%u\n", de->dwProcessId,
fprintf(stderr, "%08lx:%08lx: rip error=%lu type=%lu\n", de->dwProcessId,
de->dwThreadId, de->u.RipInfo.dwError, de->u.RipInfo.dwType);
return TRUE;
default:
FIXME("%08x:%08x: unknown event (%u)\n",
FIXME("%08lx:%08lx: unknown event (%lu)\n",
de->dwProcessId, de->dwThreadId, de->dwDebugEventCode);
}
@ -744,7 +744,7 @@ static void get_process_info(struct gdb_context* gdbctx, char* buffer, size_t le
strcpy(buffer, "Running");
}
else
snprintf(buffer, len, "Terminated (%u)", status);
snprintf(buffer, len, "Terminated (%lu)", status);
switch (GetPriorityClass(gdbctx->process->handle))
{
@ -782,12 +782,12 @@ static void get_thread_info(struct gdb_context* gdbctx, unsigned tid,
{
case -1: break;
case 0: strcpy(buffer, "Running"); break;
default: snprintf(buffer, len, "Suspended (%u)", status - 1);
default: snprintf(buffer, len, "Suspended (%lu)", status - 1);
}
ResumeThread(thd->handle);
}
else
snprintf(buffer, len, "Terminated (exit code = %u)", status);
snprintf(buffer, len, "Terminated (exit code = %lu)", status);
}
else
{
@ -1297,7 +1297,7 @@ static enum packet_return packet_write_registers(struct gdb_context* gdbctx)
if (!backend->set_context(thread->handle, &ctx))
{
ERR("Failed to set context for tid %04x, error %u\n", thread->tid, GetLastError());
ERR("Failed to set context for tid %04lx, error %lu\n", thread->tid, GetLastError());
return packet_error;
}
@ -1463,7 +1463,7 @@ static enum packet_return packet_write_register(struct gdb_context* gdbctx)
cpu_register_hex_from(gdbctx, &ctx, reg, (const char**)&ptr);
if (!backend->set_context(thread->handle, &ctx))
{
ERR("Failed to set context for tid %04x, error %u\n", thread->tid, GetLastError());
ERR("Failed to set context for tid %04lx, error %lu\n", thread->tid, GetLastError());
return packet_error;
}
@ -1486,7 +1486,7 @@ static void packet_query_monitor_wnd_helper(struct gdb_context* gdbctx, HWND hWn
packet_reply_open(gdbctx);
packet_reply_add(gdbctx, "O");
snprintf(buffer, sizeof(buffer),
"%*s%04Ix%*s%-17.17s %08x %0*Ix %.14s\n",
"%*s%04Ix%*s%-17.17s %08lx %0*Ix %.14s\n",
indent, "", (ULONG_PTR)hWnd, 13 - indent, "",
clsName, GetWindowLongW(hWnd, GWL_STYLE),
addr_width(gdbctx), (ULONG_PTR)GetWindowLongPtrW(hWnd, GWLP_WNDPROC),
@ -1550,7 +1550,7 @@ static void packet_query_monitor_process(struct gdb_context* gdbctx, int len, co
packet_reply_open(gdbctx);
packet_reply_add(gdbctx, "O");
snprintf(buffer, sizeof(buffer),
"%c%08x %-8d %08x '%s'\n",
"%c%08lx %-8ld %08lx '%s'\n",
deco, entry.th32ProcessID, entry.cntThreads,
entry.th32ParentProcessID, entry.szExeFile);
packet_reply_hex_to_str(gdbctx, buffer);

View File

@ -392,7 +392,7 @@ static void info_window(HWND hWnd, int indent)
if (!GetWindowTextA(hWnd, wndName, sizeof(wndName)))
strcpy(wndName, "-- Empty --");
dbg_printf("%*s%08Ix%*s %-17.17s %08x %0*Ix %08x %.14s\n",
dbg_printf("%*s%08Ix%*s %-17.17s %08lx %0*Ix %08lx %.14s\n",
indent, "", (DWORD_PTR)hWnd, 12 - indent, "",
clsName, GetWindowLongW(hWnd, GWL_STYLE),
ADDRWIDTH, (ULONG_PTR)GetWindowLongPtrW(hWnd, GWLP_WNDPROC),
@ -435,8 +435,8 @@ void info_win32_window(HWND hWnd, BOOL detailed)
/* FIXME missing fields: hmemTaskQ, hrgnUpdate, dce, flags, pProp, scroll */
dbg_printf("next=%p child=%p parent=%p owner=%p class='%s'\n"
"inst=%p active=%p idmenu=%08Ix\n"
"style=0x%08x exstyle=0x%08x wndproc=%p text='%s'\n"
"client=%d,%d-%d,%d window=%d,%d-%d,%d sysmenu=%p\n",
"style=0x%08lx exstyle=0x%08lx wndproc=%p text='%s'\n"
"client=%ld,%ld-%ld,%ld window=%ld,%ld-%ld,%ld sysmenu=%p\n",
GetWindow(hWnd, GW_HWNDNEXT),
GetWindow(hWnd, GW_CHILD),
GetParent(hWnd),
@ -502,7 +502,7 @@ static void dump_proc_info(const struct dump_proc* dp, unsigned idx, unsigned de
{
assert(idx < dp->count);
dpe = &dp->entries[idx];
dbg_printf("%c%08x %-8d ",
dbg_printf("%c%08lx %-8ld ",
(dpe->proc.th32ProcessID == (dbg_curr_process ?
dbg_curr_process->pid : 0)) ? '>' : ' ',
dpe->proc.th32ProcessID, dpe->proc.cntThreads);
@ -616,11 +616,11 @@ void info_win32_threads(void)
else
exename = "";
dbg_printf("%08x%s %s\n",
dbg_printf("%08lx%s %s\n",
entry.th32OwnerProcessID, p ? " (D)" : "", exename);
lastProcessId = entry.th32OwnerProcessID;
}
dbg_printf("\t%08x %4d%s\n",
dbg_printf("\t%08lx %4ld%s\n",
entry.th32ThreadID, entry.tpBasePri,
(entry.th32ThreadID == dbg_curr_tid) ? " <==" : "");
@ -657,12 +657,12 @@ void info_win32_frame_exceptions(DWORD tid)
if (!thread)
{
dbg_printf("Unknown thread id (%04x) in current process\n", tid);
dbg_printf("Unknown thread id (%04lx) in current process\n", tid);
return;
}
if (SuspendThread(thread->handle) == -1)
{
dbg_printf("Can't suspend thread id (%04x)\n", tid);
dbg_printf("Can't suspend thread id (%04lx)\n", tid);
return;
}
}
@ -715,7 +715,7 @@ void info_win32_segments(DWORD start, int length)
flags[1] = (le.HighWord.Bits.Type & 0x2) ? 'w' : '-';
flags[2] = '-';
}
dbg_printf("%04x: sel=%04x base=%08x limit=%08x %d-bit %c%c%c\n",
dbg_printf("%04lx: sel=%04lx base=%08x limit=%08x %d-bit %c%c%c\n",
i, (i << 3) | 7,
(le.HighWord.Bits.BaseHi << 24) +
(le.HighWord.Bits.BaseMid << 16) + le.BaseLow,
@ -749,7 +749,7 @@ void info_win32_virtual(DWORD pid)
hProc = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid);
if (hProc == NULL)
{
dbg_printf("Cannot open process <%04x>\n", pid);
dbg_printf("Cannot open process <%04lx>\n", pid);
return;
}
}
@ -968,11 +968,11 @@ void info_win32_exception(void)
(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%0*Ix",
dbg_printf("C++ exception with strange parameter count %ld or magic 0x%0*Ix",
rec->NumberParameters, ADDRWIDTH, rec->ExceptionInformation[0]);
break;
default:
dbg_printf("0x%08x", rec->ExceptionCode);
dbg_printf("0x%08lx", rec->ExceptionCode);
break;
}
if (rec->ExceptionFlags & EH_STACK_INVALID)
@ -981,7 +981,7 @@ void info_win32_exception(void)
switch (addr.Mode)
{
case AddrModeFlat:
dbg_printf(" in %d-bit code (%s)",
dbg_printf(" in %ld-bit code (%s)",
dbg_curr_process->be_cpu->pointer_size * 8,
memory_offset_to_string(hexbuf, addr.Offset, 0));
break;

View File

@ -114,7 +114,7 @@ BOOL memory_write_value(const struct dbg_lvalue* lvalue, DWORD size, void* value
if (!types_get_info(&lvalue->type, TI_GET_LENGTH, &os)) return FALSE;
if (size != os)
{
dbg_printf("Size mismatch in memory_write_value, got %u from type while expecting %u\n",
dbg_printf("Size mismatch in memory_write_value, got %lu from type while expecting %lu\n",
(DWORD)os, size);
return FALSE;
}
@ -531,7 +531,7 @@ static void print_typed_basic(const struct dbg_lvalue* lvalue)
dbg_printf("%s", val_int ? "true" : "false");
break;
default:
WINE_FIXME("Unsupported basetype %u\n", bt);
WINE_FIXME("Unsupported basetype %lu\n", bt);
break;
}
break;
@ -619,7 +619,7 @@ static void print_typed_basic(const struct dbg_lvalue* lvalue)
}
break;
default:
WINE_FIXME("Unsupported tag %u\n", tag);
WINE_FIXME("Unsupported tag %lu\n", tag);
break;
}
}
@ -739,7 +739,7 @@ void print_address(const ADDRESS64* addr, BOOLEAN with_line)
il.SizeOfStruct = sizeof(il);
if (SymGetLineFromAddr64(dbg_curr_process->handle, lin, &disp, &il))
dbg_printf(" [%s:%u]", il.FileName, il.LineNumber);
dbg_printf(" [%s:%lu]", il.FileName, il.LineNumber);
if (im.SizeOfStruct == 0) /* don't display again module if address is in module+disp form */
{
im.SizeOfStruct = sizeof(im);
@ -828,6 +828,6 @@ BOOL memory_get_register(DWORD regno, DWORD_PTR** value, char* buffer, int len)
return TRUE;
}
}
if (buffer) snprintf(buffer, len, "<unknown register %u>", regno);
if (buffer) snprintf(buffer, len, "<unknown register %lu>", regno);
return FALSE;
}

View File

@ -288,7 +288,7 @@ static void stack_print_addr_and_args(void)
il.SizeOfStruct = sizeof(il);
if (SymGetLineFromInlineContext(dbg_curr_process->handle, frm->linear_pc, frm->inline_ctx,
0, &disp, &il))
dbg_printf(" [%s:%u]", il.FileName, il.LineNumber);
dbg_printf(" [%s:%lu]", il.FileName, il.LineNumber);
dbg_printf(" in %s", im.ModuleName);
}
else dbg_printf(" in %s (+0x%Ix)", im.ModuleName, frm->linear_pc - im.BaseOfImage);
@ -333,7 +333,7 @@ static void backtrace_tid(struct dbg_process* pcs, DWORD tid)
struct dbg_thread* thread = dbg_curr_thread;
if (!(dbg_curr_thread = dbg_get_thread(pcs, tid)))
dbg_printf("Unknown thread id (%04x) in process (%04x)\n", tid, pcs->pid);
dbg_printf("Unknown thread id (%04lx) in process (%04lx)\n", tid, pcs->pid);
else
{
dbg_ctx_t ctx = {{0}};
@ -343,7 +343,7 @@ static void backtrace_tid(struct dbg_process* pcs, DWORD tid)
{
if (!pcs->be_cpu->get_context(dbg_curr_thread->handle, &ctx))
{
dbg_printf("Can't get context for thread %04x in current process\n",
dbg_printf("Can't get context for thread %04lx in current process\n",
tid);
}
else
@ -353,7 +353,7 @@ static void backtrace_tid(struct dbg_process* pcs, DWORD tid)
}
ResumeThread(dbg_curr_thread->handle);
}
else dbg_printf("Can't suspend thread %04x in current process\n", tid);
else dbg_printf("Can't suspend thread %04lx in current process\n", tid);
}
dbg_curr_thread = thread;
dbg_curr_tid = thread ? thread->tid : 0;
@ -399,7 +399,7 @@ static void backtrace_all(void)
{
if (!dbg_attach_debuggee(entry.th32OwnerProcessID))
{
dbg_printf("\nwarning: could not attach to %04x\n",
dbg_printf("\nwarning: could not attach to %04lx\n",
entry.th32OwnerProcessID);
continue;
}
@ -407,7 +407,7 @@ static void backtrace_all(void)
dbg_active_wait_for_first_exception();
}
dbg_printf("\nBacktracing for thread %04x in process %04x (%s):\n",
dbg_printf("\nBacktracing for thread %04lx in process %04lx (%s):\n",
entry.th32ThreadID, dbg_curr_pid,
dbg_W2A(dbg_curr_process->imageName, -1));
backtrace_tid(dbg_curr_process, entry.th32ThreadID);

View File

@ -597,7 +597,7 @@ enum dbg_line_status symbol_get_function_line_status(const ADDRESS64* addr)
case SymTagFunction:
case SymTagPublicSymbol: break;
default:
WINE_FIXME("Unexpected sym-tag 0x%08x\n", sym->Tag);
WINE_FIXME("Unexpected sym-tag 0x%08lx\n", sym->Tag);
case SymTagData:
return dbg_no_line_info;
}

View File

@ -74,7 +74,7 @@ BOOL dbg_attach_debuggee(DWORD pid)
if (!DebugActiveProcess(pid))
{
dbg_printf("Can't attach process %04x: error %u\n", pid, GetLastError());
dbg_printf("Can't attach process %04lx: error %lu\n", pid, GetLastError());
dbg_del_process(dbg_curr_process);
return FALSE;
}
@ -196,7 +196,7 @@ static BOOL dbg_exception_prolog(BOOL is_debug, const EXCEPTION_RECORD* rec)
HeapFree(GetProcessHeap(), 0, last_file);
last_name = strcpy(HeapAlloc(GetProcessHeap(), 0, strlen(si->Name) + 1), si->Name);
last_file = strcpy(HeapAlloc(GetProcessHeap(), 0, strlen(il.FileName) + 1), il.FileName);
dbg_printf("%s () at %s:%u\n", last_name, last_file, il.LineNumber);
dbg_printf("%s () at %s:%lu\n", last_name, last_file, il.LineNumber);
}
}
}
@ -234,7 +234,7 @@ static DWORD dbg_handle_exception(const EXCEPTION_RECORD* rec, BOOL first_chance
assert(dbg_curr_thread);
WINE_TRACE("exception=%x first_chance=%c\n",
WINE_TRACE("exception=%lx first_chance=%c\n",
rec->ExceptionCode, first_chance ? 'Y' : 'N');
switch (rec->ExceptionCode)
@ -251,11 +251,11 @@ static DWORD dbg_handle_exception(const EXCEPTION_RECORD* rec, BOOL first_chance
pThread = dbg_get_thread(dbg_curr_process, pThreadName->dwThreadID);
if(!pThread)
{
dbg_printf("Thread ID=%04x not in our list of threads -> can't rename\n", pThreadName->dwThreadID);
dbg_printf("Thread ID=%04lx not in our list of threads -> can't rename\n", pThreadName->dwThreadID);
return DBG_CONTINUE;
}
if (dbg_read_memory(pThreadName->szName, pThread->name, 9))
dbg_printf("Thread ID=%04x renamed using MS VC6 extension (name==\"%.9s\")\n",
dbg_printf("Thread ID=%04lx renamed using MS VC6 extension (name==\"%.9s\")\n",
pThread->tid, pThread->name);
return DBG_CONTINUE;
case EXCEPTION_INVALID_HANDLE:
@ -332,12 +332,12 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
case EXCEPTION_DEBUG_EVENT:
if (!dbg_curr_thread)
{
WINE_ERR("%04x:%04x: not a registered process or thread (perhaps a 16 bit one ?)\n",
WINE_ERR("%04lx:%04lx: not a registered process or thread (perhaps a 16 bit one ?)\n",
de->dwProcessId, de->dwThreadId);
break;
}
WINE_TRACE("%04x:%04x: exception code=%08x\n",
WINE_TRACE("%04lx:%04lx: exception code=%08lx\n",
de->dwProcessId, de->dwThreadId,
de->u.Exception.ExceptionRecord.ExceptionCode);
@ -373,7 +373,7 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
swprintf(u.buffer, ARRAY_SIZE(u.buffer), L"Process_%08x", dbg_curr_pid);
}
WINE_TRACE("%04x:%04x: create process '%s'/%p @%p (%u<%u>)\n",
WINE_TRACE("%04lx:%04lx: create process '%s'/%p @%p (%lu<%lu>)\n",
de->dwProcessId, de->dwThreadId,
wine_dbgstr_w(u.buffer),
de->u.CreateProcessInfo.lpImageName,
@ -386,9 +386,9 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
dbg_printf("Couldn't initiate DbgHelp\n");
if (!dbg_load_module(dbg_curr_process->handle, de->u.CreateProcessInfo.hFile, u.buffer,
(DWORD_PTR)de->u.CreateProcessInfo.lpBaseOfImage, 0))
dbg_printf("couldn't load main module (%u)\n", GetLastError());
dbg_printf("couldn't load main module (%lu)\n", GetLastError());
WINE_TRACE("%04x:%04x: create thread I @%p\n",
WINE_TRACE("%04lx:%04lx: create thread I @%p\n",
de->dwProcessId, de->dwThreadId, de->u.CreateProcessInfo.lpStartAddress);
dbg_curr_thread = dbg_add_thread(dbg_curr_process,
@ -405,7 +405,7 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
break;
case EXIT_PROCESS_DEBUG_EVENT:
WINE_TRACE("%04x:%04x: exit process (%d)\n",
WINE_TRACE("%04lx:%04lx: exit process (%ld)\n",
de->dwProcessId, de->dwThreadId, de->u.ExitProcess.dwExitCode);
if (dbg_curr_process == NULL)
@ -414,11 +414,11 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
break;
}
tgt_process_active_close_process(dbg_curr_process, FALSE);
dbg_printf("Process of pid=%04x has terminated\n", de->dwProcessId);
dbg_printf("Process of pid=%04lx has terminated\n", de->dwProcessId);
break;
case CREATE_THREAD_DEBUG_EVENT:
WINE_TRACE("%04x:%04x: create thread D @%p\n",
WINE_TRACE("%04lx:%04lx: create thread D @%p\n",
de->dwProcessId, de->dwThreadId, de->u.CreateThread.lpStartAddress);
if (dbg_curr_process == NULL)
@ -445,7 +445,7 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
break;
case EXIT_THREAD_DEBUG_EVENT:
WINE_TRACE("%04x:%04x: exit thread (%d)\n",
WINE_TRACE("%04lx:%04lx: exit thread (%ld)\n",
de->dwProcessId, de->dwThreadId, de->u.ExitThread.dwExitCode);
if (dbg_curr_thread == NULL)
@ -466,7 +466,7 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
fetch_module_name(de->u.LoadDll.lpImageName, de->u.LoadDll.lpBaseOfDll,
u.buffer, ARRAY_SIZE(u.buffer));
WINE_TRACE("%04x:%04x: loads DLL %s @%p (%u<%u>)\n",
WINE_TRACE("%04lx:%04lx: loads DLL %s @%p (%lu<%lu>)\n",
de->dwProcessId, de->dwThreadId,
wine_dbgstr_w(u.buffer), de->u.LoadDll.lpBaseOfDll,
de->u.LoadDll.dwDebugInfoFileOffset,
@ -485,7 +485,7 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
break;
case UNLOAD_DLL_DEBUG_EVENT:
WINE_TRACE("%04x:%04x: unload DLL @%p\n",
WINE_TRACE("%04lx:%04lx: unload DLL @%p\n",
de->dwProcessId, de->dwThreadId,
de->u.UnloadDll.lpBaseOfDll);
break_delete_xpoints_from_module((DWORD_PTR)de->u.UnloadDll.lpBaseOfDll);
@ -502,18 +502,18 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
memory_get_string(dbg_curr_process,
de->u.DebugString.lpDebugStringData, TRUE,
de->u.DebugString.fUnicode, u.bufferA, sizeof(u.bufferA));
WINE_TRACE("%04x:%04x: output debug string (%s)\n",
WINE_TRACE("%04lx:%04lx: output debug string (%s)\n",
de->dwProcessId, de->dwThreadId, u.bufferA);
break;
case RIP_EVENT:
WINE_TRACE("%04x:%04x: rip error=%u type=%u\n",
WINE_TRACE("%04lx:%04lx: rip error=%lu type=%lu\n",
de->dwProcessId, de->dwThreadId, de->u.RipInfo.dwError,
de->u.RipInfo.dwType);
break;
default:
WINE_TRACE("%04x:%04x: unknown event (%x)\n",
WINE_TRACE("%04lx:%04lx: unknown event (%lx)\n",
de->dwProcessId, de->dwThreadId, de->dwDebugEventCode);
}
if (!cont) return TRUE; /* stop execution */
@ -537,12 +537,12 @@ static void dbg_resume_debuggee(DWORD cont)
if (dbg_curr_thread)
{
if (!dbg_curr_process->be_cpu->set_context(dbg_curr_thread->handle, &dbg_context))
dbg_printf("Cannot set ctx on %04x\n", dbg_curr_tid);
dbg_printf("Cannot set ctx on %04lx\n", dbg_curr_tid);
}
}
dbg_interactiveP = FALSE;
if (!ContinueDebugEvent(dbg_curr_pid, dbg_curr_tid, cont))
dbg_printf("Cannot continue on %04x (%08x)\n", dbg_curr_tid, cont);
dbg_printf("Cannot continue on %04lx (%08lx)\n", dbg_curr_tid, cont);
}
static void wait_exception(void)
@ -836,7 +836,7 @@ static const char *get_windows_version(void)
}
}
snprintf( str, sizeof(str), "%d.%d (%d)", info.dwMajorVersion,
snprintf( str, sizeof(str), "%ld.%ld (%d)", info.dwMajorVersion,
info.dwMinorVersion, info.wProductType );
return str;
}

View File

@ -245,7 +245,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data)
const char *str;
char tmp[128];
dbg_printf("WineDbg starting on minidump on pid %04x\n", pid);
dbg_printf("WineDbg starting on minidump on pid %04lx\n", pid);
switch (msi->ProcessorArchitecture)
{
case PROCESSOR_ARCHITECTURE_UNKNOWN:
@ -379,7 +379,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data)
break;
default: str = "???"; break;
}
dbg_printf(" on Windows %s (%u)\n", str, msi->BuildNumber);
dbg_printf(" on Windows %s (%lu)\n", str, msi->BuildNumber);
/* FIXME CSD: msi->CSDVersionRva */
if (sizeof(MINIDUMP_SYSTEM_INFO) + 4 > dir->Location.DataSize &&

View File

@ -68,7 +68,7 @@ dbg_lgint_t types_extract_as_lgint(const struct dbg_lvalue* lvalue,
{
return (LONG_PTR)memory_to_linear_addr(&lvalue->addr);
}
if (tag != SymTagBaseType && lvalue->bitlen) dbg_printf("Unexpected bitfield on tag %d\n", tag);
if (tag != SymTagBaseType && lvalue->bitlen) dbg_printf("Unexpected bitfield on tag %ld\n", tag);
if (psize) *psize = 0;
if (issigned) *issigned = FALSE;
@ -124,7 +124,7 @@ dbg_lgint_t types_extract_as_lgint(const struct dbg_lvalue* lvalue,
rtn = (ULONG_PTR)memory_to_linear_addr(&lvalue->addr);
break;
default:
WINE_FIXME("Unsupported tag %u\n", tag);
WINE_FIXME("Unsupported tag %lu\n", tag);
RaiseException(DEBUG_STATUS_NOT_AN_INTEGER, 0, 0, NULL);
}
@ -540,7 +540,7 @@ void print_value(const struct dbg_lvalue* lvalue, char format, int level)
print_value(&lvalue_field, format, level);
break;
default:
WINE_FIXME("Unknown tag (%u)\n", tag);
WINE_FIXME("Unknown tag (%lu)\n", tag);
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
break;
}
@ -555,7 +555,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: %0*Ix ID: %08x\n", ADDRWIDTH, type.module, type.id);
dbg_printf("Mod: %0*Ix ID: %08lx\n", ADDRWIDTH, type.module, type.id);
types_print_type(&type, TRUE);
dbg_printf("\n");
return TRUE;
@ -586,7 +586,7 @@ BOOL types_print_type(const struct dbg_type* type, BOOL details)
if (type->id == dbg_itype_none || !types_get_info(type, TI_GET_SYMTAG, &tag))
{
dbg_printf("--invalid--<%xh>--", type->id);
dbg_printf("--invalid--<%lxh>--", type->id);
return FALSE;
}
@ -610,7 +610,7 @@ BOOL types_print_type(const struct dbg_type* type, BOOL details)
case UdtStruct: dbg_printf("struct %ls", name); break;
case UdtUnion: dbg_printf("union %ls", name); break;
case UdtClass: dbg_printf("class %ls", name); break;
default: WINE_ERR("Unsupported UDT type (%d) for %ls\n", udt, name); break;
default: WINE_ERR("Unsupported UDT type (%ld) for %ls\n", udt, name); break;
}
if (details &&
types_get_info(type, TI_GET_CHILDRENCOUNT, &count))
@ -654,7 +654,7 @@ BOOL types_print_type(const struct dbg_type* type, BOOL details)
subtype.module = type->module;
types_print_type(&subtype, details);
if (types_get_info(type, TI_GET_COUNT, &count))
dbg_printf(" %ls[%d]", name, count);
dbg_printf(" %ls[%ld]", name, count);
else
dbg_printf(" %ls[]", name);
break;
@ -706,7 +706,7 @@ BOOL types_print_type(const struct dbg_type* type, BOOL details)
dbg_printf("%ls", name);
break;
default:
WINE_ERR("Unknown type %u for %ls\n", tag, name);
WINE_ERR("Unknown type %lu for %ls\n", tag, name);
break;
}
@ -744,7 +744,7 @@ BOOL types_get_info(const struct dbg_type* type, IMAGEHLP_SYMBOL_TYPE_INFO ti, v
case btLong: name = L"long int"; break;
case btULong: name = L"unsigned long int"; break;
case btComplex: name = L"complex"; break;
default: WINE_FIXME("Unsupported basic type %u\n", bt); return FALSE;
default: WINE_FIXME("Unsupported basic type %lu\n", bt); return FALSE;
}
X(WCHAR*) = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(name) + 1) * sizeof(WCHAR));
if (X(WCHAR*))
@ -913,7 +913,7 @@ BOOL types_get_info(const struct dbg_type* type, IMAGEHLP_SYMBOL_TYPE_INFO ti, v
default: WINE_FIXME("unsupported %u for XMM register\n", ti); return FALSE;
}
break;
default: WINE_FIXME("unsupported type id 0x%x\n", type->id);
default: WINE_FIXME("unsupported type id 0x%lx\n", type->id);
}
#undef X
@ -1053,7 +1053,7 @@ BOOL types_compare(struct dbg_type type1, struct dbg_type type2, BOOL* equal)
/* compare argument type */
break;
default:
dbg_printf("Unsupported yet tag %d\n", tag1);
dbg_printf("Unsupported yet tag %ld\n", tag1);
return FALSE;
}
} while (types_get_info(&type1, TI_GET_TYPE, &type1.id) &&

View File

@ -451,7 +451,7 @@ struct dbg_thread* dbg_add_thread(struct dbg_process* p, DWORD tid,
t->addr_mode = AddrModeFlat;
t->suspended = FALSE;
snprintf(t->name, sizeof(t->name), "%04x", tid);
snprintf(t->name, sizeof(t->name), "%04lx", tid);
list_add_head(&p->threads, &t->entry);
@ -569,7 +569,7 @@ void dbg_start_interactive(const char* filename, HANDLE hFile)
if (dbg_curr_process)
{
dbg_printf("WineDbg starting on pid %04x\n", dbg_curr_pid);
dbg_printf("WineDbg starting on pid %04lx\n", dbg_curr_pid);
if (dbg_curr_process->active_debuggee) dbg_active_wait_for_first_exception();
}
@ -614,7 +614,7 @@ static void restart_if_wow64(void)
GetExitCodeProcess( pi.hProcess, &exit_code );
ExitProcess( exit_code );
}
else WINE_ERR( "failed to restart 64-bit %s, err %d\n", wine_dbgstr_w(filename), GetLastError() );
else WINE_ERR( "failed to restart 64-bit %s, err %ld\n", wine_dbgstr_w(filename), GetLastError() );
Wow64RevertWow64FsRedirection( redir );
}
}
@ -680,7 +680,7 @@ int main(int argc, char** argv)
hFile = parser_generate_command_file(argv[0], NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
dbg_printf("Couldn't open temp file (%u)\n", GetLastError());
dbg_printf("Couldn't open temp file (%lu)\n", GetLastError());
return 1;
}
argc--; argv++;
@ -694,7 +694,7 @@ int main(int argc, char** argv)
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (hFile == INVALID_HANDLE_VALUE)
{
dbg_printf("Couldn't open file %s (%u)\n", argv[0], GetLastError());
dbg_printf("Couldn't open file %s (%lu)\n", argv[0], GetLastError());
return 1;
}
argc--; argv++;