[haiku-commits] haiku: hrev45832 - src/apps/debugger/controllers

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 7 Jul 2013 18:57:41 +0200 (CEST)

hrev45832 adds 2 changesets to branch 'master'
old head: 9a14c8a25d0830ca07334ad3339d3f3b1bb588e3
new head: 5d4ef3e4174f96710c24760e31b3c4d756fcfaf7
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=5d4ef3e+%5E9a14c8a

----------------------------------------------------------------------------

ea84db9: ThreadHandler: allow an optional stop reason to be passed to...
  
  ...HandleThreadDebugged().

5d4ef3e: TeamDebugger: When stopping after an image load...
  
  ...set a stop reason to indicate the responsible image.

                                      [ Rene Gollent <anevilyak@xxxxxxxxx> ]

----------------------------------------------------------------------------

3 files changed, 18 insertions(+), 12 deletions(-)
src/apps/debugger/controllers/TeamDebugger.cpp  | 22 ++++++++++++---------
src/apps/debugger/controllers/ThreadHandler.cpp |  5 +++--
src/apps/debugger/controllers/ThreadHandler.h   |  3 ++-

############################################################################

Commit:      ea84db9e2f2e450e8d14676da2db432e0a8d963e
URL:         http://cgit.haiku-os.org/haiku/commit/?id=ea84db9
Author:      Rene Gollent <anevilyak@xxxxxxxxx>
Date:        Sun Jul  7 16:55:23 2013 UTC

ThreadHandler: allow an optional stop reason to be passed to...

...HandleThreadDebugged().

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/controllers/ThreadHandler.cpp 
b/src/apps/debugger/controllers/ThreadHandler.cpp
index b0525ae..3a1a02f 100644
--- a/src/apps/debugger/controllers/ThreadHandler.cpp
+++ b/src/apps/debugger/controllers/ThreadHandler.cpp
@@ -98,9 +98,10 @@ ThreadHandler::SetBreakpointAndRun(target_addr_t address)
 
 
 bool
-ThreadHandler::HandleThreadDebugged(ThreadDebuggedEvent* event)
+ThreadHandler::HandleThreadDebugged(ThreadDebuggedEvent* event,
+       const BString& stoppedReason)
 {
-       return _HandleThreadStopped(NULL, THREAD_STOPPED_DEBUGGED);
+       return _HandleThreadStopped(NULL, THREAD_STOPPED_DEBUGGED, 
stoppedReason);
 }
 
 
diff --git a/src/apps/debugger/controllers/ThreadHandler.h 
b/src/apps/debugger/controllers/ThreadHandler.h
index 3a79f60..3bbff41 100644
--- a/src/apps/debugger/controllers/ThreadHandler.h
+++ b/src/apps/debugger/controllers/ThreadHandler.h
@@ -41,7 +41,8 @@ public:
                        // All Handle*() methods are invoked in team debugger 
thread,
                        // looper lock held.
                        bool                            HandleThreadDebugged(
-                                                                       
ThreadDebuggedEvent* event);
+                                                                       
ThreadDebuggedEvent* event,
+                                                                       const 
BString& stoppedReason = BString());
                        bool                            HandleDebuggerCall(
                                                                        
DebuggerCallEvent* event);
                        bool                            HandleBreakpointHit(

############################################################################

Revision:    hrev45832
Commit:      5d4ef3e4174f96710c24760e31b3c4d756fcfaf7
URL:         http://cgit.haiku-os.org/haiku/commit/?id=5d4ef3e
Author:      Rene Gollent <anevilyak@xxxxxxxxx>
Date:        Sun Jul  7 16:56:30 2013 UTC

TeamDebugger: When stopping after an image load...

...set a stop reason to indicate the responsible image.

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/controllers/TeamDebugger.cpp 
b/src/apps/debugger/controllers/TeamDebugger.cpp
index 4e7b62b..b4a391b 100644
--- a/src/apps/debugger/controllers/TeamDebugger.cpp
+++ b/src/apps/debugger/controllers/TeamDebugger.cpp
@@ -1576,21 +1576,25 @@ TeamDebugger::_HandleImageDebugInfoChanged(image_id 
imageID)
                                BReference<ThreadHandler> 
handlerReference(handler);
 
                                bool stop = true;
+                               const BString& imageName = image->Name();
+                               // only match on the image filename itself
+                               const char* rawImageName = imageName.String()
+                                       + imageName.FindLast('/') + 1;
                                if (fTeam->StopImageNameListEnabled()) {
                                        const BStringList& nameList = 
fTeam->StopImageNames();
-                                       const BString& imageName = 
image->Name();
-                                       // only match on the image filename 
itself
-                                       const char* rawImageName = 
imageName.String()
-                                               + imageName.FindLast('/') + 1;
                                        stop = nameList.HasString(rawImageName);
                                }
 
-                               locker.Unlock();
+                               if (stop && handler != NULL) {
+                                       BString stopReason;
+                                       stopReason.SetToFormat("Image '%s' 
loaded.",
+                                               rawImageName);
+                                       locker.Unlock();
 
-                               if (stop && handler != NULL
-                                       && handler->HandleThreadDebugged(NULL)) 
{
-                                       return;
-                               }
+                                       if (handler->HandleThreadDebugged(NULL, 
stopReason))
+                                               return;
+                               } else
+                                       locker.Unlock();
                        } else
                                locker.Unlock();
 


Other related posts:

  • » [haiku-commits] haiku: hrev45832 - src/apps/debugger/controllers - anevilyak