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

Alexandre Julliard julliard at winehq.org
Mon Jan 16 13:01:32 CST 2012


Module: wine
Branch: master
Commit: fbd08d5914336647679783465b0bf2b5ae6e85e7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fbd08d5914336647679783465b0bf2b5ae6e85e7

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jan 16 14:05:20 2012 +0100

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

---

 programs/winedbg/tgt_active.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c
index 376ee22..8302e8e 100644
--- a/programs/winedbg/tgt_active.c
+++ b/programs/winedbg/tgt_active.c
@@ -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;




More information about the wine-cvs mailing list