winedbg: Kill the whole target process on exit in auto mode.

This commit is contained in:
Alexandre Julliard 2012-01-16 14:05:20 +01:00
parent 6d2063f41b
commit fbd08d5914
1 changed files with 11 additions and 6 deletions

View File

@ -774,7 +774,7 @@ enum dbg_start dbg_active_auto(int argc, char* argv[])
hFile = parser_generate_command_file("echo Modules:", "info share",
"echo Threads:", "info threads",
"backtrace", "detach", NULL);
"kill", NULL);
}
else if (!strcmp(argv[0], "--minidump"))
{
@ -839,7 +839,16 @@ enum dbg_start dbg_active_auto(int argc, char* argv[])
static BOOL tgt_process_active_close_process(struct dbg_process* pcs, BOOL kill)
{
if (pcs == dbg_curr_process)
if (kill)
{
DWORD exit_code = 0;
if (pcs == dbg_curr_process && dbg_curr_thread->in_exception)
exit_code = dbg_curr_thread->excpt_record.ExceptionCode;
TerminateProcess(pcs->handle, exit_code);
}
else if (pcs == dbg_curr_process)
{
/* remove all set breakpoints in debuggee code */
break_set_xpoints(FALSE);
@ -853,10 +862,6 @@ static BOOL tgt_process_active_close_process(struct dbg_process* pcs, BOOL kill)
ContinueDebugEvent(dbg_curr_pid, dbg_curr_tid, DBG_CONTINUE);
}
}
if (kill)
{
TerminateProcess(pcs->handle, 0);
}
else
{
if (!DebugActiveProcessStop(pcs->pid)) return FALSE;