winedbg: Add a kill command to kill the current process.
This commit is contained in:
parent
758f799205
commit
0c4e9df2a1
|
@ -59,7 +59,7 @@ static int dbg_error(const char*);
|
|||
%token tSTEPI tNEXTI tFINISH tSHOW tDIR tWHATIS tSOURCE
|
||||
%token <string> tPATH tIDENTIFIER tSTRING tDEBUGSTR tINTVAR
|
||||
%token <integer> tNUM tFORMAT
|
||||
%token tSYMBOLFILE tRUN tATTACH tDETACH tMAINTENANCE tTYPE tMINIDUMP
|
||||
%token tSYMBOLFILE tRUN tATTACH tDETACH tKILL tMAINTENANCE tTYPE tMINIDUMP
|
||||
%token tNOPROCESS
|
||||
|
||||
%token tCHAR tSHORT tINT tLONG tFLOAT tDOUBLE tUNSIGNED tSIGNED
|
||||
|
@ -141,6 +141,7 @@ command:
|
|||
| tWHATIS expr_lvalue { dbg_printf("type = "); types_print_type(&$2.type, FALSE); dbg_printf("\n"); }
|
||||
| tATTACH tNUM { dbg_attach_debuggee($2, FALSE); dbg_active_wait_for_first_exception(); }
|
||||
| tDETACH { dbg_curr_process->process_io->close_process(dbg_curr_process, FALSE); }
|
||||
| tKILL { dbg_curr_process->process_io->close_process(dbg_curr_process, TRUE); }
|
||||
| tMINIDUMP pathname { minidump_write($2, (dbg_curr_thread && dbg_curr_thread->in_exception) ? &dbg_curr_thread->excpt_record : NULL);}
|
||||
| tECHO tSTRING { dbg_printf("%s\n", $2); }
|
||||
| run_command
|
||||
|
|
|
@ -183,6 +183,7 @@ STRING \"[^\n"]+\"
|
|||
<INITIAL>whatis|whati|what { BEGIN(NOCMD); return tWHATIS; }
|
||||
<INITIAL,NOPROCESS>run|ru|r { BEGIN(ASTRING_EXPECTED); return tRUN;}
|
||||
<INITIAL>detach|detac|deta|det { BEGIN(NOCMD); return tDETACH; }
|
||||
<INITIAL>kill|kil|ki|k { BEGIN(NOCMD); return tKILL; }
|
||||
<INITIAL,NOPROCESS>maintenance|maint { BEGIN(MAINT_CMD); return tMAINTENANCE; }
|
||||
<INITIAL>minidump|mdmp { BEGIN(PATH_EXPECTED); return tMINIDUMP; }
|
||||
<INITIAL>echo { BEGIN(ASTRING_EXPECTED); return tECHO; }
|
||||
|
|
|
@ -979,7 +979,14 @@ static BOOL tgt_process_active_close_process(struct dbg_process* pcs, BOOL kill)
|
|||
SetThreadContext(dbg_curr_thread->handle, &dbg_context);
|
||||
ContinueDebugEvent(dbg_curr_pid, dbg_curr_tid, DBG_CONTINUE);
|
||||
}
|
||||
if (!kill && !DebugActiveProcessStop(dbg_curr_pid)) return FALSE;
|
||||
}
|
||||
if (kill)
|
||||
{
|
||||
TerminateProcess(pcs->handle, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!DebugActiveProcessStop(pcs->pid)) return FALSE;
|
||||
}
|
||||
SymCleanup(pcs->handle);
|
||||
dbg_del_process(pcs);
|
||||
|
|
Loading…
Reference in New Issue