Eric Pouech : winedbg: Fixed regression for command 'bt all'.

Alexandre Julliard julliard at wine.codeweavers.com
Mon May 15 04:51:50 CDT 2006


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

Author: Eric Pouech <eric.pouech at wanadoo.fr>
Date:   Sun May 14 18:08:43 2006 +0200

winedbg: Fixed regression for command 'bt all'.

Don't print 'process has terminated' message when detaching from a
process (or backtracing it).

---

 programs/winedbg/stack.c      |    9 ++++++++-
 programs/winedbg/tgt_active.c |    2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c
index a6a37d1..72e140c 100644
--- a/programs/winedbg/stack.c
+++ b/programs/winedbg/stack.c
@@ -313,7 +313,11 @@ static void backtrace_tid(struct dbg_pro
                 dbg_printf("Can't get context for thread 0x%lx in current process\n",
                            tid);
             }
-            else backtrace();
+            else
+            {
+                stack_fetch_frames();
+                backtrace();
+            }
             ResumeThread(dbg_curr_thread->handle);
         }
         else dbg_printf("Can't suspend thread 0x%lx in current process\n", tid);
@@ -331,6 +335,7 @@ static void backtrace_tid(struct dbg_pro
  */
 static void backtrace_all(void)
 {
+    struct dbg_process* process = dbg_curr_process;
     THREADENTRY32       entry;
     HANDLE              snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
 
@@ -370,6 +375,8 @@ static void backtrace_all(void)
             dbg_curr_process->process_io->close_process(dbg_curr_process, FALSE);
     }
     CloseHandle(snapshot);
+    dbg_curr_process = process;
+    dbg_curr_pid = process ? process->pid : 0;
 }
 
 void stack_backtrace(DWORD tid)
diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c
index cdd50ad..ea7f22b 100644
--- a/programs/winedbg/tgt_active.c
+++ b/programs/winedbg/tgt_active.c
@@ -490,6 +490,7 @@ static unsigned dbg_handle_debug_event(D
             break;
         }
         tgt_process_active_close_process(dbg_curr_process, FALSE);
+        dbg_printf("Process of pid=0x%08lx has terminated\n", de->dwProcessId);
         break;
 
     case CREATE_THREAD_DEBUG_EVENT:
@@ -917,7 +918,6 @@ static BOOL tgt_process_active_close_pro
         if (!kill && !DebugActiveProcessStop(dbg_curr_pid)) return FALSE;
     }
     SymCleanup(pcs->handle);
-    dbg_printf("Process of pid=0x%08lx has terminated\n", pcs->pid);
     dbg_del_process(pcs);
 
     return TRUE;




More information about the wine-cvs mailing list