Debugger: Add expression prompt window handling.

TeamWindow now handles the messages for summoning/dismissing
the expression prompt window.
This commit is contained in:
Rene Gollent 2014-11-05 23:53:15 -05:00
parent 8336fb8168
commit 11832b28af
2 changed files with 50 additions and 1 deletions

View File

@ -42,6 +42,7 @@
#include "DisassembledCode.h" #include "DisassembledCode.h"
#include "BreakpointEditWindow.h" #include "BreakpointEditWindow.h"
#include "ExpressionEvaluationWindow.h" #include "ExpressionEvaluationWindow.h"
#include "ExpressionPromptWindow.h"
#include "FileSourceCode.h" #include "FileSourceCode.h"
#include "GuiSettingsUtils.h" #include "GuiSettingsUtils.h"
#include "GuiTeamUiSettings.h" #include "GuiTeamUiSettings.h"
@ -141,6 +142,7 @@ TeamWindow::TeamWindow(::Team* team, UserInterfaceListener* listener)
fBreakpointEditWindow(NULL), fBreakpointEditWindow(NULL),
fInspectorWindow(NULL), fInspectorWindow(NULL),
fExpressionWindow(NULL), fExpressionWindow(NULL),
fExpressionPromptWindow(NULL),
fFilePanel(NULL), fFilePanel(NULL),
fActiveSourceWorker(-1) fActiveSourceWorker(-1)
{ {
@ -374,6 +376,49 @@ TeamWindow::MessageReceived(BMessage* message)
fExpressionWindow = NULL; fExpressionWindow = NULL;
break; break;
} }
case MSG_SHOW_EXPRESSION_PROMPT_WINDOW:
{
BHandler* addTarget;
if (message->FindPointer("target",
reinterpret_cast<void**>(&addTarget)) != B_OK) {
break;
}
if (fExpressionPromptWindow != NULL) {
AutoLocker<BWindow> lock(fExpressionPromptWindow);
if (lock.IsLocked())
fExpressionPromptWindow->Activate(true);
} else {
try {
fExpressionPromptWindow = ExpressionPromptWindow::Create(
addTarget, this);
if (fExpressionPromptWindow != NULL)
fExpressionPromptWindow->Show();
} catch (...) {
// TODO: notify user
}
}
break;
}
case MSG_EXPRESSION_PROMPT_WINDOW_CLOSED:
{
fExpressionPromptWindow = NULL;
const char* expression;
int32 type;
BMessenger targetMessenger;
if (message->FindString("expression", &expression) == B_OK
&& message->FindInt32("type", &type) == B_OK
&& message->FindMessenger("target", &targetMessenger)
== B_OK) {
BMessage addMessage(MSG_ADD_NEW_EXPRESSION);
addMessage.AddString("expression", expression);
addMessage.AddInt32("type", type);
targetMessenger.SendMessage(&addMessage);
}
break;
}
case MSG_SHOW_BREAK_CONDITION_CONFIG_WINDOW: case MSG_SHOW_BREAK_CONDITION_CONFIG_WINDOW:
{ {
if (fBreakConditionConfigWindow != NULL) { if (fBreakConditionConfigWindow != NULL) {

View File

@ -35,12 +35,14 @@ class ConsoleOutputView;
class BreakConditionConfigWindow; class BreakConditionConfigWindow;
class BreakpointEditWindow; class BreakpointEditWindow;
class ExpressionEvaluationWindow; class ExpressionEvaluationWindow;
class ExpressionPromptWindow;
class Image; class Image;
class InspectorWindow; class InspectorWindow;
class RegistersView; class RegistersView;
class SourceCode; class SourceCode;
class SourceLanguage; class SourceLanguage;
class StackFrame; class StackFrame;
class Type;
class UserBreakpoint; class UserBreakpoint;
class UserInterfaceListener; class UserInterfaceListener;
class VariablesView; class VariablesView;
@ -185,7 +187,8 @@ private:
const BMessage* settings); const BMessage* settings);
status_t _GetActiveSourceLanguage( status_t _GetActiveSourceLanguage(
SourceLanguage*& language); SourceLanguage*& _language);
private: private:
::Team* fTeam; ::Team* fTeam;
::Thread* fActiveThread; ::Thread* fActiveThread;
@ -224,6 +227,7 @@ private:
BreakpointEditWindow* fBreakpointEditWindow; BreakpointEditWindow* fBreakpointEditWindow;
InspectorWindow* fInspectorWindow; InspectorWindow* fInspectorWindow;
ExpressionEvaluationWindow* fExpressionWindow; ExpressionEvaluationWindow* fExpressionWindow;
ExpressionPromptWindow* fExpressionPromptWindow;
GuiTeamUiSettings fUiSettings; GuiTeamUiSettings fUiSettings;
BFilePanel* fFilePanel; BFilePanel* fFilePanel;
thread_id fActiveSourceWorker; thread_id fActiveSourceWorker;