[haiku-commits] haiku: hrev45728 - in src/apps/debugger: debug_managers debugger_interface controllers

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 31 May 2013 03:16:09 +0200 (CEST)

hrev45728 adds 3 changesets to branch 'master'
old head: 7b03c0ce313bf24d0bd0c32f0efceb85af6747eb
new head: cebb446f55113a316cd4cdce96267047f4991447
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=cebb446+%5E7b03c0c

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

05d9810: DebuggerInterface: reset port IDs on Close()...
  
  ...and add accessor to detect whether we currently have a valid
  connection or not.

6443c43: TeamDebugger: minor cleanups.
  
  - On team exit, close the debug interface.
  - When receiving a restart request via the listener, save settings
  before dispatching it.

cebb446: BreakpointManager: Adjust breakpoint installation logic.
  
  If the debugger interface isn't currently connected, don't attempt to
  actually install the breakpoint, and simply consider the operation a
  success. This allows setting new breakpoints after e.g. the team has
  exited.
  
  Resolves remaining part of #9774.

                                      [ Rene Gollent <anevilyak@xxxxxxxxx> ]

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

4 files changed, 16 insertions(+), 2 deletions(-)
src/apps/debugger/controllers/TeamDebugger.cpp             | 3 +++
src/apps/debugger/debug_managers/BreakpointManager.cpp     | 9 +++++++--
src/apps/debugger/debugger_interface/DebuggerInterface.cpp | 3 +++
src/apps/debugger/debugger_interface/DebuggerInterface.h   | 3 +++

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

Commit:      05d98101be018dfc4c431c90fceedda934f94255
URL:         http://cgit.haiku-os.org/haiku/commit/?id=05d9810
Author:      Rene Gollent <anevilyak@xxxxxxxxx>
Date:        Fri May 31 01:10:11 2013 UTC

DebuggerInterface: reset port IDs on Close()...

...and add accessor to detect whether we currently have a valid
connection or not.

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

diff --git a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp 
b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp
index 49a1a02..d641f24 100644
--- a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp
+++ b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp
@@ -316,6 +316,9 @@ DebuggerInterface::Close(bool killTeam)
 
        if (fDebuggerPort >= 0)
                delete_port(fDebuggerPort);
+
+       fNubPort = -1;
+       fDebuggerPort = -1;
 }
 
 
diff --git a/src/apps/debugger/debugger_interface/DebuggerInterface.h 
b/src/apps/debugger/debugger_interface/DebuggerInterface.h
index b4b3284..def878e 100644
--- a/src/apps/debugger/debugger_interface/DebuggerInterface.h
+++ b/src/apps/debugger/debugger_interface/DebuggerInterface.h
@@ -38,6 +38,9 @@ public:
                        status_t                        Init();
                        void                            Close(bool killTeam);
 
+                       bool                            Connected() const
+                                                                       { 
return fNubPort >= 0; }
+
                        Architecture*           GetArchitecture() const
                                                                        { 
return fArchitecture; }
 

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

Commit:      6443c430b220a3bcf70b2b648514ec35422a5ab6
URL:         http://cgit.haiku-os.org/haiku/commit/?id=6443c43
Author:      Rene Gollent <anevilyak@xxxxxxxxx>
Date:        Fri May 31 01:11:21 2013 UTC

TeamDebugger: minor cleanups.

- On team exit, close the debug interface.
- When receiving a restart request via the listener, save settings
before dispatching it.

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

diff --git a/src/apps/debugger/controllers/TeamDebugger.cpp 
b/src/apps/debugger/controllers/TeamDebugger.cpp
index 03c4f2c..9c334dc 100644
--- a/src/apps/debugger/controllers/TeamDebugger.cpp
+++ b/src/apps/debugger/controllers/TeamDebugger.cpp
@@ -736,6 +736,7 @@ TeamDebugger::MessageReceived(BMessage* message)
                        if (fCommandLineArgc == 0)
                                break;
 
+                       _SaveSettings();
                        fListener->TeamDebuggerRestartRequested(this);
                        break;
                }
@@ -1270,6 +1271,8 @@ bool
 TeamDebugger::_HandleTeamDeleted(TeamDeletedEvent* event)
 {
        char message[64];
+       fDebuggerInterface->Close(false);
+
        snprintf(message, sizeof(message), "Team %" B_PRId32 " has terminated. 
",
                event->Team());
 

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

Revision:    hrev45728
Commit:      cebb446f55113a316cd4cdce96267047f4991447
URL:         http://cgit.haiku-os.org/haiku/commit/?id=cebb446
Author:      Rene Gollent <anevilyak@xxxxxxxxx>
Date:        Fri May 31 01:12:23 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/9774

BreakpointManager: Adjust breakpoint installation logic.

If the debugger interface isn't currently connected, don't attempt to
actually install the breakpoint, and simply consider the operation a
success. This allows setting new breakpoints after e.g. the team has
exited.

Resolves remaining part of #9774.

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

diff --git a/src/apps/debugger/debug_managers/BreakpointManager.cpp 
b/src/apps/debugger/debug_managers/BreakpointManager.cpp
index 998f9fc..71dd193 100644
--- a/src/apps/debugger/debug_managers/BreakpointManager.cpp
+++ b/src/apps/debugger/debug_managers/BreakpointManager.cpp
@@ -494,8 +494,13 @@ 
BreakpointManager::_UpdateBreakpointInstallation(Breakpoint* breakpoint)
 
        if (shouldBeInstalled) {
                // install
-               status_t error = fDebuggerInterface->InstallBreakpoint(
-                       breakpoint->Address());
+               status_t error = B_OK;
+               // if we're not actually connected to a team, silently
+               // allow setting the breakpoint so it's saved to settings
+               // for when we do connect/have the team in the debugger.
+               if (fDebuggerInterface->Connected())
+                       
fDebuggerInterface->InstallBreakpoint(breakpoint->Address());
+
                if (error != B_OK)
                        return error;
 


Other related posts:

  • » [haiku-commits] haiku: hrev45728 - in src/apps/debugger: debug_managers debugger_interface controllers - anevilyak