diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y index 190c1063633..c88d3e8fd05 100644 --- a/programs/winedbg/dbg.y +++ b/programs/winedbg/dbg.y @@ -59,7 +59,7 @@ static int dbg_error(const char*); %token tSTEPI tNEXTI tFINISH tSHOW tDIR tWHATIS tSOURCE %token tPATH tIDENTIFIER tSTRING tDEBUGSTR tINTVAR %token 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 diff --git a/programs/winedbg/debug.l b/programs/winedbg/debug.l index 66fe70dd128..3a47a17a25d 100644 --- a/programs/winedbg/debug.l +++ b/programs/winedbg/debug.l @@ -183,6 +183,7 @@ STRING \"[^\n"]+\" whatis|whati|what { BEGIN(NOCMD); return tWHATIS; } run|ru|r { BEGIN(ASTRING_EXPECTED); return tRUN;} detach|detac|deta|det { BEGIN(NOCMD); return tDETACH; } +kill|kil|ki|k { BEGIN(NOCMD); return tKILL; } maintenance|maint { BEGIN(MAINT_CMD); return tMAINTENANCE; } minidump|mdmp { BEGIN(PATH_EXPECTED); return tMINIDUMP; } echo { BEGIN(ASTRING_EXPECTED); return tECHO; } diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c index 9cb0a56b915..f5ea8f20c00 100644 --- a/programs/winedbg/tgt_active.c +++ b/programs/winedbg/tgt_active.c @@ -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);