Relocate "Stop on image load" option.

Rather than a menu item, it's now a checkbox located in the breakpoints
tab.
This commit is contained in:
Rene Gollent 2013-07-05 08:41:27 -04:00
parent 0635bcc98f
commit bd503ae4cf
4 changed files with 28 additions and 14 deletions

View File

@ -10,6 +10,7 @@
#include <new>
#include <Button.h>
#include <CheckBox.h>
#include <LayoutBuilder.h>
#include <AutoLocker.h>
@ -31,6 +32,7 @@ BreakpointsView::BreakpointsView(Team* team, Listener* listener)
fConfigureExceptionsButton(NULL),
fToggleBreakpointButton(NULL),
fRemoveBreakpointButton(NULL),
fStopOnImageLoadCheckBox(NULL),
fListener(listener)
{
SetName("Breakpoints");
@ -95,6 +97,12 @@ BreakpointsView::MessageReceived(BMessage* message)
_HandleBreakpointAction(message->what);
break;
case MSG_STOP_ON_IMAGE_LOAD:
{
fListener->SetStopOnImageLoadRequested(
fStopOnImageLoadCheckBox->Value() == B_CONTROL_ON);
break;
}
default:
BGroupView::MessageReceived(message);
break;
@ -108,6 +116,7 @@ BreakpointsView::AttachedToWindow()
fConfigureExceptionsButton->SetTarget(Window());
fToggleBreakpointButton->SetTarget(this);
fRemoveBreakpointButton->SetTarget(this);
fStopOnImageLoadCheckBox->SetTarget(this);
}
@ -153,6 +162,9 @@ BreakpointsView::_Init()
.AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING)
.SetInsets(B_USE_SMALL_SPACING)
.AddGlue()
.Add(fStopOnImageLoadCheckBox = new BCheckBox(
"Stop on image load"))
.AddStrut(5)
.Add(fConfigureExceptionsButton = new BButton(
"Configure exceptions" B_UTF8_ELLIPSIS))
.Add(fRemoveBreakpointButton = new BButton("Remove"))
@ -163,6 +175,9 @@ BreakpointsView::_Init()
MSG_SHOW_EXCEPTION_CONFIG_WINDOW));
fToggleBreakpointButton->SetMessage(new BMessage(MSG_ENABLE_BREAKPOINT));
fRemoveBreakpointButton->SetMessage(new BMessage(MSG_CLEAR_BREAKPOINT));
fStopOnImageLoadCheckBox->SetMessage(new BMessage(MSG_STOP_ON_IMAGE_LOAD));
fStopOnImageLoadCheckBox->SetExplicitAlignment(BAlignment(
B_ALIGN_HORIZONTAL_UNSET, B_ALIGN_VERTICAL_CENTER));
_UpdateButtons();
}

View File

@ -12,6 +12,7 @@
class BButton;
class BCheckBox;
class BreakpointsView : public BGroupView,
@ -57,6 +58,7 @@ private:
BButton* fConfigureExceptionsButton;
BButton* fToggleBreakpointButton;
BButton* fRemoveBreakpointButton;
BCheckBox* fStopOnImageLoadCheckBox;
Listener* fListener;
};
@ -79,6 +81,8 @@ public:
bool enabled) = 0;
virtual void ClearWatchpointRequested(
Watchpoint* watchpoint) = 0;
virtual void SetStopOnImageLoadRequested(bool enabled) = 0;
};

View File

@ -234,16 +234,6 @@ void
TeamWindow::MessageReceived(BMessage* message)
{
switch (message->what) {
case MSG_STOP_ON_IMAGE_LOAD:
{
BMenuItem* item;
if (message->FindPointer("source", (void **)&item) != B_OK)
break;
bool enable = !item->IsMarked();
fListener->SetStopOnImageLoadRequested(enable);
item->SetMarked(enable);
break;
}
case MSG_TEAM_RESTART_REQUESTED:
{
fListener->TeamRestartRequested();
@ -778,6 +768,13 @@ TeamWindow::ClearWatchpointRequested(Watchpoint* watchpoint)
}
void
TeamWindow::SetStopOnImageLoadRequested(bool enabled)
{
fListener->SetStopOnImageLoadRequested(enabled);
}
void
TeamWindow::ValueNodeValueRequested(CpuState* cpuState,
ValueNodeContainer* container, ValueNode* valueNode)
@ -975,10 +972,6 @@ TeamWindow::_Init()
MSG_TEAM_RESTART_REQUESTED), 'R', B_SHIFT_KEY);
menu->AddItem(item);
item->SetTarget(this);
item = new BMenuItem("Stop on image load", new BMessage(
MSG_STOP_ON_IMAGE_LOAD));
item->SetTarget(this);
menu->AddItem(item);
item = new BMenuItem("Close", new BMessage(B_QUIT_REQUESTED),
'W');
menu->AddItem(item);

View File

@ -104,6 +104,8 @@ private:
virtual void ClearWatchpointRequested(
Watchpoint* watchpoint);
virtual void SetStopOnImageLoadRequested(bool enabled);
// SourceView::Listener
virtual void SetBreakpointRequested(target_addr_t address,