Commit e4e7186b authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

Fix debugger for flat PC and non-flat frame.

parent e85b67bd
......@@ -113,6 +113,13 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread,
{
THREAD_BASIC_INFORMATION info;
if ((frame->AddrPC.Mode == AddrModeFlat) &&
(frame->AddrFrame.Mode != AddrModeFlat))
{
WARN("Bad AddrPC.Mode / AddrFrame.Mode combination\n");
goto done_err;
}
/* Init done */
curr_mode = (frame->AddrPC.Mode == AddrModeFlat) ?
stm_32bit : stm_16bit;
......
......@@ -188,6 +188,13 @@ void stack_backtrace(DWORD tid, BOOL noisy)
memory_get_current_frame(&sf.AddrFrame);
memory_get_current_pc(&sf.AddrPC);
/* don't confuse StackWalk by passing in inconsistent addresses */
if ((sf.AddrPC.Mode == AddrModeFlat) && (sf.AddrFrame.Mode != AddrModeFlat))
{
sf.AddrFrame.Offset = (DWORD)memory_to_linear_addr(&sf.AddrFrame);
sf.AddrFrame.Mode = AddrModeFlat;
}
if (noisy) dbg_printf("Backtrace:\n");
while (StackWalk(IMAGE_FILE_MACHINE_I386, dbg_curr_process->handle,
thread->handle, &sf, &dbg_context, NULL, SymFunctionTableAccess,
......
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