[haiku-commits] haiku: hrev49356 - in src/apps/debugger: user_interface/gui/team_settings_window user_interface/gui/utility_windows model settings controllers

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 3 Jul 2015 04:39:35 +0200 (CEST)

hrev49356 adds 10 changesets to branch 'master'
old head: ce3124335fe9b0235b71938101c63e7e183428f3
new head: b3f2ebf008490ab0b37e7d12fb6e2702f45bcd2b
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=b3f2ebf00849+%5Ece3124335fe9

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

17cbae24ce6d: Debugger: Add SignalInfo model class.

- Represents information about a signal being delivered to the team.

8e5da927ea4f: Debugger: Add definitions for signal dispositions.

- Add header for defining the possible signal dispositions that can be
configured.
- Add corresponding UI helper function to map to a string
representation.

14a55dce0645: Debugger: Add signal settings and listener hooks.

Team:
- Add settings and accessors for signal dispositions.
- Add event definitions and listener hooks for signal disposition
changes.

86a5bc31a503: Debugger: Add persistent settings classes for signal dispositions.

- Add class TeamSignalSettings for storing signal disposition settings,
and add instance to TeamSettings.
- Adjust TeamDebugger to load signal settings.

601a9f1d2309: Debugger: Add handling for signal debug messages.

DebugEvents:
- Add definition for SignalReceivedEvent.

DebuggerInterface:
- Generate SignalReceivedEvent upon receipt of
B_DEBUGGER_MESSAGE_SIGNAL_RECEIVED.

24fe478ef8bf: Debugger: Start watching signal events.

TeamDebugger:
- Add signal events to debug event mask. Upon receipt of such an event,
stop the target thread. WIP.

c3c2ab316943: Debugger: Code reorganization, no functional change.

- Rename BreakConditionConfigWindow to TeamSettingsWindow,
and move to own dedicated subfolder. Adjust callers accordingly.
Preparation work for other changes to come.

10b962261a13: Debugger: Layout changes to team settings window.

TeamSettingsWindow:
- Split out functionality into separate views for images and exceptions,
which in turn are held in dedicated tabs.

b66f61af9ba9: Debugger: Add config view for signals.

SignalsConfigView:
- Provide basic configuration for signal dispositions.

TeamSettingsWindow:
- Add signals view to tab list.

b3f2ebf00849: Debugger: More work on signal configuration.

- Introduce SignalDispositionEditWindow for add/editing disposition
exceptions.

SignalsConfigView:
- Factor out helper class SignalDispositionMenu. Use accordingly in
SignalsConfigView and SignalDispositionEditWindow.
- Watch table selection changes to update button statuses appropriately.
- On add/edit request, show disposition edit window.
- Listen for disposition changes from team and react accordingly.

UiUtils:
- Add helper function to map signal defines to strings.

Together with the previous set of commits, this implements #9720.

[ Rene Gollent <rene@xxxxxxxxxxx> ]

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

37 files changed, 2159 insertions(+), 248 deletions(-)
src/apps/debugger/Jamfile | 12 +-
src/apps/debugger/MessageCodes.h | 13 +-
src/apps/debugger/controllers/TeamDebugger.cpp | 97 ++++-
src/apps/debugger/controllers/TeamDebugger.h | 7 +
src/apps/debugger/controllers/ThreadHandler.cpp | 56 ++-
src/apps/debugger/controllers/ThreadHandler.h | 2 +
.../debugger/debugger_interface/DebugEvent.cpp | 12 +
.../debugger/debugger_interface/DebugEvent.h | 14 +
.../debugger_interface/DebuggerInterface.cpp | 10 +-
src/apps/debugger/model/SignalInfo.cpp | 46 ++
src/apps/debugger/model/SignalInfo.h | 35 ++
src/apps/debugger/model/Team.cpp | 152 ++++++-
src/apps/debugger/model/Team.h | 73 +++-
src/apps/debugger/settings/TeamSettings.cpp | 57 ++-
src/apps/debugger/settings/TeamSettings.h | 12 +-
.../debugger/settings/TeamSignalSettings.cpp | 156 +++++++
src/apps/debugger/settings/TeamSignalSettings.h | 46 ++
src/apps/debugger/types/SignalDispositionTypes.h | 20 +
src/apps/debugger/user_interface/UserInterface.h | 7 +
.../ExceptionStopConfigView.cpp | 176 ++++++++
.../ExceptionStopConfigView.h | 52 +++
.../ImageStopConfigView.cpp} | 227 +++-------
.../ImageStopConfigView.h} | 41 +-
.../team_settings_window/SignalsConfigView.cpp | 416 +++++++++++++++++++
.../gui/team_settings_window/SignalsConfigView.h | 72 ++++
.../team_settings_window/TeamSettingsWindow.cpp | 86 ++++
.../team_settings_window/TeamSettingsWindow.h | 45 ++
.../gui/team_window/BreakpointsView.cpp | 8 +-
.../gui/team_window/BreakpointsView.h | 1 -
.../gui/team_window/TeamWindow.cpp | 31 +-
.../user_interface/gui/team_window/TeamWindow.h | 6 +-
.../gui/util/SignalDispositionMenu.cpp | 36 ++
.../gui/util/SignalDispositionMenu.h | 20 +
.../SignalDispositionEditWindow.cpp | 223 ++++++++++
.../SignalDispositionEditWindow.h | 62 +++
.../debugger/user_interface/util/UiUtils.cpp | 74 ++++
src/apps/debugger/user_interface/util/UiUtils.h | 4 +

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

Commit: 17cbae24ce6da4f3c94f8487d55641dd1720189f
URL: http://cgit.haiku-os.org/haiku/commit/?id=17cbae24ce6d
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sat Jun 27 02:26:50 2015 UTC

Debugger: Add SignalInfo model class.

- Represents information about a signal being delivered to the team.

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

diff --git a/src/apps/debugger/Jamfile b/src/apps/debugger/Jamfile
index 4421159..4657d1d 100644
--- a/src/apps/debugger/Jamfile
+++ b/src/apps/debugger/Jamfile
@@ -177,6 +177,7 @@ Application Debugger :
LineDataSource.cpp
ReturnValueInfo.cpp
SemaphoreInfo.cpp
+ SignalInfo.cpp
SourceCode.cpp
StackFrame.cpp
StackFrameValues.cpp
diff --git a/src/apps/debugger/model/SignalInfo.cpp
b/src/apps/debugger/model/SignalInfo.cpp
new file mode 100644
index 0000000..e91a53c
--- /dev/null
+++ b/src/apps/debugger/model/SignalInfo.cpp
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+
+#include "SignalInfo.h"
+
+#include <string.h>
+
+
+SignalInfo::SignalInfo()
+ :
+ fSignal(0),
+ fDeadly(false)
+{
+ memset(&fHandler, 0, sizeof(fHandler));
+}
+
+
+SignalInfo::SignalInfo(const SignalInfo& other)
+ :
+ fSignal(other.fSignal),
+ fDeadly(other.fDeadly)
+{
+ memcpy(&fHandler, &other.fHandler, sizeof(fHandler));
+}
+
+
+SignalInfo::SignalInfo(int signal, const struct sigaction& handler,
+ bool deadly)
+ :
+ fSignal(signal),
+ fDeadly(deadly)
+{
+ memcpy(&fHandler, &handler, sizeof(fHandler));
+}
+
+
+void
+SignalInfo::SetTo(int signal, const struct sigaction& handler, bool deadly)
+{
+ fSignal = signal;
+ fDeadly = deadly;
+
+ memcpy(&fHandler, &handler, sizeof(fHandler));
+}
diff --git a/src/apps/debugger/model/SignalInfo.h
b/src/apps/debugger/model/SignalInfo.h
new file mode 100644
index 0000000..ffd6361
--- /dev/null
+++ b/src/apps/debugger/model/SignalInfo.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef SIGNAL_INFO_H
+#define SIGNAL_INFO_H
+
+#include <signal.h>
+
+#include "Types.h"
+
+
+class SignalInfo {
+public:
+ SignalInfo();
+
SignalInfo(const SignalInfo& other);
+ SignalInfo(int
signal,
+ const
struct sigaction& handler,
+ bool
deadly);
+
+ void SetTo(int signal,
+ const
struct sigaction& handler,
+ bool
deadly);
+
+ int Signal() const
{ return fSignal; }
+ const struct sigaction& Handler() const { return
fHandler; }
+ bool Deadly() const {
return fDeadly; }
+private:
+ int fSignal;
+ struct sigaction fHandler;
+ bool fDeadly;
+};
+
+
+#endif // SIGNAL_INFO_H

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

Commit: 8e5da927ea4f483b61d20d94d723104d8fa5226f
URL: http://cgit.haiku-os.org/haiku/commit/?id=8e5da927ea4f
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sun Jun 28 21:26:22 2015 UTC

Debugger: Add definitions for signal dispositions.

- Add header for defining the possible signal dispositions that can be
configured.
- Add corresponding UI helper function to map to a string
representation.

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

diff --git a/src/apps/debugger/types/SignalDispositionTypes.h
b/src/apps/debugger/types/SignalDispositionTypes.h
new file mode 100644
index 0000000..4dae404
--- /dev/null
+++ b/src/apps/debugger/types/SignalDispositionTypes.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef SIGNAL_DISPOSITION_TYPES_H
+#define SIGNAL_DISPOSITION_TYPES_H
+
+
+enum SignalDisposition {
+ SIGNAL_DISPOSITION_IGNORE = 0,
+ SIGNAL_DISPOSITION_STOP_AT_RECEIPT,
+ SIGNAL_DISPOSITION_STOP_AT_SIGNAL_HANDLER,
+ // NB: if the team has no signal handler installed for
+ // the corresponding signal, this implies stop at receipt.
+
+ SIGNAL_DISPOSITION_MAX
+};
+
+
+#endif // SIGNAL_DISPOSITION_TYPES_H
diff --git a/src/apps/debugger/user_interface/util/UiUtils.cpp
b/src/apps/debugger/user_interface/util/UiUtils.cpp
index c2de82f..d952a95 100644
--- a/src/apps/debugger/user_interface/util/UiUtils.cpp
+++ b/src/apps/debugger/user_interface/util/UiUtils.cpp
@@ -21,6 +21,7 @@
#include "FunctionInstance.h"
#include "Image.h"
#include "RangeList.h"
+#include "SignalDispositionTypes.h"
#include "StackFrame.h"
#include "Team.h"
#include "TeamMemoryBlock.h"
@@ -559,3 +560,21 @@ UiUtils::FormatSIMDValue(const BVariant& value, uint32
bitSize,

return _output;
}
+
+
+const char*
+UiUtils::SignalDispositionToString(int disposition)
+{
+ switch (disposition) {
+ case SIGNAL_DISPOSITION_IGNORE:
+ return "Ignore";
+ case SIGNAL_DISPOSITION_STOP_AT_RECEIPT:
+ return "Stop at receipt";
+ case SIGNAL_DISPOSITION_STOP_AT_SIGNAL_HANDLER:
+ return "Stop at signal handler";
+ default:
+ break;
+ }
+
+ return "Unknown";
+}
diff --git a/src/apps/debugger/user_interface/util/UiUtils.h
b/src/apps/debugger/user_interface/util/UiUtils.h
index 8f5af96..6290049 100644
--- a/src/apps/debugger/user_interface/util/UiUtils.h
+++ b/src/apps/debugger/user_interface/util/UiUtils.h
@@ -74,6 +74,8 @@ public:
static const BString& FormatSIMDValue(const BVariant& value,
uint32
bitSize, uint32 format,

BString& _output);
+
+ static const char* SignalDispositionToString(int
disposition);
};



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

Commit: 14a55dce06452e21fb1f7033271c929c60e62145
URL: http://cgit.haiku-os.org/haiku/commit/?id=14a55dce0645
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Tue Jun 30 03:26:08 2015 UTC

Debugger: Add signal settings and listener hooks.

Team:
- Add settings and accessors for signal dispositions.
- Add event definitions and listener hooks for signal disposition
changes.

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

diff --git a/src/apps/debugger/MessageCodes.h b/src/apps/debugger/MessageCodes.h
index fdd0e6d..dd457a6 100644
--- a/src/apps/debugger/MessageCodes.h
+++ b/src/apps/debugger/MessageCodes.h
@@ -27,6 +27,9 @@ enum {
MSG_STOP_ON_IMAGE_LOAD =
'tsil',
MSG_ADD_STOP_IMAGE_NAME =
'asin',
MSG_REMOVE_STOP_IMAGE_NAME =
'rsin',
+ MSG_SET_DEFAULT_SIGNAL_DISPOSITION = 'sdsd',
+ MSG_SET_CUSTOM_SIGNAL_DISPOSITION = 'scsd',
+ MSG_REMOVE_CUSTOM_SIGNAL_DISPOSITION = 'rcsd',

MSG_THREAD_STATE_CHANGED =
'tsch',
MSG_THREAD_CPU_STATE_CHANGED = 'tcsc',
diff --git a/src/apps/debugger/controllers/TeamDebugger.cpp
b/src/apps/debugger/controllers/TeamDebugger.cpp
index 9f109a2..a293ac4 100644
--- a/src/apps/debugger/controllers/TeamDebugger.cpp
+++ b/src/apps/debugger/controllers/TeamDebugger.cpp
@@ -685,6 +685,43 @@ TeamDebugger::MessageReceived(BMessage* message)

AutoLocker< ::Team> teamLocker(fTeam);
fTeam->RemoveStopImageName(imageName);
+ break;
+ }
+
+ case MSG_SET_DEFAULT_SIGNAL_DISPOSITION:
+ {
+ int32 disposition;
+ if (message->FindInt32("disposition", &disposition) !=
B_OK)
+ break;
+
+ AutoLocker< ::Team> teamLocker(fTeam);
+ fTeam->SetDefaultSignalDisposition(disposition);
+ break;
+ }
+
+ case MSG_SET_CUSTOM_SIGNAL_DISPOSITION:
+ {
+ int32 signal;
+ int32 disposition;
+ if (message->FindInt32("signal", &signal) != B_OK
+ || message->FindInt32("disposition",
&disposition) != B_OK) {
+ break;
+ }
+
+ AutoLocker< ::Team> teamLocker(fTeam);
+ fTeam->SetCustomSignalDisposition(signal, disposition);
+ break;
+ }
+
+ case MSG_REMOVE_CUSTOM_SIGNAL_DISPOSITION:
+ {
+ int32 signal;
+ if (message->FindInt32("signal", &signal) != B_OK)
+ break;
+
+ AutoLocker< ::Team> teamLocker(fTeam);
+ fTeam->RemoveCustomSignalDisposition(signal);
+ break;
}

case MSG_SET_WATCHPOINT:
@@ -1106,6 +1143,35 @@ TeamDebugger::RemoveStopImageNameRequested(const char*
name)


void
+TeamDebugger::SetDefaultSignalDispositionRequested(int32 disposition)
+{
+ BMessage message(MSG_SET_DEFAULT_SIGNAL_DISPOSITION);
+ message.AddInt32("disposition", disposition);
+ PostMessage(&message);
+}
+
+
+void
+TeamDebugger::SetCustomSignalDispositionRequested(int32 signal,
+ int32 disposition)
+{
+ BMessage message(MSG_SET_CUSTOM_SIGNAL_DISPOSITION);
+ message.AddInt32("signal", signal);
+ message.AddInt32("disposition", disposition);
+ PostMessage(&message);
+}
+
+
+void
+TeamDebugger::RemoveCustomSignalDispositionRequested(int32 signal)
+{
+ BMessage message(MSG_REMOVE_CUSTOM_SIGNAL_DISPOSITION);
+ message.AddInt32("signal", signal);
+ PostMessage(&message);
+}
+
+
+void
TeamDebugger::ClearBreakpointRequested(UserBreakpoint* breakpoint)
{
BMessage message(MSG_CLEAR_BREAKPOINT);
diff --git a/src/apps/debugger/controllers/TeamDebugger.h
b/src/apps/debugger/controllers/TeamDebugger.h
index 59d8e94..377a9ea 100644
--- a/src/apps/debugger/controllers/TeamDebugger.h
+++ b/src/apps/debugger/controllers/TeamDebugger.h
@@ -97,6 +97,13 @@ private:
virtual void RemoveStopImageNameRequested(
const
char* name);

+ virtual void
SetDefaultSignalDispositionRequested(
+ int32
disposition);
+ virtual void
SetCustomSignalDispositionRequested(
+ int32
signal, int32 disposition);
+ virtual void
RemoveCustomSignalDispositionRequested(
+ int32
signal);
+
virtual void
SetWatchpointRequested(target_addr_t address,
uint32
type, int32 length, bool enabled);
virtual void SetWatchpointEnabledRequested(
diff --git a/src/apps/debugger/model/Team.cpp b/src/apps/debugger/model/Team.cpp
index d915a82..b224778 100644
--- a/src/apps/debugger/model/Team.cpp
+++ b/src/apps/debugger/model/Team.cpp
@@ -16,6 +16,7 @@
#include "FileSourceCode.h"
#include "Function.h"
#include "ImageDebugInfo.h"
+#include "SignalDispositionTypes.h"
#include "SourceCode.h"
#include "SpecificImageDebugInfo.h"
#include "Statement.h"
@@ -80,7 +81,8 @@ Team::Team(team_id teamID, TeamMemory* teamMemory,
Architecture* architecture,
fArchitecture(architecture),
fDebugInfo(debugInfo),
fStopOnImageLoad(false),
- fStopImageNameListEnabled(false)
+ fStopImageNameListEnabled(false),
+ fDefaultSignalDisposition(SIGNAL_DISPOSITION_IGNORE)
{
fDebugInfo->AcquireReference();
}
@@ -312,6 +314,69 @@ Team::StopImageNames() const
}


+void
+Team::SetDefaultSignalDisposition(int32 disposition)
+{
+ if (disposition != fDefaultSignalDisposition) {
+ fDefaultSignalDisposition = disposition;
+ NotifyDefaultSignalDispositionChanged(disposition);
+ }
+}
+
+
+bool
+Team::SetCustomSignalDisposition(int32 signal, int32 disposition)
+{
+ SignalDispositionMappings::iterator it = fCustomSignalDispositions.find(
+ signal);
+ if (it != fCustomSignalDispositions.end() && it->second == disposition)
+ return true;
+
+ try {
+ fCustomSignalDispositions[signal] = disposition;
+ } catch (...) {
+ return false;
+ }
+
+ NotifyCustomSignalDispositionChanged(signal, disposition);
+
+ return true;
+}
+
+
+void
+Team::RemoveCustomSignalDisposition(int32 signal)
+{
+ SignalDispositionMappings::iterator it = fCustomSignalDispositions.find(
+ signal);
+ if (it == fCustomSignalDispositions.end())
+ return;
+
+ fCustomSignalDispositions.erase(it);
+
+ NotifyCustomSignalDispositionRemoved(signal);
+}
+
+
+int32
+Team::SignalDispositionFor(int32 signal) const
+{
+ SignalDispositionMappings::const_iterator it
+ = fCustomSignalDispositions.find(signal);
+ if (it != fCustomSignalDispositions.end())
+ return it->second;
+
+ return fDefaultSignalDisposition;
+}
+
+
+const SignalDispositionMappings&
+Team::GetSignalDispositionMappings() const
+{
+ return fCustomSignalDispositions;
+}
+
+
bool
Team::AddBreakpoint(Breakpoint* breakpoint)
{
@@ -688,6 +753,45 @@ Team::NotifyStopImageNameRemoved(const BString& name)


void
+Team::NotifyDefaultSignalDispositionChanged(int32 disposition)
+{
+ for (ListenerList::Iterator it = fListeners.GetIterator();
+ Listener* listener = it.Next();) {
+ listener->DefaultSignalDispositionChanged(
+ DefaultSignalDispositionEvent(
+ TEAM_EVENT_DEFAULT_SIGNAL_DISPOSITION_CHANGED,
this,
+ disposition));
+ }
+}
+
+
+void
+Team::NotifyCustomSignalDispositionChanged(int32 signal, int32 disposition)
+{
+ for (ListenerList::Iterator it = fListeners.GetIterator();
+ Listener* listener = it.Next();) {
+ listener->CustomSignalDispositionChanged(
+ CustomSignalDispositionEvent(
+ TEAM_EVENT_CUSTOM_SIGNAL_DISPOSITION_CHANGED,
this,
+ signal, disposition));
+ }
+}
+
+
+void
+Team::NotifyCustomSignalDispositionRemoved(int32 signal)
+{
+ for (ListenerList::Iterator it = fListeners.GetIterator();
+ Listener* listener = it.Next();) {
+ listener->CustomSignalDispositionRemoved(
+ CustomSignalDispositionEvent(
+ TEAM_EVENT_CUSTOM_SIGNAL_DISPOSITION_REMOVED,
this,
+ signal, SIGNAL_DISPOSITION_IGNORE));
+ }
+}
+
+
+void
Team::NotifyConsoleOutputReceived(int32 fd, const BString& output)
{
for (ListenerList::Iterator it = fListeners.GetIterator();
@@ -841,6 +945,31 @@ Team::ImageLoadNameEvent::ImageLoadNameEvent(uint32 type,
Team* team,
}


+// #pragma mark - DefaultSignalDispositionEvent
+
+
+Team::DefaultSignalDispositionEvent::DefaultSignalDispositionEvent(uint32 type,
+ Team* team, int32 disposition)
+ :
+ Event(type, team),
+ fDefaultDisposition(disposition)
+{
+}
+
+
+// #pragma mark - CustomSignalDispositionEvent
+
+
+Team::CustomSignalDispositionEvent::CustomSignalDispositionEvent(uint32 type,
+ Team* team, int32 signal, int32 disposition)
+ :
+ Event(type, team),
+ fSignal(signal),
+ fDisposition(disposition)
+{
+}
+
+
// #pragma mark - BreakpointEvent


@@ -992,6 +1121,27 @@ Team::Listener::StopOnImageLoadNameRemoved(


void
+Team::Listener::DefaultSignalDispositionChanged(
+ const Team::DefaultSignalDispositionEvent& event)
+{
+}
+
+
+void
+Team::Listener::CustomSignalDispositionChanged(
+ const Team::CustomSignalDispositionEvent& event)
+{
+}
+
+
+void
+Team::Listener::CustomSignalDispositionRemoved(
+ const Team::CustomSignalDispositionEvent& event)
+{
+}
+
+
+void
Team::Listener::ConsoleOutputReceived(const Team::ConsoleOutputEvent& event)
{
}
diff --git a/src/apps/debugger/model/Team.h b/src/apps/debugger/model/Team.h
index 243fec0..9891172 100644
--- a/src/apps/debugger/model/Team.h
+++ b/src/apps/debugger/model/Team.h
@@ -1,11 +1,12 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
- * Copyright 2013-2014, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2013-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Distributed under the terms of the MIT License.
*/
#ifndef TEAM_H
#define TEAM_H

+#include <map>

#include <Locker.h>
#include <StringList.h>
@@ -38,6 +39,10 @@ enum {
TEAM_EVENT_IMAGE_LOAD_NAME_ADDED,
TEAM_EVENT_IMAGE_LOAD_NAME_REMOVED,

+ TEAM_EVENT_DEFAULT_SIGNAL_DISPOSITION_CHANGED,
+ TEAM_EVENT_CUSTOM_SIGNAL_DISPOSITION_CHANGED,
+ TEAM_EVENT_CUSTOM_SIGNAL_DISPOSITION_REMOVED,
+
TEAM_EVENT_CONSOLE_OUTPUT_RECEIVED,

TEAM_EVENT_BREAKPOINT_ADDED,
@@ -71,6 +76,9 @@ class UserBreakpoint;
class Value;


+typedef std::map<int32, int32> SignalDispositionMappings;
+
+
class Team {
public:
class Event;
@@ -81,6 +89,8 @@ public:
class ImageEvent;
class ImageLoadEvent;
class ImageLoadNameEvent;
+ class DefaultSignalDispositionEvent;
+ class CustomSignalDispositionEvent;
class ThreadEvent;
class UserBreakpointEvent;
class WatchpointEvent;
@@ -139,6 +149,18 @@ public:
bool
StopImageNameListEnabled() const
{
return fStopImageNameListEnabled; }

+ void
SetDefaultSignalDisposition(int32 disposition);
+ int32
DefaultSignalDisposition() const
+ {
return fDefaultSignalDisposition; }
+ bool
SetCustomSignalDisposition(int32 signal,
+ int32
disposition);
+ void
RemoveCustomSignalDisposition(int32 signal);
+ int32
SignalDispositionFor(int32 signal) const;
+ // if
no custom disposition is found,
+ //
returns default
+ const SignalDispositionMappings&
+
GetSignalDispositionMappings() const;
+
bool
AddBreakpoint(Breakpoint* breakpoint);
//
takes over reference (also on error)
void
RemoveBreakpoint(Breakpoint* breakpoint);
@@ -212,6 +234,14 @@ public:
void
NotifyStopImageNameRemoved(
const
BString& name);

+ // service methods for Signal Disposition settings
+ void
NotifyDefaultSignalDispositionChanged(
+ int32
newDisposition);
+ void
NotifyCustomSignalDispositionChanged(
+ int32
signal, int32 disposition);
+ void
NotifyCustomSignalDispositionRemoved(
+ int32
signal);
+
// service methods for console output
void
NotifyConsoleOutputReceived(
int32
fd, const BString& output);
@@ -259,6 +289,9 @@ private:
bool fStopOnImageLoad;
bool
fStopImageNameListEnabled;
BStringList fStopImageNames;
+ int32
fDefaultSignalDisposition;
+ SignalDispositionMappings
+
fCustomSignalDispositions;
BreakpointList fBreakpoints;
WatchpointList fWatchpoints;
UserBreakpointList fUserBreakpoints;
@@ -330,6 +363,34 @@ private:
};


+class Team::DefaultSignalDispositionEvent : public Event {
+public:
+
DefaultSignalDispositionEvent(uint32 type,
+ Team*
team, int32 disposition);
+
+ int32 DefaultDisposition()
const
+ {
return fDefaultDisposition; }
+
+private:
+ int32 fDefaultDisposition;
+};
+
+
+class Team::CustomSignalDispositionEvent : public Event {
+public:
+
CustomSignalDispositionEvent(uint32 type,
+ Team*
team, int32 signal,
+ int32
disposition);
+
+ int32 Signal() const { return
fSignal; }
+ int32 Disposition() const {
return fDisposition; }
+
+private:
+ int32 fSignal;
+ int32 fDisposition;
+};
+
+
class Team::BreakpointEvent : public Event {
public:

BreakpointEvent(uint32 type, Team* team,
@@ -433,6 +494,16 @@ public:
virtual void StopOnImageLoadNameRemoved(
const
Team::ImageLoadNameEvent& event);

+ virtual void DefaultSignalDispositionChanged(
+ const
Team::DefaultSignalDispositionEvent&
+
event);
+ virtual void CustomSignalDispositionChanged(
+ const
Team::CustomSignalDispositionEvent&
+
event);
+ virtual void CustomSignalDispositionRemoved(
+ const
Team::CustomSignalDispositionEvent&
+
event);
+
virtual void ConsoleOutputReceived(
const
Team::ConsoleOutputEvent& event);

diff --git a/src/apps/debugger/user_interface/UserInterface.h
b/src/apps/debugger/user_interface/UserInterface.h
index d95a09f..65caaa7 100644
--- a/src/apps/debugger/user_interface/UserInterface.h
+++ b/src/apps/debugger/user_interface/UserInterface.h
@@ -128,6 +128,13 @@ public:
virtual void RemoveStopImageNameRequested(
const
char* name) = 0;

+ virtual void
SetDefaultSignalDispositionRequested(
+ int32
disposition) = 0;
+ virtual void
SetCustomSignalDispositionRequested(
+ int32
signal, int32 disposition) = 0;
+ virtual void
RemoveCustomSignalDispositionRequested(
+ int32
signal) = 0;
+
virtual void
SetWatchpointRequested(target_addr_t address,
uint32
type, int32 length,
bool
enabled) = 0;

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

Commit: 86a5bc31a50356c488339c61076d7240eff570aa
URL: http://cgit.haiku-os.org/haiku/commit/?id=86a5bc31a503
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Tue Jun 30 02:45:10 2015 UTC

Debugger: Add persistent settings classes for signal dispositions.

- Add class TeamSignalSettings for storing signal disposition settings,
and add instance to TeamSettings.
- Adjust TeamDebugger to load signal settings.

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

diff --git a/src/apps/debugger/Jamfile b/src/apps/debugger/Jamfile
index 4657d1d..2428432 100644
--- a/src/apps/debugger/Jamfile
+++ b/src/apps/debugger/Jamfile
@@ -208,6 +208,7 @@ Application Debugger :
SettingsManager.cpp
TeamFileManagerSettings.cpp
TeamSettings.cpp
+ TeamSignalSettings.cpp
TeamUiSettings.cpp
TeamUiSettingsFactory.cpp

diff --git a/src/apps/debugger/controllers/TeamDebugger.cpp
b/src/apps/debugger/controllers/TeamDebugger.cpp
index a293ac4..9374459 100644
--- a/src/apps/debugger/controllers/TeamDebugger.cpp
+++ b/src/apps/debugger/controllers/TeamDebugger.cpp
@@ -53,6 +53,7 @@
#include "TeamMemoryBlock.h"
#include "TeamMemoryBlockManager.h"
#include "TeamSettings.h"
+#include "TeamSignalSettings.h"
#include "TeamUiSettings.h"
#include "Tracing.h"
#include "ValueNode.h"
@@ -2315,6 +2316,22 @@ TeamDebugger::_LoadSettings()
fUserInterface->ID());
if (uiSettings != NULL)
fUserInterface->LoadSettings(uiSettings);
+
+ const TeamSignalSettings* signalSettings =
fTeamSettings.SignalSettings();
+ if (signalSettings != NULL) {
+ fTeam->SetDefaultSignalDisposition(
+ signalSettings->DefaultSignalDisposition());
+
+ int32 signal;
+ int32 disposition;
+ for (int32 i = 0; i <
signalSettings->CountCustomSignalDispositions();
+ i++) {
+ if (signalSettings->GetCustomSignalDispositionAt(i,
signal,
+ disposition) == B_OK) {
+ fTeam->SetCustomSignalDisposition(signal,
disposition);
+ }
+ }
+ }
}


diff --git a/src/apps/debugger/settings/TeamSettings.cpp
b/src/apps/debugger/settings/TeamSettings.cpp
index b77224f..0ce088b 100644
--- a/src/apps/debugger/settings/TeamSettings.cpp
+++ b/src/apps/debugger/settings/TeamSettings.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
- * Copyright 2013, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2013-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Distributed under the terms of the MIT License.
*/

@@ -17,6 +17,7 @@
#include "BreakpointSetting.h"
#include "Team.h"
#include "TeamFileManagerSettings.h"
+#include "TeamSignalSettings.h"
#include "TeamUiSettings.h"
#include "TeamUiSettingsFactory.h"
#include "UserBreakpoint.h"
@@ -25,6 +26,7 @@
TeamSettings::TeamSettings()
{
fFileManagerSettings = new TeamFileManagerSettings();
+ fSignalSettings = new TeamSignalSettings();
}


@@ -74,6 +76,22 @@ TeamSettings::SetTo(Team* team)
}
}

+ // add signal configuration
+
+ fSignalSettings->SetDefaultSignalDisposition(
+ team->DefaultSignalDisposition());
+
+ const SignalDispositionMappings& mappings
+ = team->GetSignalDispositionMappings();
+
+ for (SignalDispositionMappings::const_iterator it = mappings.begin();
+ it != mappings.end(); ++it) {
+ status_t error = fSignalSettings->AddCustomSignalDisposition(
+ it->first, it->second);
+ if (error != B_OK)
+ return error;
+ }
+
return B_OK;
}

@@ -124,6 +142,12 @@ TeamSettings::SetTo(const BMessage& archive)
return error;
}

+ if (archive.FindMessage("signalsettings", &childArchive) == B_OK) {
+ error = fSignalSettings->SetTo(childArchive);
+ if (error != B_OK)
+ return error;
+ }
+
return B_OK;
}

@@ -166,6 +190,14 @@ TeamSettings::WriteTo(BMessage& archive) const
if (error != B_OK)
return error;

+ error = fSignalSettings->WriteTo(childArchive);
+ if (error != B_OK)
+ return error;
+
+ error = archive.AddMessage("signalsettings", &childArchive);
+ if (error != B_OK)
+ return error;
+
return B_OK;
}

@@ -253,6 +285,8 @@ TeamSettings::operator=(const TeamSettings& other)

*fFileManagerSettings = *other.fFileManagerSettings;

+ *fSignalSettings = *other.fSignalSettings;
+
return *this;
}

@@ -277,6 +311,26 @@
TeamSettings::SetFileManagerSettings(TeamFileManagerSettings* settings)
}


+TeamSignalSettings*
+TeamSettings::SignalSettings() const
+{
+ return fSignalSettings;
+}
+
+
+status_t
+TeamSettings::SetSignalSettings(TeamSignalSettings* settings)
+{
+ try {
+ *fSignalSettings = *settings;
+ } catch (...) {
+ return B_NO_MEMORY;
+ }
+
+ return B_OK;
+}
+
+
void
TeamSettings::_Unset()
{
@@ -290,6 +344,7 @@ TeamSettings::_Unset()

fBreakpoints.MakeEmpty();
fUiSettings.MakeEmpty();
+ fSignalSettings->Unset();

fTeamName.Truncate(0);
}
diff --git a/src/apps/debugger/settings/TeamSettings.h
b/src/apps/debugger/settings/TeamSettings.h
index 6f71cda..1bd14f5 100644
--- a/src/apps/debugger/settings/TeamSettings.h
+++ b/src/apps/debugger/settings/TeamSettings.h
@@ -1,6 +1,6 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
- * Copyright 2013, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2013-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Distributed under the terms of the MIT License.
*/
#ifndef TEAM_SETTINGS_H
@@ -13,10 +13,11 @@


class BMessage;
-class Team;
class BreakpointSetting;
-class TeamUiSettings;
+class Team;
class TeamFileManagerSettings;
+class TeamSignalSettings;
+class TeamUiSettings;


class TeamSettings {
@@ -48,6 +49,10 @@ public:
status_t SetFileManagerSettings(

TeamFileManagerSettings* settings);

+ TeamSignalSettings* SignalSettings() const;
+ status_t SetSignalSettings(
+
TeamSignalSettings* settings);
+
private:
typedef BObjectList<BreakpointSetting> BreakpointList;
typedef BObjectList<TeamUiSettings> UiSettingsList;
@@ -60,6 +65,7 @@ private:
UiSettingsList fUiSettings;
TeamFileManagerSettings*

fFileManagerSettings;
+ TeamSignalSettings* fSignalSettings;
BString fTeamName;
};

diff --git a/src/apps/debugger/settings/TeamSignalSettings.cpp
b/src/apps/debugger/settings/TeamSignalSettings.cpp
new file mode 100644
index 0000000..d9d8304
--- /dev/null
+++ b/src/apps/debugger/settings/TeamSignalSettings.cpp
@@ -0,0 +1,156 @@
+/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+#include "TeamSignalSettings.h"
+
+
+static const char* skDefaultSignalFieldName = "signal:default_disposition";
+static const char* skSignalNumberFieldName = "signal:number";
+static const char* skSignalDispositionFieldName = "signal:disposition";
+static const char* skSignalSettingName = "signal:setting";
+
+
+TeamSignalSettings::TeamSignalSettings()
+ :
+ fValues()
+{
+}
+
+
+TeamSignalSettings::~TeamSignalSettings()
+{
+}
+
+
+TeamSignalSettings&
+TeamSignalSettings::operator=(const TeamSignalSettings& other)
+{
+ fValues = other.fValues;
+
+ return *this;
+}
+
+
+const char*
+TeamSignalSettings::ID() const
+{
+ return "Signals";
+}
+
+
+status_t
+TeamSignalSettings::SetTo(const BMessage& archive)
+{
+ try {
+ fValues = archive;
+ } catch (...) {
+ return B_NO_MEMORY;
+ }
+
+ return B_OK;
+}
+
+
+status_t
+TeamSignalSettings::WriteTo(BMessage& archive) const
+{
+ try {
+ archive = fValues;
+ } catch (...) {
+ return B_NO_MEMORY;
+ }
+
+ return B_OK;
+}
+
+
+void
+TeamSignalSettings::Unset()
+{
+ fValues.MakeEmpty();
+}
+
+
+void
+TeamSignalSettings::SetDefaultSignalDisposition(int32 disposition)
+{
+ fValues.SetInt32(skDefaultSignalFieldName, disposition);
+}
+
+
+int32
+TeamSignalSettings::DefaultSignalDisposition() const
+{
+ return fValues.GetInt32(skDefaultSignalFieldName,
+ SIGNAL_DISPOSITION_IGNORE);
+}
+
+
+int32
+TeamSignalSettings::CountCustomSignalDispositions() const
+{
+ type_code type;
+ int32 count = 0;
+
+ if (fValues.GetInfo(skSignalSettingName, &type, &count) == B_OK)
+ return count;
+
+ return 0;
+}
+
+
+status_t
+TeamSignalSettings::AddCustomSignalDisposition(int32 signal, int32 disposition)
+{
+ BMessage setting;
+ if (setting.AddInt32(skSignalNumberFieldName, signal) != B_OK
+ || setting.AddInt32(skSignalDispositionFieldName, disposition)
!= B_OK
+ || fValues.AddMessage(skSignalSettingName, &setting) != B_OK) {
+ return B_NO_MEMORY;
+ }
+
+ return B_OK;
+}
+
+
+status_t
+TeamSignalSettings::RemoveCustomSignalDispositionAt(int32 index)
+{
+ return fValues.RemoveData(skSignalSettingName, index);
+}
+
+
+status_t
+TeamSignalSettings::GetCustomSignalDispositionAt(int32 index, int32& signal,
+ int32& disposition) const
+{
+ BMessage setting;
+ status_t error = fValues.FindMessage(skSignalSettingName, index,
&setting);
+ if (error != B_OK)
+ return error;
+
+ error = setting.FindInt32(skSignalNumberFieldName, &signal);
+ if (error != B_OK)
+ return error;
+
+ return setting.FindInt32(skSignalDispositionFieldName, &disposition);
+}
+
+
+TeamSignalSettings*
+TeamSignalSettings::Clone() const
+{
+ TeamSignalSettings* settings = new(std::nothrow)
+ TeamSignalSettings();
+
+ if (settings == NULL)
+ return NULL;
+
+ if (settings->SetTo(fValues) != B_OK) {
+ delete settings;
+ return NULL;
+ }
+
+ return settings;
+}
diff --git a/src/apps/debugger/settings/TeamSignalSettings.h
b/src/apps/debugger/settings/TeamSignalSettings.h
new file mode 100644
index 0000000..3e26383
--- /dev/null
+++ b/src/apps/debugger/settings/TeamSignalSettings.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef TEAM_SIGNAL_SETTINGS_H
+#define TEAM_SIGNAL_SETTINGS_H
+
+#include <Message.h>
+
+#include "SignalDispositionTypes.h"
+
+
+class TeamSignalSettings {
+public:
+
TeamSignalSettings();
+ virtual ~TeamSignalSettings();
+
+ TeamSignalSettings&
+ operator=(
+ const
TeamSignalSettings& other);
+ //
throws std::bad_alloc;
+
+ const char* ID() const;
+ status_t SetTo(const BMessage&
archive);
+ status_t WriteTo(BMessage&
archive) const;
+ void Unset();
+
+ void
SetDefaultSignalDisposition(int32 disposition);
+ int32
DefaultSignalDisposition() const;
+
+ int32
CountCustomSignalDispositions() const;
+ status_t
AddCustomSignalDisposition(int32 signal,
+ int32
disposition);
+ status_t
RemoveCustomSignalDispositionAt(int32 index);
+ status_t
GetCustomSignalDispositionAt(int32 index,
+ int32&
signal, int32& disposition) const;
+
+ virtual TeamSignalSettings*
+ Clone() const;
+
+private:
+ BMessage fValues;
+};
+
+
+#endif // TEAM_SIGNAL_SETTINGS_H

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

Commit: 601a9f1d2309e51994f83bda4ec4adbfd8c34468
URL: http://cgit.haiku-os.org/haiku/commit/?id=601a9f1d2309
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sat Jun 27 02:28:01 2015 UTC

Debugger: Add handling for signal debug messages.

DebugEvents:
- Add definition for SignalReceivedEvent.

DebuggerInterface:
- Generate SignalReceivedEvent upon receipt of
B_DEBUGGER_MESSAGE_SIGNAL_RECEIVED.

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

diff --git a/src/apps/debugger/debugger_interface/DebugEvent.cpp
b/src/apps/debugger/debugger_interface/DebugEvent.cpp
index 16dac73..682de05 100644
--- a/src/apps/debugger/debugger_interface/DebugEvent.cpp
+++ b/src/apps/debugger/debugger_interface/DebugEvent.cpp
@@ -237,3 +237,15 @@ HandedOverEvent::HandedOverEvent(team_id team, thread_id
thread,
fCausingThread(causingThread)
{
}
+
+
+// #pragma mark - SignalReceivedEvent
+
+
+SignalReceivedEvent::SignalReceivedEvent(team_id team, thread_id thread,
+ const SignalInfo& info)
+ :
+ DebugEvent(B_DEBUGGER_MESSAGE_SIGNAL_RECEIVED, team, thread),
+ fInfo(info)
+{
+}
diff --git a/src/apps/debugger/debugger_interface/DebugEvent.h
b/src/apps/debugger/debugger_interface/DebugEvent.h
index edd8140..c32b767 100644
--- a/src/apps/debugger/debugger_interface/DebugEvent.h
+++ b/src/apps/debugger/debugger_interface/DebugEvent.h
@@ -9,6 +9,7 @@
#include <debugger.h>

#include "ImageInfo.h"
+#include "SignalInfo.h"
#include "SyscallInfo.h"
#include "Types.h"

@@ -223,4 +224,17 @@ private:
};


+class SignalReceivedEvent : public DebugEvent {
+public:
+
SignalReceivedEvent(team_id team,
+
thread_id thread,
+ const
SignalInfo& info);
+
+ const SignalInfo& GetSignalInfo() const {
return fInfo; }
+
+private:
+ SignalInfo fInfo;
+};
+
+
#endif // DEBUG_EVENT_H
diff --git a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp
b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp
index 3c0ef9d..8e03267 100644
--- a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp
+++ b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp
@@ -857,13 +857,21 @@ DebuggerInterface::_CreateDebugEvent(int32 messageCode,
message.post_syscall.syscall,
message.post_syscall.args));
break;
}
+ case B_DEBUGGER_MESSAGE_SIGNAL_RECEIVED:
+ {
+ event = new(std::nothrow)
SignalReceivedEvent(message.origin.team,
+ message.origin.thread,
+ SignalInfo(message.signal_received.signal,
+ message.signal_received.handler,
+ message.signal_received.deadly));
+ break;
+ }
default:
printf("DebuggerInterface for team %" B_PRId32 ":
unknown message "
"from kernel: %" B_PRId32 "\n", fTeamID,
messageCode);
// fall through...
case B_DEBUGGER_MESSAGE_TEAM_CREATED:
case B_DEBUGGER_MESSAGE_PRE_SYSCALL:
- case B_DEBUGGER_MESSAGE_SIGNAL_RECEIVED:
case B_DEBUGGER_MESSAGE_PROFILER_UPDATE:
case B_DEBUGGER_MESSAGE_HANDED_OVER:
_ignore = true;

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

Commit: 24fe478ef8bfd7d793a51335c67757fb801a2f56
URL: http://cgit.haiku-os.org/haiku/commit/?id=24fe478ef8bf
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sat Jun 27 02:29:23 2015 UTC

Debugger: Start watching signal events.

TeamDebugger:
- Add signal events to debug event mask. Upon receipt of such an event,
stop the target thread. WIP.

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

diff --git a/src/apps/debugger/controllers/TeamDebugger.cpp
b/src/apps/debugger/controllers/TeamDebugger.cpp
index 9374459..395ecb6 100644
--- a/src/apps/debugger/controllers/TeamDebugger.cpp
+++ b/src/apps/debugger/controllers/TeamDebugger.cpp
@@ -454,7 +454,7 @@ TeamDebugger::Init(team_id teamID, thread_id threadID, int
argc,
// set team debugging flags
fDebuggerInterface->SetTeamDebuggingFlags(
B_TEAM_DEBUG_THREADS | B_TEAM_DEBUG_IMAGES
- | B_TEAM_DEBUG_POST_SYSCALL);
+ | B_TEAM_DEBUG_POST_SYSCALL | B_TEAM_DEBUG_SIGNALS);

// get the initial state of the team
AutoLocker< ::Team> teamLocker(fTeam);
@@ -1617,8 +1617,18 @@ TeamDebugger::_HandleDebuggerMessage(DebugEvent* event)
}
break;
}
- case B_DEBUGGER_MESSAGE_PRE_SYSCALL:
case B_DEBUGGER_MESSAGE_SIGNAL_RECEIVED:
+ {
+ TRACE_EVENTS("B_DEBUGGER_MESSAGE_SIGNAL_RECEIVED:
thread: %"
+ B_PRId32 "\n", event->Thread());
+
+ if (handler != NULL) {
+ handled = handler->HandleSignalReceived(
+
dynamic_cast<SignalReceivedEvent*>(event));
+ }
+ break;
+ }
+ case B_DEBUGGER_MESSAGE_PRE_SYSCALL:
case B_DEBUGGER_MESSAGE_PROFILER_UPDATE:
case B_DEBUGGER_MESSAGE_HANDED_OVER:
// not interested
diff --git a/src/apps/debugger/controllers/ThreadHandler.cpp
b/src/apps/debugger/controllers/ThreadHandler.cpp
index 8978d88..838b8ff 100644
--- a/src/apps/debugger/controllers/ThreadHandler.cpp
+++ b/src/apps/debugger/controllers/ThreadHandler.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@xxxxxx.
- * Copyright 2010-2014, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2010-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Distributed under the terms of the MIT License.
*/

@@ -26,6 +26,7 @@
#include "Jobs.h"
#include "MessageCodes.h"
#include "Register.h"
+#include "SignalDispositionTypes.h"
#include "SourceCode.h"
#include "SourceLanguage.h"
#include "SpecificImageDebugInfo.h"
@@ -246,6 +247,59 @@
ThreadHandler::HandleExceptionOccurred(ExceptionOccurredEvent* event)
}


+bool
+ThreadHandler::HandleSignalReceived(SignalReceivedEvent* event)
+{
+ ::Team* team = fThread->GetTeam();
+ AutoLocker<Team> locker(team);
+
+ const SignalInfo& info = event->GetSignalInfo();
+ int32 signal = info.Signal();
+ int32 disposition = team->SignalDispositionFor(signal);
+
+ switch (disposition) {
+ case SIGNAL_DISPOSITION_IGNORE:
+ return false;
+ case SIGNAL_DISPOSITION_STOP_AT_SIGNAL_HANDLER:
+ {
+ const struct sigaction& handlerInfo = info.Handler();
+ target_addr_t address = 0;
+ if ((handlerInfo.sa_flags & SA_SIGINFO) != 0)
+ address =
(target_addr_t)handlerInfo.sa_sigaction;
+ else
+ address = (target_addr_t)handlerInfo.sa_handler;
+
+ if (address == (target_addr_t)SIG_DFL
+ || address == (target_addr_t)SIG_IGN
+ || address == (target_addr_t)SIG_HOLD) {
+ address = 0;
+ }
+
+ if (address != 0 &&
_InstallTemporaryBreakpoint(address) == B_OK
+ &&
fDebuggerInterface->ContinueThread(ThreadID()) == B_OK) {
+ fStepMode = STEP_UNTIL;
+ return true;
+ }
+
+ // fall through if no handler or if we failed to
+ // set a breakpoint at the handler
+ }
+ case SIGNAL_DISPOSITION_STOP_AT_RECEIPT:
+ {
+ BString stopReason;
+ stopReason.SetToFormat("Received signal %" B_PRId32 "
(%s)",
+ signal, strsignal(signal));
+ return _HandleThreadStopped(NULL,
THREAD_STOPPED_DEBUGGED,
+ stopReason);
+ }
+ default:
+ break;
+ }
+
+ return false;
+}
+
+
void
ThreadHandler::HandleThreadAction(uint32 action, target_addr_t address)
{
diff --git a/src/apps/debugger/controllers/ThreadHandler.h
b/src/apps/debugger/controllers/ThreadHandler.h
index eb34741..432eac1 100644
--- a/src/apps/debugger/controllers/ThreadHandler.h
+++ b/src/apps/debugger/controllers/ThreadHandler.h
@@ -57,6 +57,8 @@ public:

SingleStepEvent* event);
bool HandleExceptionOccurred(

ExceptionOccurredEvent* event);
+ bool HandleSignalReceived(
+
SignalReceivedEvent* event);

void
HandleThreadAction(uint32 action,

target_addr_t address);

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

Commit: c3c2ab316943a85f189415961734382c71e24f23
URL: http://cgit.haiku-os.org/haiku/commit/?id=c3c2ab316943
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sun Jun 28 01:12:24 2015 UTC

Debugger: Code reorganization, no functional change.

- Rename BreakConditionConfigWindow to TeamSettingsWindow,
and move to own dedicated subfolder. Adjust callers accordingly.
Preparation work for other changes to come.

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

diff --git a/src/apps/debugger/Jamfile b/src/apps/debugger/Jamfile
index 2428432..ae3adc5 100644
--- a/src/apps/debugger/Jamfile
+++ b/src/apps/debugger/Jamfile
@@ -39,6 +39,7 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui inspector_window ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui model ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui team_window ] ;
+SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui team_settings_window
] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui teams_window ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui utility_windows ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui util ] ;
@@ -288,6 +289,9 @@ Application Debugger :
ThreadListView.cpp
VariablesView.cpp

+ # user_interface/gui/team_settings_window
+ TeamSettingsWindow.cpp
+
# user_interface/gui/util
ActionMenuItem.cpp
GuiSettingsUtils.cpp
@@ -295,7 +299,6 @@ Application Debugger :
TargetAddressTableColumn.cpp

# user_interface/gui/utility_windows
- BreakConditionConfigWindow.cpp
BreakpointEditWindow.cpp
ExpressionPromptWindow.cpp
StartTeamWindow.cpp
diff --git a/src/apps/debugger/MessageCodes.h b/src/apps/debugger/MessageCodes.h
index dd457a6..da21be5 100644
--- a/src/apps/debugger/MessageCodes.h
+++ b/src/apps/debugger/MessageCodes.h
@@ -63,10 +63,10 @@ enum {

MSG_TEAM_DEBUGGER_QUIT =
'dbqt',
MSG_TEAM_RESTART_REQUESTED =
'trrq',
- MSG_SHOW_TEAMS_WINDOW =
'stsw',
- MSG_TEAMS_WINDOW_CLOSED =
'tswc',
- MSG_SHOW_BREAK_CONDITION_CONFIG_WINDOW = 'sbcc',
- MSG_BREAK_CONDITION_CONFIG_WINDOW_CLOSED = 'bccw',
+ MSG_SHOW_TEAMS_WINDOW =
'stew',
+ MSG_TEAMS_WINDOW_CLOSED =
'tewc',
+ MSG_SHOW_TEAM_SETTINGS_WINDOW = 'stsw',
+ MSG_TEAM_SETTINGS_WINDOW_CLOSED = 'tswc',
MSG_SHOW_BREAKPOINT_EDIT_WINDOW = 'sbew',
MSG_BREAKPOINT_EDIT_WINDOW_CLOSED = 'bewc',
MSG_SHOW_START_TEAM_WINDOW =
'sstw',
diff --git
a/src/apps/debugger/user_interface/gui/utility_windows/BreakConditionConfigWindow.cpp

b/src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.cpp
similarity index 90%
rename from
src/apps/debugger/user_interface/gui/utility_windows/BreakConditionConfigWindow.cpp
rename to
src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.cpp
index f750f82..d616b4e 100644
---
a/src/apps/debugger/user_interface/gui/utility_windows/BreakConditionConfigWindow.cpp
+++
b/src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.cpp
@@ -1,8 +1,8 @@
/*
- * Copyright 2013, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2013-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Distributed under the terms of the MIT License.
*/
-#include "BreakConditionConfigWindow.h"
+#include "TeamSettingsWindow.h"

#include <Box.h>
#include <Button.h>
@@ -44,10 +44,10 @@ static int SortStringItems(const void* a, const void* b)
}


-BreakConditionConfigWindow::BreakConditionConfigWindow(::Team* team,
+TeamSettingsWindow::TeamSettingsWindow(::Team* team,
UserInterfaceListener* listener, BHandler* target)
:
- BWindow(BRect(), "Configure break conditions", B_FLOATING_WINDOW,
+ BWindow(BRect(), "Team settings", B_FLOATING_WINDOW,
B_AUTO_UPDATE_SIZE_LIMITS | B_CLOSE_ON_ESCAPE),
fTeam(team),
fListener(listener),
@@ -71,18 +71,18 @@
BreakConditionConfigWindow::BreakConditionConfigWindow(::Team* team,
}


-BreakConditionConfigWindow::~BreakConditionConfigWindow()
+TeamSettingsWindow::~TeamSettingsWindow()
{
fTeam->RemoveListener(this);
-
BMessenger(fTarget).SendMessage(MSG_BREAK_CONDITION_CONFIG_WINDOW_CLOSED);
+ BMessenger(fTarget).SendMessage(MSG_TEAM_SETTINGS_WINDOW_CLOSED);
}


-BreakConditionConfigWindow*
-BreakConditionConfigWindow::Create(::Team* team,
+TeamSettingsWindow*
+TeamSettingsWindow::Create(::Team* team,
UserInterfaceListener* listener, BHandler* target)
{
- BreakConditionConfigWindow* self = new BreakConditionConfigWindow(
+ TeamSettingsWindow* self = new TeamSettingsWindow(
team, listener, target);

try {
@@ -97,7 +97,7 @@ BreakConditionConfigWindow::Create(::Team* team,
}

void
-BreakConditionConfigWindow::MessageReceived(BMessage* message)
+TeamSettingsWindow::MessageReceived(BMessage* message)
{
switch (message->what) {
case MSG_STOP_ON_THROWN_EXCEPTION_CHANGED:
@@ -232,7 +232,7 @@ BreakConditionConfigWindow::MessageReceived(BMessage*
message)


void
-BreakConditionConfigWindow::Show()
+TeamSettingsWindow::Show()
{
CenterOnScreen();
BWindow::Show();
@@ -240,7 +240,7 @@ BreakConditionConfigWindow::Show()


void
-BreakConditionConfigWindow::StopOnImageLoadSettingsChanged(
+TeamSettingsWindow::StopOnImageLoadSettingsChanged(
const Team::ImageLoadEvent& event)
{
BMessage message(MSG_STOP_IMAGE_SETTINGS_CHANGED);
@@ -251,7 +251,7 @@ BreakConditionConfigWindow::StopOnImageLoadSettingsChanged(


void
-BreakConditionConfigWindow::StopOnImageLoadNameAdded(
+TeamSettingsWindow::StopOnImageLoadNameAdded(
const Team::ImageLoadNameEvent& event)
{
BMessage message(MSG_STOP_IMAGE_NAME_ADDED);
@@ -261,7 +261,7 @@ BreakConditionConfigWindow::StopOnImageLoadNameAdded(


void
-BreakConditionConfigWindow::StopOnImageLoadNameRemoved(
+TeamSettingsWindow::StopOnImageLoadNameRemoved(
const Team::ImageLoadNameEvent& event)
{
BMessage message(MSG_STOP_IMAGE_NAME_REMOVED);
@@ -271,7 +271,7 @@ BreakConditionConfigWindow::StopOnImageLoadNameRemoved(


void
-BreakConditionConfigWindow::_Init()
+TeamSettingsWindow::_Init()
{
fExceptionSettingsBox = new BBox("exceptionBox");
fExceptionSettingsBox->SetLabel("Exceptions");
@@ -365,7 +365,7 @@ BreakConditionConfigWindow::_Init()


void
-BreakConditionConfigWindow::_UpdateThrownBreakpoints(bool enable)
+TeamSettingsWindow::_UpdateThrownBreakpoints(bool enable)
{
AutoLocker< ::Team> teamLocker(fTeam);
for (ImageList::ConstIterator it = fTeam->Images().GetIterator();
@@ -386,7 +386,7 @@ BreakConditionConfigWindow::_UpdateThrownBreakpoints(bool
enable)


status_t
-BreakConditionConfigWindow::_FindExceptionFunction(ImageDebugInfo* info,
+TeamSettingsWindow::_FindExceptionFunction(ImageDebugInfo* info,
target_addr_t& _foundAddress) const
{
if (info != NULL) {
@@ -406,7 +406,7 @@
BreakConditionConfigWindow::_FindExceptionFunction(ImageDebugInfo* info,


void
-BreakConditionConfigWindow::_UpdateExceptionState()
+TeamSettingsWindow::_UpdateExceptionState()
{
// check if the exception breakpoints are already installed
for (ImageList::ConstIterator it = fTeam->Images().GetIterator();
@@ -427,7 +427,7 @@ BreakConditionConfigWindow::_UpdateExceptionState()


void
-BreakConditionConfigWindow::_UpdateStopImageState()
+TeamSettingsWindow::_UpdateStopImageState()
{
bool previousStop = fStopOnLoadEnabled;
bool previousCustomImages = fUseCustomImages && fStopOnLoadEnabled;
@@ -458,7 +458,7 @@ BreakConditionConfigWindow::_UpdateStopImageState()


void
-BreakConditionConfigWindow::_UpdateStopImageButtons(bool previousStop,
+TeamSettingsWindow::_UpdateStopImageButtons(bool previousStop,
bool previousCustomImages)
{
fStopImageConstraints->SetEnabled(fStopOnLoadEnabled);
diff --git
a/src/apps/debugger/user_interface/gui/utility_windows/BreakConditionConfigWindow.h

b/src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.h
similarity index 82%
rename from
src/apps/debugger/user_interface/gui/utility_windows/BreakConditionConfigWindow.h
rename to
src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.h
index 1e07c09..ec754a4 100644
---
a/src/apps/debugger/user_interface/gui/utility_windows/BreakConditionConfigWindow.h
+++
b/src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.h
@@ -1,9 +1,9 @@
/*
- * Copyright 2013, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2013-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Distributed under the terms of the MIT License.
*/
-#ifndef BREAK_CONDITION_CONFIG_WINDOW_H
-#define BREAK_CONDITION_CONFIG_WINDOW_H
+#ifndef TEAM_SETTINGS_WINDOW_H
+#define TEAM_SETTINGS_WINDOW_H


#include <Window.h>
@@ -23,15 +23,15 @@ class ImageDebugInfo;
class UserInterfaceListener;


-class BreakConditionConfigWindow : public BWindow, private Team::Listener {
+class TeamSettingsWindow : public BWindow, private Team::Listener {
public:
-
BreakConditionConfigWindow(::Team* team,
+
TeamSettingsWindow(::Team* team,

UserInterfaceListener* listener,

BHandler* target);

-
~BreakConditionConfigWindow();
+
~TeamSettingsWindow();

- static BreakConditionConfigWindow* Create(::Team* team,
+ static TeamSettingsWindow* Create(::Team* team,

UserInterfaceListener* listener,

BHandler* target);
//
throws
@@ -84,4 +84,4 @@ private:
};


-#endif // BREAK_CONDITION_CONFIG_WINDOW_H
+#endif // TEAM_SETTINGS_WINDOW_H
diff --git
a/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.cpp
b/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.cpp
index acd7888..b6088ad 100644
--- a/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.cpp
+++ b/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
- * Copyright 2011-2013, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2011-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Distributed under the terms of the MIT License.
*/

@@ -29,7 +29,6 @@ BreakpointsView::BreakpointsView(Team* team, Listener*
listener)
BGroupView(B_HORIZONTAL, 4.0f),
fTeam(team),
fListView(NULL),
- fConfigureExceptionsButton(NULL),
fToggleBreakpointButton(NULL),
fEditBreakpointButton(NULL),
fRemoveBreakpointButton(NULL),
@@ -113,7 +112,6 @@ BreakpointsView::MessageReceived(BMessage* message)
void
BreakpointsView::AttachedToWindow()
{
- fConfigureExceptionsButton->SetTarget(Window());
fEditBreakpointButton->SetTarget(this);
fToggleBreakpointButton->SetTarget(this);
fRemoveBreakpointButton->SetTarget(this);
@@ -162,15 +160,11 @@ BreakpointsView::_Init()
.AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING)
.SetInsets(B_USE_SMALL_SPACING)
.AddGlue()
- .Add(fConfigureExceptionsButton = new BButton(
- "Configure break conditions" B_UTF8_ELLIPSIS))
.Add(fRemoveBreakpointButton = new BButton("Remove"))
.Add(fEditBreakpointButton = new BButton("Edit"
B_UTF8_ELLIPSIS))
.Add(fToggleBreakpointButton = new BButton("Toggle"))
.End();

- fConfigureExceptionsButton->SetMessage(
- new BMessage(MSG_SHOW_BREAK_CONDITION_CONFIG_WINDOW));
fToggleBreakpointButton->SetMessage(new
BMessage(MSG_ENABLE_BREAKPOINT));
fRemoveBreakpointButton->SetMessage(new BMessage(MSG_CLEAR_BREAKPOINT));
fEditBreakpointButton->SetMessage(
diff --git a/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.h
b/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.h
index 4946b46..15681d8 100644
--- a/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.h
+++ b/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.h
@@ -55,7 +55,6 @@ private:
Team* fTeam;
BreakpointListView* fListView;
BreakpointProxyList fSelectedBreakpoints;
- BButton*
fConfigureExceptionsButton;
BButton* fToggleBreakpointButton;
BButton* fEditBreakpointButton;
BButton* fRemoveBreakpointButton;
diff --git a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp
b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp
index 769d155..4a29f22 100644
--- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp
+++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@xxxxxx.
- * Copyright 2010-2014, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2010-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Distributed under the terms of the MIT License.
*/

@@ -33,7 +33,6 @@
#include <AutoDeleter.h>
#include <AutoLocker.h>

-#include "BreakConditionConfigWindow.h"
#include "Breakpoint.h"
#include "BreakpointEditWindow.h"
#include "ConsoleOutputView.h"
@@ -53,6 +52,7 @@
#include "RegistersView.h"
#include "StackTrace.h"
#include "StackTraceView.h"
+#include "TeamSettingsWindow.h"
#include "Tracing.h"
#include "TypeComponentPath.h"
#include "UiUtils.h"
@@ -138,7 +138,7 @@ TeamWindow::TeamWindow(::Team* team, UserInterfaceListener*
listener)
fImageSplitView(NULL),
fThreadSplitView(NULL),
fConsoleSplitView(NULL),
- fBreakConditionConfigWindow(NULL),
+ fTeamSettingsWindow(NULL),
fBreakpointEditWindow(NULL),
fInspectorWindow(NULL),
fExpressionPromptWindow(NULL),
@@ -397,28 +397,28 @@ TeamWindow::MessageReceived(BMessage* message)
}
break;
}
- case MSG_SHOW_BREAK_CONDITION_CONFIG_WINDOW:
+ case MSG_SHOW_TEAM_SETTINGS_WINDOW:
{
- if (fBreakConditionConfigWindow != NULL) {
- AutoLocker<BWindow>
lock(fBreakConditionConfigWindow);
+ if (fTeamSettingsWindow != NULL) {
+ AutoLocker<BWindow> lock(fTeamSettingsWindow);
if (lock.IsLocked())
-
fBreakConditionConfigWindow->Activate(true);
+ fTeamSettingsWindow->Activate(true);
} else {
try {
- fBreakConditionConfigWindow
- =
BreakConditionConfigWindow::Create(
+ fTeamSettingsWindow
+ = TeamSettingsWindow::Create(
fTeam, fListener, this);
- if (fBreakConditionConfigWindow != NULL)
-
fBreakConditionConfigWindow->Show();
+ if (fTeamSettingsWindow != NULL)
+ fTeamSettingsWindow->Show();
} catch (...) {
// TODO: notify user
}
}
break;
}
- case MSG_BREAK_CONDITION_CONFIG_WINDOW_CLOSED:
+ case MSG_TEAM_SETTINGS_WINDOW_CLOSED:
{
- fBreakConditionConfigWindow = NULL;
+ fTeamSettingsWindow = NULL;
break;
}
case MSG_SHOW_BREAKPOINT_EDIT_WINDOW:
@@ -1100,6 +1100,11 @@ TeamWindow::_Init()
'W');
menu->AddItem(item);
item->SetTarget(this);
+ menu->AddSeparatorItem();
+ item = new BMenuItem("Settings" B_UTF8_ELLIPSIS, new BMessage(
+ MSG_SHOW_TEAM_SETTINGS_WINDOW));
+ menu->AddItem(item);
+ item->SetTarget(this);
menu = new BMenu("Edit");
fMenuBar->AddItem(menu);
item = new BMenuItem("Copy", new BMessage(B_COPY), 'C');
diff --git a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.h
b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.h
index d9f5dfa..a75ed2c 100644
--- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.h
+++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.h
@@ -1,6 +1,6 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
- * Copyright 2010-2014, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2010-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Distributed under the terms of the MIT License.
*/
#ifndef TEAM_WINDOW_H
@@ -32,7 +32,6 @@ class BStringList;
class BStringView;
class BTabView;
class ConsoleOutputView;
-class BreakConditionConfigWindow;
class BreakpointEditWindow;
class ExpressionPromptWindow;
class Image;
@@ -41,6 +40,7 @@ class RegistersView;
class SourceCode;
class SourceLanguage;
class StackFrame;
+class TeamSettingsWindow;
class Type;
class UserBreakpoint;
class UserInterfaceListener;
@@ -227,7 +227,7 @@ private:
BSplitView* fImageSplitView;
BSplitView* fThreadSplitView;
BSplitView* fConsoleSplitView;
- BreakConditionConfigWindow* fBreakConditionConfigWindow;
+ TeamSettingsWindow* fTeamSettingsWindow;
BreakpointEditWindow* fBreakpointEditWindow;
InspectorWindow* fInspectorWindow;
ExpressionPromptWindow* fExpressionPromptWindow;

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

Commit: 10b962261a1316c97dc6ca4c1e68e2109472d2d7
URL: http://cgit.haiku-os.org/haiku/commit/?id=10b962261a13
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sun Jun 28 01:48:44 2015 UTC

Debugger: Layout changes to team settings window.

TeamSettingsWindow:
- Split out functionality into separate views for images and exceptions,
which in turn are held in dedicated tabs.

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

diff --git a/src/apps/debugger/Jamfile b/src/apps/debugger/Jamfile
index ae3adc5..800de9f 100644
--- a/src/apps/debugger/Jamfile
+++ b/src/apps/debugger/Jamfile
@@ -290,6 +290,8 @@ Application Debugger :
VariablesView.cpp

# user_interface/gui/team_settings_window
+ ExceptionStopConfigView.cpp
+ ImageStopConfigView.cpp
TeamSettingsWindow.cpp

# user_interface/gui/util
diff --git
a/src/apps/debugger/user_interface/gui/team_settings_window/ExceptionStopConfigView.cpp

b/src/apps/debugger/user_interface/gui/team_settings_window/ExceptionStopConfigView.cpp
new file mode 100644
index 0000000..15d286d
--- /dev/null
+++
b/src/apps/debugger/user_interface/gui/team_settings_window/ExceptionStopConfigView.cpp
@@ -0,0 +1,176 @@
+/*
+ * Copyright 2013-2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+#include "ExceptionStopConfigView.h"
+
+#include <CheckBox.h>
+#include <LayoutBuilder.h>
+
+#include <AutoDeleter.h>
+#include <AutoLocker.h>
+
+#include "FunctionInstance.h"
+#include "Image.h"
+#include "ImageDebugInfo.h"
+#include "MessageCodes.h"
+#include "UserInterface.h"
+#include "Team.h"
+
+
+enum {
+ MSG_STOP_ON_THROWN_EXCEPTION_CHANGED = 'stec',
+ MSG_STOP_ON_CAUGHT_EXCEPTION_CHANGED = 'scec',
+};
+
+
+ExceptionStopConfigView::ExceptionStopConfigView(::Team* team,
+ UserInterfaceListener* listener)
+ :
+ BGroupView(B_VERTICAL),
+ fTeam(team),
+ fListener(listener),
+ fExceptionThrown(NULL),
+ fExceptionCaught(NULL)
+{
+ SetName("Exceptions");
+}
+
+
+ExceptionStopConfigView::~ExceptionStopConfigView()
+{
+}
+
+
+ExceptionStopConfigView*
+ExceptionStopConfigView::Create(::Team* team, UserInterfaceListener* listener)
+{
+ ExceptionStopConfigView* self = new ExceptionStopConfigView(
+ team, listener);
+
+ try {
+ self->_Init();
+ } catch (...) {
+ delete self;
+ throw;
+ }
+
+ return self;
+
+}
+
+
+void
+ExceptionStopConfigView::AttachedToWindow()
+{
+ fExceptionThrown->SetTarget(this);
+ fExceptionCaught->SetTarget(this);
+
+ AutoLocker< ::Team> teamLocker(fTeam);
+ _UpdateExceptionState();
+
+ BGroupView::AttachedToWindow();
+}
+
+
+void
+ExceptionStopConfigView::MessageReceived(BMessage* message)
+{
+ switch (message->what) {
+ case MSG_STOP_ON_THROWN_EXCEPTION_CHANGED:
+ {
+ _UpdateThrownBreakpoints(fExceptionThrown->Value()
+ == B_CONTROL_ON);
+ break;
+ }
+ case MSG_STOP_ON_CAUGHT_EXCEPTION_CHANGED:
+ {
+ break;
+ }
+ default:
+ BGroupView::MessageReceived(message);
+ break;
+ }
+
+}
+
+
+void
+ExceptionStopConfigView::_Init()
+{
+ BLayoutBuilder::Group<>(this, B_VERTICAL)
+ .SetInsets(B_USE_DEFAULT_SPACING)
+ .AddGlue()
+ .Add(fExceptionThrown = new BCheckBox("exceptionThrown",
+ "Stop when an exception is thrown",
+ new BMessage(MSG_STOP_ON_THROWN_EXCEPTION_CHANGED)))
+ .Add(fExceptionCaught = new BCheckBox("exceptionCaught",
+ "Stop when an exception is caught",
+ new BMessage(MSG_STOP_ON_CAUGHT_EXCEPTION_CHANGED)))
+ .AddGlue();
+
+ // TODO: enable once implemented
+ fExceptionCaught->SetEnabled(false);
+}
+
+
+void
+ExceptionStopConfigView::_UpdateThrownBreakpoints(bool enable)
+{
+ AutoLocker< ::Team> teamLocker(fTeam);
+ for (ImageList::ConstIterator it = fTeam->Images().GetIterator();
+ it.HasNext();) {
+ Image* image = it.Next();
+
+ ImageDebugInfo* info = image->GetImageDebugInfo();
+ target_addr_t address;
+ if (_FindExceptionFunction(info, address) != B_OK)
+ continue;
+
+ if (enable)
+ fListener->SetBreakpointRequested(address, true, true);
+ else
+ fListener->ClearBreakpointRequested(address);
+ }
+}
+
+
+status_t
+ExceptionStopConfigView::_FindExceptionFunction(ImageDebugInfo* info,
+ target_addr_t& _foundAddress) const
+{
+ if (info != NULL) {
+ FunctionInstance* instance = info->FunctionByName(
+ "__cxa_allocate_exception");
+ if (instance == NULL)
+ instance = info->FunctionByName("__throw(void)");
+
+ if (instance != NULL) {
+ _foundAddress = instance->Address();
+ return B_OK;
+ }
+ }
+
+ return B_NAME_NOT_FOUND;
+}
+
+
+void
+ExceptionStopConfigView::_UpdateExceptionState()
+{
+ // check if the exception breakpoints are already installed
+ for (ImageList::ConstIterator it = fTeam->Images().GetIterator();
+ it.HasNext();) {
+ Image* image = it.Next();
+
+ ImageDebugInfo* info = image->GetImageDebugInfo();
+ target_addr_t address;
+ if (_FindExceptionFunction(info, address) != B_OK)
+ continue;
+
+ if (fTeam->BreakpointAtAddress(address) != NULL) {
+ fExceptionThrown->SetValue(B_CONTROL_ON);
+ break;
+ }
+ }
+}
diff --git
a/src/apps/debugger/user_interface/gui/team_settings_window/ExceptionStopConfigView.h

b/src/apps/debugger/user_interface/gui/team_settings_window/ExceptionStopConfigView.h
new file mode 100644
index 0000000..11a7835
--- /dev/null
+++
b/src/apps/debugger/user_interface/gui/team_settings_window/ExceptionStopConfigView.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2013-2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef EXCEPTION_STOP_CONFIG_VIEW_H
+#define EXCEPTION_STOP_CONFIG_VIEW_H
+
+
+#include <GroupView.h>
+
+#include "types/Types.h"
+
+
+class BBox;
+class BButton;
+class BCheckBox;
+class ImageDebugInfo;
+class Team;
+class UserInterfaceListener;
+
+
+class ExceptionStopConfigView : public BGroupView {
+public:
+
ExceptionStopConfigView(::Team* team,
+
UserInterfaceListener* listener);
+
+
~ExceptionStopConfigView();
+
+ static ExceptionStopConfigView* Create(::Team* team,
+
UserInterfaceListener* listener);
+ //
throws
+
+ virtual void AttachedToWindow();
+ virtual void MessageReceived(BMessage*
message);
+
+private:
+ void _Init();
+ void
_UpdateThrownBreakpoints(bool enable);
+ status_t
_FindExceptionFunction(ImageDebugInfo* info,
+
target_addr_t& _foundAddress) const;
+
+ void _UpdateExceptionState();
+
+private:
+ ::Team* fTeam;
+ UserInterfaceListener* fListener;
+ BCheckBox* fExceptionThrown;
+ BCheckBox* fExceptionCaught;
+};
+
+
+#endif // EXCEPTION_STOP_CONFIG_VIEW_H
diff --git
a/src/apps/debugger/user_interface/gui/team_settings_window/ImageStopConfigView.cpp

b/src/apps/debugger/user_interface/gui/team_settings_window/ImageStopConfigView.cpp
new file mode 100644
index 0000000..d5f554b
--- /dev/null
+++
b/src/apps/debugger/user_interface/gui/team_settings_window/ImageStopConfigView.cpp
@@ -0,0 +1,337 @@
+/*
+ * Copyright 2013-2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+#include "ImageStopConfigView.h"
+
+#include <Button.h>
+#include <CheckBox.h>
+#include <LayoutBuilder.h>
+#include <ListView.h>
+#include <MenuField.h>
+#include <ScrollView.h>
+
+#include <AutoDeleter.h>
+#include <AutoLocker.h>
+
+#include "FunctionInstance.h"
+#include "Image.h"
+#include "ImageDebugInfo.h"
+#include "MessageCodes.h"
+#include "UserInterface.h"
+
+
+enum {
+ MSG_SET_STOP_FOR_ALL_IMAGES = 'sfai',
+ MSG_SET_STOP_FOR_CUSTOM_IMAGES = 'sfci',
+ MSG_IMAGE_NAME_SELECTION_CHANGED = 'insc',
+ MSG_ADD_IMAGE_NAME =
'anin',
+ MSG_REMOVE_IMAGE_NAME = 'arin',
+ MSG_IMAGE_NAME_INPUT_CHANGED = 'inic'
+};
+
+
+static int SortStringItems(const void* a, const void* b)
+{
+ BStringItem* item1 = *(BStringItem**)a;
+ BStringItem* item2 = *(BStringItem**)b;
+
+ return strcmp(item1->Text(), item2->Text());
+}
+
+
+ImageStopConfigView::ImageStopConfigView(::Team* team,
+ UserInterfaceListener* listener)
+ :
+ BGroupView(B_VERTICAL),
+ fTeam(team),
+ fListener(listener),
+ fStopOnImageLoad(NULL),
+ fStopImageConstraints(NULL),
+ fStopImageNames(NULL),
+ fStopImageNameInput(NULL),
+ fAddImageNameButton(NULL),
+ fRemoveImageNameButton(NULL),
+ fCustomImageGroup(NULL),
+ fStopOnLoadEnabled(false),
+ fUseCustomImages(false)
+{
+ SetName("Images");
+ fTeam->AddListener(this);
+}
+
+
+ImageStopConfigView::~ImageStopConfigView()
+{
+ fTeam->RemoveListener(this);
+}
+
+
+ImageStopConfigView*
+ImageStopConfigView::Create(::Team* team, UserInterfaceListener* listener)
+{
+ ImageStopConfigView* self = new ImageStopConfigView(team, listener);
+
+ try {
+ self->_Init();
+ } catch (...) {
+ delete self;
+ throw;
+ }
+
+ return self;
+}
+
+
+void
+ImageStopConfigView::AttachedToWindow()
+{
+ fAddImageNameButton->SetEnabled(false);
+ fRemoveImageNameButton->SetEnabled(false);
+
+ fStopImageConstraints->Menu()->SetTargetForItems(this);
+ fStopOnImageLoad->SetTarget(this);
+ fAddImageNameButton->SetTarget(this);
+ fRemoveImageNameButton->SetTarget(this);
+ fStopImageNames->SetTarget(this);
+ fStopImageNameInput->SetTarget(this);
+
+ AutoLocker< ::Team> teamLocker(fTeam);
+ _UpdateStopImageState();
+
+ BGroupView::AttachedToWindow();
+}
+
+
+void
+ImageStopConfigView::MessageReceived(BMessage* message)
+{
+ switch (message->what) {
+ case MSG_SET_STOP_FOR_ALL_IMAGES:
+ {
+ fListener->SetStopOnImageLoadRequested(
+ fStopOnImageLoad->Value() == B_CONTROL_ON,
+ false);
+ break;
+ }
+
+ case MSG_SET_STOP_FOR_CUSTOM_IMAGES:
+ {
+ fListener->SetStopOnImageLoadRequested(
+ fStopOnImageLoad->Value() == B_CONTROL_ON,
+ true);
+ break;
+ }
+
+ case MSG_IMAGE_NAME_SELECTION_CHANGED:
+ {
+ if (!fUseCustomImages)
+ break;
+
+ fRemoveImageNameButton->SetEnabled(
+ fStopImageNames->CurrentSelection() >= 0);
+ break;
+ }
+
+ case MSG_IMAGE_NAME_INPUT_CHANGED:
+ {
+ BString imageName(fStopImageNameInput->Text());
+ imageName.Trim();
+ fAddImageNameButton->SetEnabled(!imageName.IsEmpty());
+ break;
+ }
+
+ case MSG_STOP_ON_IMAGE_LOAD:
+ {
+ fListener->SetStopOnImageLoadRequested(
+ fStopOnImageLoad->Value() == B_CONTROL_ON,
+ fUseCustomImages);
+ break;
+ }
+
+ case MSG_STOP_IMAGE_SETTINGS_CHANGED:
+ {
+ _UpdateStopImageState();
+ break;
+ }
+
+ case MSG_ADD_IMAGE_NAME:
+ {
+ BString imageName(fStopImageNameInput->Text());
+ imageName.Trim();
+ AutoLocker< ::Team> teamLocker(fTeam);
+ if (fTeam->StopImageNames().HasString(imageName))
+ break;
+
+ fStopImageNameInput->SetText("");
+
fListener->AddStopImageNameRequested(imageName.String());
+ break;
+ }
+
+ case MSG_STOP_IMAGE_NAME_ADDED:
+ {
+ const char* imageName;
+ if (message->FindString("name", &imageName) != B_OK)
+ break;
+
+ BStringItem* item = new(std::nothrow)
BStringItem(imageName);
+ if (item == NULL)
+ break;
+
+ ObjectDeleter<BStringItem> itemDeleter(item);
+ if (!fStopImageNames->AddItem(item)) {
+ break;
+ }
+ itemDeleter.Detach();
+ fStopImageNames->SortItems(SortStringItems);
+ break;
+ }
+
+ case MSG_REMOVE_IMAGE_NAME:
+ {
+ BStringItem* item;
+ int32 selectedIndex;
+ AutoLocker< ::Team> teamLocker(fTeam);
+ int32 i = 0;
+ while ((selectedIndex =
fStopImageNames->CurrentSelection(i++))
+ >= 0) {
+ item =
(BStringItem*)fStopImageNames->ItemAt(selectedIndex);
+
fListener->RemoveStopImageNameRequested(item->Text());
+ }
+ break;
+ }
+
+ case MSG_STOP_IMAGE_NAME_REMOVED:
+ {
+ const char* imageName;
+ if (message->FindString("name", &imageName) != B_OK)
+ break;
+
+ for (int32 i = 0; i < fStopImageNames->CountItems();
i++) {
+ BStringItem* item =
(BStringItem*)fStopImageNames->ItemAt(i);
+ if (strcmp(item->Text(), imageName) == 0) {
+ fStopImageNames->RemoveItem(i);
+ delete item;
+ }
+ }
+ break;
+ }
+
+
+ default:
+ BGroupView::MessageReceived(message);
+ break;
+ }
+
+}
+
+
+void
+ImageStopConfigView::StopOnImageLoadSettingsChanged(
+ const Team::ImageLoadEvent& event)
+{
+ BMessage message(MSG_STOP_IMAGE_SETTINGS_CHANGED);
+ message.AddBool("enabled", event.StopOnImageLoad());
+ message.AddBool("useNameList", event.StopImageNameListEnabled());
+ BMessenger(this).SendMessage(&message);
+}
+
+
+void
+ImageStopConfigView::StopOnImageLoadNameAdded(
+ const Team::ImageLoadNameEvent& event)
+{
+ BMessage message(MSG_STOP_IMAGE_NAME_ADDED);
+ message.AddString("name", event.ImageName());
+ BMessenger(this).SendMessage(&message);
+}
+
+
+void
+ImageStopConfigView::StopOnImageLoadNameRemoved(
+ const Team::ImageLoadNameEvent& event)
+{
+ BMessage message(MSG_STOP_IMAGE_NAME_REMOVED);
+ message.AddString("name", event.ImageName());
+ BMessenger(this).SendMessage(&message);
+}
+
+
+void
+ImageStopConfigView::_Init()
+{
+ BMenu* stopImageMenu = new BMenu("stopImageTypesMenu");
+
+ stopImageMenu->AddItem(new BMenuItem("All",
+ new BMessage(MSG_SET_STOP_FOR_ALL_IMAGES)));
+ stopImageMenu->AddItem(new BMenuItem("Custom",
+ new BMessage(MSG_SET_STOP_FOR_CUSTOM_IMAGES)));
+
+ fStopImageNames = new BListView("customImageList",
+ B_MULTIPLE_SELECTION_LIST);
+ fStopImageNames->SetSelectionMessage(
+ new BMessage(MSG_IMAGE_NAME_SELECTION_CHANGED));
+
+ fCustomImageGroup = new BGroupView();
+ BLayoutBuilder::Group<>(fCustomImageGroup, B_VERTICAL, 0.0)
+ .Add(new BScrollView("stopImageScroll", fStopImageNames,
+ 0, false, true))
+ .Add(fStopImageNameInput = new BTextControl("stopImageName",
+ "Image:", NULL, NULL))
+ .AddGroup(B_HORIZONTAL)
+ .SetInsets(B_USE_SMALL_SPACING)
+ .AddGlue()
+ .Add(fAddImageNameButton = new BButton("Add",
+ new BMessage(MSG_ADD_IMAGE_NAME)))
+ .Add(fRemoveImageNameButton = new BButton("Remove",
+ new BMessage(MSG_REMOVE_IMAGE_NAME)))
+ .End();
+
+ BLayoutBuilder::Group<>(this, B_VERTICAL)
+ .SetInsets(B_USE_SMALL_SPACING)
+ .Add(fStopOnImageLoad = new BCheckBox("stopOnImage",
+ "Stop when an image is loaded",
+ new BMessage(MSG_STOP_ON_IMAGE_LOAD)))
+ .Add(fStopImageConstraints = new BMenuField(
+ "stopTypes", "Types:", stopImageMenu))
+ .Add(fCustomImageGroup);
+
+ font_height fontHeight;
+ be_plain_font->GetHeight(&fontHeight);
+ float minListHeight = 5 * (fontHeight.ascent + fontHeight.descent
+ + fontHeight.leading);
+ fStopImageNames->SetExplicitMinSize(BSize(B_SIZE_UNSET, minListHeight));
+
+ stopImageMenu->SetLabelFromMarked(true);
+ fStopImageNameInput->SetModificationMessage(
+ new BMessage(MSG_IMAGE_NAME_INPUT_CHANGED));
+}
+
+
+void
+ImageStopConfigView::_UpdateStopImageState()
+{
+ fStopOnLoadEnabled = fTeam->StopOnImageLoad();
+ fStopOnImageLoad->SetValue(
+ fStopOnLoadEnabled ? B_CONTROL_ON : B_CONTROL_OFF);
+ fUseCustomImages = fTeam->StopImageNameListEnabled();
+ fStopImageConstraints->Menu()
+ ->ItemAt(fUseCustomImages ? 1 : 0)->SetMarked(true);
+
+ fStopImageNames->MakeEmpty();
+ const BStringList& imageNames = fTeam->StopImageNames();
+ for (int32 i = 0; i < imageNames.CountStrings(); i++) {
+ BStringItem* item = new(std::nothrow) BStringItem(
+ imageNames.StringAt(i));
+ if (item == NULL)
+ return;
+ item->SetEnabled(fUseCustomImages);
+ ObjectDeleter<BStringItem> itemDeleter(item);
+ if (!fStopImageNames->AddItem(item))
+ return;
+ itemDeleter.Detach();
+ }
+
+ fStopImageConstraints->SetEnabled(fStopOnLoadEnabled);
+ fStopImageNameInput->SetEnabled(fUseCustomImages);
+}
diff --git
a/src/apps/debugger/user_interface/gui/team_settings_window/ImageStopConfigView.h

b/src/apps/debugger/user_interface/gui/team_settings_window/ImageStopConfigView.h
new file mode 100644
index 0000000..6e0596c
--- /dev/null
+++
b/src/apps/debugger/user_interface/gui/team_settings_window/ImageStopConfigView.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2013-2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef IMAGE_STOP_CONFIG_VIEW_H
+#define IMAGE_STOP_CONFIG_VIEW_H
+
+
+#include <GroupView.h>
+
+#include "Team.h"
+
+#include "types/Types.h"
+
+
+class BBox;
+class BButton;
+class BCheckBox;
+class BListView;
+class BMenuField;
+class BTextControl;
+class ImageDebugInfo;
+class UserInterfaceListener;
+
+
+class ImageStopConfigView : public BGroupView, private Team::Listener {
+public:
+
ImageStopConfigView(::Team* team,
+
UserInterfaceListener* listener);
+
+
~ImageStopConfigView();
+
+ static ImageStopConfigView* Create(::Team* team,
+
UserInterfaceListener* listener);
+ //
throws
+
+ virtual void AttachedToWindow();
+ virtual void MessageReceived(BMessage*
message);
+
+ // Team::Listener
+ virtual void StopOnImageLoadSettingsChanged(
+ const
Team::ImageLoadEvent& event);
+ virtual void StopOnImageLoadNameAdded(
+ const
Team::ImageLoadNameEvent& event);
+ virtual void StopOnImageLoadNameRemoved(
+ const
Team::ImageLoadNameEvent& event);
+
+
+private:
+ void _Init();
+
+ void _UpdateStopImageState();
+ // must
be called with team lock held
+
+private:
+ ::Team* fTeam;
+ UserInterfaceListener* fListener;
+ BCheckBox* fStopOnImageLoad;
+ BMenuField* fStopImageConstraints;
+ BListView* fStopImageNames;
+ BTextControl* fStopImageNameInput;
+ BButton* fAddImageNameButton;
+ BButton* fRemoveImageNameButton;
+ BView* fCustomImageGroup;
+ bool fStopOnLoadEnabled;
+ bool fUseCustomImages;
+};
+
+
+#endif // IMAGE_STOP_CONFIG_VIEW_H
diff --git
a/src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.cpp

b/src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.cpp
index d616b4e..5152b24 100644
---
a/src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.cpp
+++
b/src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.cpp
@@ -4,44 +4,13 @@
*/
#include "TeamSettingsWindow.h"

-#include <Box.h>
#include <Button.h>
-#include <CheckBox.h>
#include <LayoutBuilder.h>
-#include <ListView.h>
-#include <MenuField.h>
-#include <ScrollView.h>
+#include <TabView.h>

-#include <AutoDeleter.h>
-#include <AutoLocker.h>
-
-#include "FunctionInstance.h"
-#include "Image.h"
-#include "ImageDebugInfo.h"
+#include "ExceptionStopConfigView.h"
+#include "ImageStopConfigView.h"
#include "MessageCodes.h"
-#include "UserInterface.h"
-#include "Team.h"
-
-
-enum {
- MSG_STOP_ON_THROWN_EXCEPTION_CHANGED = 'stec',
- MSG_STOP_ON_CAUGHT_EXCEPTION_CHANGED = 'scec',
- MSG_SET_STOP_FOR_ALL_IMAGES = 'sfai',
- MSG_SET_STOP_FOR_CUSTOM_IMAGES = 'sfci',
- MSG_IMAGE_NAME_SELECTION_CHANGED = 'insc',
- MSG_ADD_IMAGE_NAME =
'anin',
- MSG_REMOVE_IMAGE_NAME = 'arin',
- MSG_IMAGE_NAME_INPUT_CHANGED = 'inic'
-};
-
-
-static int SortStringItems(const void* a, const void* b)
-{
- BStringItem* item1 = *(BStringItem**)a;
- BStringItem* item2 = *(BStringItem**)b;
-
- return strcmp(item1->Text(), item2->Text());
-}


TeamSettingsWindow::TeamSettingsWindow(::Team* team,
@@ -51,29 +20,14 @@ TeamSettingsWindow::TeamSettingsWindow(::Team* team,
B_AUTO_UPDATE_SIZE_LIMITS | B_CLOSE_ON_ESCAPE),
fTeam(team),
fListener(listener),
- fExceptionSettingsBox(NULL),
- fImageSettingsBox(NULL),
- fExceptionThrown(NULL),
- fExceptionCaught(NULL),
- fStopOnImageLoad(NULL),
- fStopImageConstraints(NULL),
- fStopImageNames(NULL),
- fStopImageNameInput(NULL),
- fAddImageNameButton(NULL),
- fRemoveImageNameButton(NULL),
- fCustomImageGroup(NULL),
- fStopOnLoadEnabled(false),
- fUseCustomImages(false),
fCloseButton(NULL),
fTarget(target)
{
- fTeam->AddListener(this);
}


TeamSettingsWindow::~TeamSettingsWindow()
{
- fTeam->RemoveListener(this);
BMessenger(fTarget).SendMessage(MSG_TEAM_SETTINGS_WINDOW_CLOSED);
}

@@ -93,141 +47,6 @@ TeamSettingsWindow::Create(::Team* team,
}

return self;
-
-}
-
-void
-TeamSettingsWindow::MessageReceived(BMessage* message)
-{
- switch (message->what) {
- case MSG_STOP_ON_THROWN_EXCEPTION_CHANGED:
- {
- _UpdateThrownBreakpoints(fExceptionThrown->Value()
- == B_CONTROL_ON);
- break;
- }
-
- case MSG_STOP_ON_CAUGHT_EXCEPTION_CHANGED:
- {
- break;
- }
-
- case MSG_SET_STOP_FOR_ALL_IMAGES:
- {
- fListener->SetStopOnImageLoadRequested(
- fStopOnImageLoad->Value() == B_CONTROL_ON,
- false);
- break;
- }

[ *** diff truncated: 433 lines dropped *** ]


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

Commit: b66f61af9ba9d12a605029fe5c60d5b746be2872
URL: http://cgit.haiku-os.org/haiku/commit/?id=b66f61af9ba9
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sun Jun 28 21:34:13 2015 UTC

Debugger: Add config view for signals.

SignalsConfigView:
- Provide basic configuration for signal dispositions.

TeamSettingsWindow:
- Add signals view to tab list.

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

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

Revision: hrev49356
Commit: b3f2ebf008490ab0b37e7d12fb6e2702f45bcd2b
URL: http://cgit.haiku-os.org/haiku/commit/?id=b3f2ebf00849
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Thu Jul 2 21:54:51 2015 UTC

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

Debugger: More work on signal configuration.

- Introduce SignalDispositionEditWindow for add/editing disposition
exceptions.

SignalsConfigView:
- Factor out helper class SignalDispositionMenu. Use accordingly in
SignalsConfigView and SignalDispositionEditWindow.
- Watch table selection changes to update button statuses appropriately.
- On add/edit request, show disposition edit window.
- Listen for disposition changes from team and react accordingly.

UiUtils:
- Add helper function to map signal defines to strings.

Together with the previous set of commits, this implements #9720.

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


Other related posts:

  • » [haiku-commits] haiku: hrev49356 - in src/apps/debugger: user_interface/gui/team_settings_window user_interface/gui/utility_windows model settings controllers - anevilyak