winedbg: Fixed regression for command 'bt all'.

Don't print 'process has terminated' message when detaching from a
process (or backtracing it).
This commit is contained in:
Eric Pouech 2006-05-14 18:08:43 +02:00 committed by Alexandre Julliard
parent 0ddd1c9e18
commit bf8509d37c
2 changed files with 9 additions and 2 deletions

View File

@ -313,7 +313,11 @@ static void backtrace_tid(struct dbg_process* pcs, DWORD tid)
dbg_printf("Can't get context for thread 0x%lx in current process\n", dbg_printf("Can't get context for thread 0x%lx in current process\n",
tid); tid);
} }
else backtrace(); else
{
stack_fetch_frames();
backtrace();
}
ResumeThread(dbg_curr_thread->handle); ResumeThread(dbg_curr_thread->handle);
} }
else dbg_printf("Can't suspend thread 0x%lx in current process\n", tid); else dbg_printf("Can't suspend thread 0x%lx in current process\n", tid);
@ -331,6 +335,7 @@ static void backtrace_tid(struct dbg_process* pcs, DWORD tid)
*/ */
static void backtrace_all(void) static void backtrace_all(void)
{ {
struct dbg_process* process = dbg_curr_process;
THREADENTRY32 entry; THREADENTRY32 entry;
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0); HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
@ -370,6 +375,8 @@ static void backtrace_all(void)
dbg_curr_process->process_io->close_process(dbg_curr_process, FALSE); dbg_curr_process->process_io->close_process(dbg_curr_process, FALSE);
} }
CloseHandle(snapshot); CloseHandle(snapshot);
dbg_curr_process = process;
dbg_curr_pid = process ? process->pid : 0;
} }
void stack_backtrace(DWORD tid) void stack_backtrace(DWORD tid)

View File

@ -490,6 +490,7 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
break; break;
} }
tgt_process_active_close_process(dbg_curr_process, FALSE); tgt_process_active_close_process(dbg_curr_process, FALSE);
dbg_printf("Process of pid=0x%08lx has terminated\n", de->dwProcessId);
break; break;
case CREATE_THREAD_DEBUG_EVENT: case CREATE_THREAD_DEBUG_EVENT:
@ -917,7 +918,6 @@ static BOOL tgt_process_active_close_process(struct dbg_process* pcs, BOOL kill)
if (!kill && !DebugActiveProcessStop(dbg_curr_pid)) return FALSE; if (!kill && !DebugActiveProcessStop(dbg_curr_pid)) return FALSE;
} }
SymCleanup(pcs->handle); SymCleanup(pcs->handle);
dbg_printf("Process of pid=0x%08lx has terminated\n", pcs->pid);
dbg_del_process(pcs); dbg_del_process(pcs);
return TRUE; return TRUE;