ExceptionConfigWindow -> BreakConditionConfigWindow.

Stop on image load removed from BreakpointsView, pending adding it to
BreakConditionConfigWindow with some additional options.
This commit is contained in:
Rene Gollent 2013-07-06 12:53:37 -04:00
parent 9cb70c69b6
commit ef2d649d76
8 changed files with 39 additions and 65 deletions

View File

@ -242,10 +242,10 @@ Application Debugger :
TeamsListView.cpp
# user_interface/gui/team_window
BreakConditionConfigWindow.cpp
BreakpointListView.cpp
BreakpointsView.cpp
ConsoleOutputView.cpp
ExceptionConfigWindow.cpp
ImageFunctionsView.cpp
ImageListView.cpp
RegistersView.cpp

View File

@ -54,8 +54,8 @@ enum {
MSG_TEAM_RESTART_REQUESTED = 'trrq',
MSG_SHOW_TEAMS_WINDOW = 'stsw',
MSG_TEAMS_WINDOW_CLOSED = 'tswc',
MSG_SHOW_EXCEPTION_CONFIG_WINDOW = 'secw',
MSG_EXCEPTION_CONFIG_WINDOW_CLOSED = 'ecwc',
MSG_SHOW_BREAK_CONDITION_CONFIG_WINDOW = 'sbcc',
MSG_BREAK_CONDITION_CONFIG_WINDOW_CLOSED = 'bccw',
MSG_START_NEW_TEAM = 'sttt',
MSG_DEBUG_THIS_TEAM = 'dbtt',
MSG_SHOW_INSPECTOR_WINDOW = 'sirw',

View File

@ -2,7 +2,7 @@
* Copyright 2013, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#include "ExceptionConfigWindow.h"
#include "BreakConditionConfigWindow.h"
#include <Button.h>
#include <CheckBox.h>
@ -24,10 +24,10 @@ enum {
};
ExceptionConfigWindow::ExceptionConfigWindow(::Team* team,
BreakConditionConfigWindow::BreakConditionConfigWindow(::Team* team,
UserInterfaceListener* listener, BHandler* target)
:
BWindow(BRect(), "Configure Exceptions", B_FLOATING_WINDOW,
BWindow(BRect(), "Configure break conditions", B_FLOATING_WINDOW,
B_AUTO_UPDATE_SIZE_LIMITS | B_CLOSE_ON_ESCAPE),
fTeam(team),
fListener(listener),
@ -39,18 +39,18 @@ ExceptionConfigWindow::ExceptionConfigWindow(::Team* team,
}
ExceptionConfigWindow::~ExceptionConfigWindow()
BreakConditionConfigWindow::~BreakConditionConfigWindow()
{
BMessenger(fTarget).SendMessage(MSG_EXCEPTION_CONFIG_WINDOW_CLOSED);
BMessenger(fTarget).SendMessage(MSG_BREAK_CONDITION_CONFIG_WINDOW_CLOSED);
}
ExceptionConfigWindow*
ExceptionConfigWindow::Create(::Team* team,
BreakConditionConfigWindow*
BreakConditionConfigWindow::Create(::Team* team,
UserInterfaceListener* listener, BHandler* target)
{
ExceptionConfigWindow* self = new ExceptionConfigWindow(team, listener,
target);
BreakConditionConfigWindow* self = new BreakConditionConfigWindow(
team, listener, target);
try {
self->_Init();
@ -64,7 +64,7 @@ ExceptionConfigWindow::Create(::Team* team,
}
void
ExceptionConfigWindow::MessageReceived(BMessage* message)
BreakConditionConfigWindow::MessageReceived(BMessage* message)
{
switch (message->what) {
case MSG_STOP_ON_THROWN_EXCEPTION_CHANGED:
@ -87,7 +87,7 @@ ExceptionConfigWindow::MessageReceived(BMessage* message)
void
ExceptionConfigWindow::Show()
BreakConditionConfigWindow::Show()
{
CenterOnScreen();
BWindow::Show();
@ -95,7 +95,7 @@ ExceptionConfigWindow::Show()
void
ExceptionConfigWindow::_Init()
BreakConditionConfigWindow::_Init()
{
BLayoutBuilder::Group<>(this, B_VERTICAL)
.SetInsets(B_USE_DEFAULT_SPACING)
@ -140,7 +140,7 @@ ExceptionConfigWindow::_Init()
void
ExceptionConfigWindow::_UpdateThrownBreakpoints(bool enable)
BreakConditionConfigWindow::_UpdateThrownBreakpoints(bool enable)
{
AutoLocker< ::Team> teamLocker(fTeam);
for (ImageList::ConstIterator it = fTeam->Images().GetIterator();
@ -161,7 +161,7 @@ ExceptionConfigWindow::_UpdateThrownBreakpoints(bool enable)
status_t
ExceptionConfigWindow::_FindExceptionFunction(ImageDebugInfo* info,
BreakConditionConfigWindow::_FindExceptionFunction(ImageDebugInfo* info,
target_addr_t& _foundAddress) const
{
if (info != NULL) {

View File

@ -2,8 +2,8 @@
* Copyright 2013, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#ifndef EXCEPTION_CONFIG_WINDOW_H
#define EXCEPTION_CONFIG_WINDOW_H
#ifndef BREAK_CONDITION_CONFIG_WINDOW_H
#define BREAK_CONDITION_CONFIG_WINDOW_H
#include <Window.h>
@ -18,15 +18,15 @@ class Team;
class UserInterfaceListener;
class ExceptionConfigWindow : public BWindow {
class BreakConditionConfigWindow : public BWindow {
public:
ExceptionConfigWindow(::Team* team,
BreakConditionConfigWindow(::Team* team,
UserInterfaceListener* listener,
BHandler* target);
~ExceptionConfigWindow();
~BreakConditionConfigWindow();
static ExceptionConfigWindow* Create(::Team* team,
static BreakConditionConfigWindow* Create(::Team* team,
UserInterfaceListener* listener,
BHandler* target);
// throws
@ -52,4 +52,4 @@ private:
};
#endif // EXCEPTION_CONFIG_WINDOW_H
#endif // BREAK_CONDITION_CONFIG_WINDOW_H

View File

@ -32,7 +32,6 @@ BreakpointsView::BreakpointsView(Team* team, Listener* listener)
fConfigureExceptionsButton(NULL),
fToggleBreakpointButton(NULL),
fRemoveBreakpointButton(NULL),
fStopOnImageLoadCheckBox(NULL),
fListener(listener)
{
SetName("Breakpoints");
@ -97,13 +96,6 @@ 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;
}
@ -116,7 +108,6 @@ BreakpointsView::AttachedToWindow()
fConfigureExceptionsButton->SetTarget(Window());
fToggleBreakpointButton->SetTarget(this);
fRemoveBreakpointButton->SetTarget(this);
fStopOnImageLoadCheckBox->SetTarget(this);
}
@ -162,22 +153,16 @@ 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))
"Configure break conditions" B_UTF8_ELLIPSIS))
.Add(fRemoveBreakpointButton = new BButton("Remove"))
.Add(fToggleBreakpointButton = new BButton("Toggle"))
.End();
fConfigureExceptionsButton->SetMessage(
new BMessage(MSG_SHOW_EXCEPTION_CONFIG_WINDOW));
new BMessage(MSG_SHOW_BREAK_CONDITION_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

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

View File

@ -33,7 +33,7 @@
#include "ConsoleOutputView.h"
#include "CpuState.h"
#include "DisassembledCode.h"
#include "ExceptionConfigWindow.h"
#include "BreakConditionConfigWindow.h"
#include "FileSourceCode.h"
#include "GuiSettingsUtils.h"
#include "GuiTeamUiSettings.h"
@ -128,7 +128,7 @@ TeamWindow::TeamWindow(::Team* team, UserInterfaceListener* listener)
fImageSplitView(NULL),
fThreadSplitView(NULL),
fConsoleSplitView(NULL),
fExceptionConfigWindow(NULL),
fBreakConditionConfigWindow(NULL),
fInspectorWindow(NULL),
fFilePanel(NULL)
{
@ -318,25 +318,26 @@ TeamWindow::MessageReceived(BMessage* message)
break;
}
case MSG_SHOW_EXCEPTION_CONFIG_WINDOW:
case MSG_SHOW_BREAK_CONDITION_CONFIG_WINDOW:
{
if (fExceptionConfigWindow) {
fExceptionConfigWindow->Activate(true);
if (fBreakConditionConfigWindow) {
fBreakConditionConfigWindow->Activate(true);
} else {
try {
fExceptionConfigWindow = ExceptionConfigWindow::Create(
fBreakConditionConfigWindow
= BreakConditionConfigWindow::Create(
fTeam, fListener, this);
if (fExceptionConfigWindow != NULL)
fExceptionConfigWindow->Show();
if (fBreakConditionConfigWindow != NULL)
fBreakConditionConfigWindow->Show();
} catch (...) {
// TODO: notify user
}
}
break;
}
case MSG_EXCEPTION_CONFIG_WINDOW_CLOSED:
case MSG_BREAK_CONDITION_CONFIG_WINDOW_CLOSED:
{
fExceptionConfigWindow = NULL;
fBreakConditionConfigWindow = NULL;
break;
}
case MSG_SHOW_WATCH_VARIABLE_PROMPT:
@ -768,13 +769,6 @@ TeamWindow::ClearWatchpointRequested(Watchpoint* watchpoint)
}
void
TeamWindow::SetStopOnImageLoadRequested(bool enabled)
{
fListener->SetStopOnImageLoadRequested(enabled);
}
void
TeamWindow::ValueNodeValueRequested(CpuState* cpuState,
ValueNodeContainer* container, ValueNode* valueNode)

View File

@ -31,7 +31,7 @@ class BSplitView;
class BStringView;
class BTabView;
class ConsoleOutputView;
class ExceptionConfigWindow;
class BreakConditionConfigWindow;
class Image;
class InspectorWindow;
class RegistersView;
@ -104,8 +104,6 @@ private:
virtual void ClearWatchpointRequested(
Watchpoint* watchpoint);
virtual void SetStopOnImageLoadRequested(bool enabled);
// SourceView::Listener
virtual void SetBreakpointRequested(target_addr_t address,
@ -208,7 +206,7 @@ private:
BSplitView* fImageSplitView;
BSplitView* fThreadSplitView;
BSplitView* fConsoleSplitView;
ExceptionConfigWindow* fExceptionConfigWindow;
BreakConditionConfigWindow* fBreakConditionConfigWindow;
InspectorWindow* fInspectorWindow;
GuiTeamUiSettings fUiSettings;
BFilePanel* fFilePanel;