Jacek Caban : winedbg: Move continue_on_first_exception handling out of dbg_attach_debuggee.

Alexandre Julliard julliard at winehq.org
Tue Jul 2 15:32:02 CDT 2019


Module: wine
Branch: master
Commit: 136a0ac49b419af5510ec5c55d3a65e2cbe79d6a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=136a0ac49b419af5510ec5c55d3a65e2cbe79d6a

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Jul  2 18:01:13 2019 +0200

winedbg: Move continue_on_first_exception handling out of dbg_attach_debuggee.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/winedbg/dbg.y        | 2 +-
 programs/winedbg/debugger.h   | 2 +-
 programs/winedbg/stack.c      | 2 +-
 programs/winedbg/tgt_active.c | 8 ++++----
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y
index 6b080a5..126eef2 100644
--- a/programs/winedbg/dbg.y
+++ b/programs/winedbg/dbg.y
@@ -137,7 +137,7 @@ command:
     | tSYMBOLFILE pathname     	{ symbol_read_symtable($2, 0); }
     | tSYMBOLFILE pathname expr_rvalue { symbol_read_symtable($2, $3); }
     | 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(); }
+    | tATTACH tNUM     		{ dbg_attach_debuggee($2); 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);}
diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h
index 490bd06..ee33ca0 100644
--- a/programs/winedbg/debugger.h
+++ b/programs/winedbg/debugger.h
@@ -431,7 +431,7 @@ extern enum dbg_start   dbg_active_launch(int argc, char* argv[]);
 extern enum dbg_start   dbg_active_auto(int argc, char* argv[]);
 extern enum dbg_start   dbg_active_minidump(int argc, char* argv[]);
 extern void             dbg_active_wait_for_first_exception(void);
-extern BOOL             dbg_attach_debuggee(DWORD pid, BOOL cofe);
+extern BOOL             dbg_attach_debuggee(DWORD pid);
 
   /* tgt_minidump.c */
 extern void             minidump_write(const char*, const EXCEPTION_RECORD*);
diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c
index ed02c33..f76996d 100644
--- a/programs/winedbg/stack.c
+++ b/programs/winedbg/stack.c
@@ -412,7 +412,7 @@ static void backtrace_all(void)
             }
             else if (entry.th32OwnerProcessID != dbg_curr_pid)
             {
-                if (!dbg_attach_debuggee(entry.th32OwnerProcessID, FALSE))
+                if (!dbg_attach_debuggee(entry.th32OwnerProcessID))
                 {
                     dbg_printf("\nwarning: could not attach to %04x\n",
                                entry.th32OwnerProcessID);
diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c
index 5385d0e..f2ea753 100644
--- a/programs/winedbg/tgt_active.c
+++ b/programs/winedbg/tgt_active.c
@@ -71,7 +71,7 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de);
  * wfe is set to TRUE if dbg_attach_debuggee should also proceed with all debug events
  * until the first exception is received (aka: attach to an already running process)
  */
-BOOL dbg_attach_debuggee(DWORD pid, BOOL cofe)
+BOOL dbg_attach_debuggee(DWORD pid)
 {
     if (!(dbg_curr_process = dbg_add_process(&be_process_active_io, pid, 0))) return FALSE;
 
@@ -81,7 +81,6 @@ BOOL dbg_attach_debuggee(DWORD pid, BOOL cofe)
         dbg_del_process(dbg_curr_process);
 	return FALSE;
     }
-    dbg_curr_process->continue_on_first_exception = cofe;
 
     SetEnvironmentVariableA("DBGHELP_NOLIVE", NULL);
 
@@ -776,19 +775,20 @@ enum dbg_start  dbg_active_attach(int argc, char* argv[])
     /* try the form <myself> pid */
     if (argc == 1 && str2int(argv[0], &pid) && pid != 0)
     {
-        if (!dbg_attach_debuggee(pid, FALSE))
+        if (!dbg_attach_debuggee(pid))
             return start_error_init;
     }
     /* try the form <myself> pid evt (Win32 JIT debugger) */
     else if (argc == 2 && str2int(argv[0], &pid) && pid != 0 &&
              str2int(argv[1], &evt) && evt != 0)
     {
-        if (!dbg_attach_debuggee(pid, TRUE))
+        if (!dbg_attach_debuggee(pid))
         {
             /* don't care about result */
             SetEvent((HANDLE)evt);
             return start_error_init;
         }
+        dbg_curr_process->continue_on_first_exception = TRUE;
         if (!SetEvent((HANDLE)evt))
         {
             WINE_ERR("Invalid event handle: %lx\n", evt);




More information about the wine-cvs mailing list