-
-
Notifications
You must be signed in to change notification settings - Fork 336
/
TeamWindow.h
252 lines (216 loc) · 7.47 KB
/
TeamWindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2010-2015, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#ifndef TEAM_WINDOW_H
#define TEAM_WINDOW_H
#include <String.h>
#include <Window.h>
#include "BreakpointsView.h"
#include "Function.h"
#include "GuiTeamUiSettings.h"
#include "ImageFunctionsView.h"
#include "ImageListView.h"
#include "SourceView.h"
#include "StackFrame.h"
#include "StackTraceView.h"
#include "Team.h"
#include "ThreadListView.h"
#include "VariablesView.h"
class BButton;
class BFilePanel;
class BMenuBar;
class BMessageRunner;
class BSplitView;
class BStringList;
class BStringView;
class BTabView;
class ConsoleOutputView;
class BreakpointEditWindow;
class ExpressionEvaluationWindow;
class ExpressionPromptWindow;
class Image;
class InspectorWindow;
class RegistersView;
class SourceCode;
class SourceLanguage;
class StackFrame;
class TeamSettingsWindow;
class Type;
class UserBreakpoint;
class UserInterfaceListener;
class VariablesView;
class TeamWindow : public BWindow, ThreadListView::Listener,
ImageListView::Listener, StackTraceView::Listener,
ImageFunctionsView::Listener, BreakpointsView::Listener,
SourceView::Listener, VariablesView::Listener, Team::Listener,
Function::Listener, StackFrame::Listener {
public:
TeamWindow(::Team* team,
UserInterfaceListener* listener);
~TeamWindow();
static TeamWindow* Create(::Team* team,
UserInterfaceListener* listener);
// throws
virtual void DispatchMessage(BMessage* message,
BHandler* handler);
virtual void MessageReceived(BMessage* message);
virtual bool QuitRequested();
status_t LoadSettings(
const GuiTeamUiSettings* settings);
status_t SaveSettings(
GuiTeamUiSettings* settings);
void DisplayBackgroundStatus(const char* message);
private:
enum ActiveSourceObject {
ACTIVE_SOURCE_NONE,
ACTIVE_SOURCE_STACK_FRAME,
ACTIVE_SOURCE_FUNCTION,
ACTIVE_SOURCE_BREAKPOINT
};
private:
// ThreadListView::Listener
virtual void ThreadSelectionChanged(::Thread* thread);
// ImageListView::Listener
virtual void ImageSelectionChanged(Image* image);
// StackTraceView::Listener
virtual void StackFrameSelectionChanged(StackFrame* frame);
// ImageFunctionsView::Listener
virtual void FunctionSelectionChanged(
FunctionInstance* function);
// BreakpointsView::Listener
virtual void BreakpointSelectionChanged(
BreakpointProxyList& proxies);
virtual void SetBreakpointEnabledRequested(
UserBreakpoint* breakpoint,
bool enabled);
virtual void ClearBreakpointRequested(
UserBreakpoint* breakpoint);
virtual void SetWatchpointEnabledRequested(
Watchpoint* breakpoint,
bool enabled);
virtual void ClearWatchpointRequested(
Watchpoint* watchpoint);
// SourceView::Listener
virtual void SetBreakpointRequested(target_addr_t address,
bool enabled);
virtual void ClearBreakpointRequested(
target_addr_t address);
virtual void ThreadActionRequested(::Thread* thread,
uint32 action, target_addr_t address);
virtual void FunctionSourceCodeRequested(
FunctionInstance* function,
bool forceDisassembly);
// VariablesView::Listener
virtual void ValueNodeValueRequested(CpuState* cpuState,
ValueNodeContainer* container,
ValueNode* valueNode);
virtual void ExpressionEvaluationRequested(
ExpressionInfo* info,
StackFrame* frame,
::Thread* thread);
virtual void ValueNodeWriteRequested(ValueNode* node,
CpuState* state, Value* value);
// Team::Listener
virtual void TeamRenamed(const Team::Event& event);
virtual void ThreadStateChanged(
const Team::ThreadEvent& event);
virtual void ThreadCpuStateChanged(
const Team::ThreadEvent& event);
virtual void ThreadStackTraceChanged(
const Team::ThreadEvent& event);
virtual void ImageDebugInfoChanged(
const Team::ImageEvent& event);
virtual void ConsoleOutputReceived(
const Team::ConsoleOutputEvent& event);
virtual void UserBreakpointChanged(
const Team::UserBreakpointEvent& event);
virtual void WatchpointChanged(
const Team::WatchpointEvent& event);
virtual void DebugReportChanged(
const Team::DebugReportEvent& event);
// Function::Listener
virtual void FunctionSourceCodeChanged(Function* function);
void _Init();
void _LoadSettings(
const GuiTeamUiSettings* settings);
void _UpdateTitle();
void _SetActiveThread(::Thread* thread);
void _SetActiveImage(Image* image);
void _SetActiveStackTrace(StackTrace* stackTrace);
void _SetActiveStackFrame(StackFrame* frame);
void _SetActiveBreakpoint(
UserBreakpoint* breakpoint);
void _SetActiveFunction(FunctionInstance* function);
void _SetActiveSourceCode(SourceCode* sourceCode);
void _UpdateCpuState();
void _UpdateRunButtons();
void _UpdateSourcePathState();
void _ScrollToActiveFunction();
void _HandleThreadStateChanged(thread_id threadID);
void _HandleCpuStateChanged(thread_id threadID);
void _HandleStackTraceChanged(thread_id threadID);
void _HandleImageDebugInfoChanged(image_id imageID);
void _HandleSourceCodeChanged();
void _HandleUserBreakpointChanged(
UserBreakpoint* breakpoint);
void _HandleWatchpointChanged(
Watchpoint* watchpoint);
static status_t _RetrieveMatchingSourceWorker(void* arg);
void _HandleResolveMissingSourceFile(entry_ref&
locatedPath);
void _HandleLocateSourceRequest(
BStringList* entries = NULL);
static status_t _RetrieveMatchingSourceEntries(
const BString& path,
BStringList* _entries);
status_t _SaveInspectorSettings(
const BMessage* settings);
status_t _GetActiveSourceLanguage(
SourceLanguage*& _language);
private:
::Team* fTeam;
::Thread* fActiveThread;
Image* fActiveImage;
StackTrace* fActiveStackTrace;
StackFrame* fActiveStackFrame;
UserBreakpoint* fActiveBreakpoint;
FunctionInstance* fActiveFunction;
SourceCode* fActiveSourceCode;
ActiveSourceObject fActiveSourceObject;
UserInterfaceListener* fListener;
BMessageRunner* fTraceUpdateRunner;
BTabView* fTabView;
BTabView* fLocalsTabView;
ThreadListView* fThreadListView;
ImageListView* fImageListView;
ImageFunctionsView* fImageFunctionsView;
BreakpointsView* fBreakpointsView;
VariablesView* fVariablesView;
RegistersView* fRegistersView;
StackTraceView* fStackTraceView;
SourceView* fSourceView;
BButton* fRunButton;
BButton* fStepOverButton;
BButton* fStepIntoButton;
BButton* fStepOutButton;
BMenuBar* fMenuBar;
BStringView* fSourcePathView;
BStringView* fStatusBarView;
ConsoleOutputView* fConsoleOutputView;
BSplitView* fFunctionSplitView;
BSplitView* fSourceSplitView;
BSplitView* fImageSplitView;
BSplitView* fThreadSplitView;
BSplitView* fConsoleSplitView;
TeamSettingsWindow* fTeamSettingsWindow;
BreakpointEditWindow* fBreakpointEditWindow;
InspectorWindow* fInspectorWindow;
ExpressionEvaluationWindow* fExpressionEvalWindow;
ExpressionPromptWindow* fExpressionPromptWindow;
GuiTeamUiSettings fUiSettings;
BFilePanel* fFilePanel;
thread_id fActiveSourceWorker;
};
#endif // TEAM_WINDOW_H