Ge van Geldorp wrote:
diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c index b976117..c2dec5f 100644 --- a/programs/winedbg/stack.c +++ b/programs/winedbg/stack.c @@ -127,9 +127,14 @@ BOOL stack_get_current_symbol(SYMBOL_INF static BOOL CALLBACK stack_read_mem(HANDLE hProc, DWORD addr, PVOID buffer, DWORD size, PDWORD written) {
- SIZE_T sz;
- BOOL ret;
- struct dbg_process* pcs = dbg_get_process_h(hProc); if (!pcs) return FALSE;
- return pcs->process_io->read(hProc, (const void*)addr, buffer, size, written);
- ret = pcs->process_io->read(hProc, (const void*)addr, buffer, size, &sz);
- if (written != NULL) *written = sz;
- return ret;
}
/******************************************************************
this one is questionnable. Now that we have stackwalk64 implemented (I'm not saying it works flawlessly on 64bit machines), it may be more interesting here to use the 64 bit version of the call back A+
From: Eric Pouech [mailto:eric.pouech@wanadoo.fr]
this one is questionnable. Now that we have stackwalk64 implemented (I'm not saying it works flawlessly on 64bit machines), it may be more interesting here to use the 64 bit version of the call back
That's actually a separate issue. The problem I'm trying to solve here is that the last parameter of ReadProcessMemory (which is the API that is eventually called by pcs->process_io->read()) is defined as SIZE_T *, which expands to a pointer to 8 bytes on Win64. The last parameter of the ReadMemoryRoutine callback of StackWalk is PDWORD, pointer to 4 bytes. So you can't pass the last parameter of the ReadMemoryRoutine callback on to pcs->process_io->read(), you'd write 8 bytes to a 4 byte variable.
Unfortunately, switching to StackWalk64 doesn't solve this. The last parameter of the ReadMemoryRoutine callback of StackWalk is still a pointer to 4 bytes (PDWORD in Wine, LPDWORD in PSDK). Switching to StackWalk64 is ofcourse a good idea, but we still need the patch as submitted.
Gé van Geldorp.
Ge van Geldorp wrote:
From: Eric Pouech [mailto:eric.pouech@wanadoo.fr]
this one is questionnable. Now that we have stackwalk64 implemented (I'm not saying it works flawlessly on 64bit machines), it may be more interesting here to use the 64 bit version of the call back
That's actually a separate issue. The problem I'm trying to solve here is that the last parameter of ReadProcessMemory (which is the API that is eventually called by pcs->process_io->read()) is defined as SIZE_T *, which expands to a pointer to 8 bytes on Win64. The last parameter of the ReadMemoryRoutine callback of StackWalk is PDWORD, pointer to 4 bytes. So you can't pass the last parameter of the ReadMemoryRoutine callback on to pcs->process_io->read(), you'd write 8 bytes to a 4 byte variable.
I read it too quickly, you're right.