diff --git a/src/apps/debugger/user_interface/gui/team_window/SourceView.cpp b/src/apps/debugger/user_interface/gui/team_window/SourceView.cpp
index 3e3a4f9..958edb3 100644
a
|
b
|
SourceView::TextView::TextView(SourceView* sourceView, MarkerManager* manager,
|
1045 | 1045 | fScrollRunner(NULL), |
1046 | 1046 | fMarkerManager(manager) |
1047 | 1047 | { |
1048 | | SetViewColor(ui_color(B_DOCUMENT_BACKGROUND_COLOR)); |
| 1048 | SetViewColor(B_TRANSPARENT_COLOR); |
1049 | 1049 | fTextColor = ui_color(B_DOCUMENT_TEXT_COLOR); |
1050 | 1050 | SetFlags(Flags() | B_NAVIGABLE); |
1051 | 1051 | } |
… |
… |
SourceView::TextView::MaxSize()
|
1085 | 1085 | void |
1086 | 1086 | SourceView::TextView::Draw(BRect updateRect) |
1087 | 1087 | { |
1088 | | if (fSourceCode == NULL) |
| 1088 | if (fSourceCode == NULL) { |
| 1089 | SetLowColor(ui_color(B_DOCUMENT_BACKGROUND_COLOR)); |
| 1090 | FillRect(updateRect, B_SOLID_LOW); |
1089 | 1091 | return; |
| 1092 | } |
1090 | 1093 | |
1091 | 1094 | // get the lines intersecting with the update rect |
1092 | 1095 | int32 minLine, maxLine; |
… |
… |
SourceView::TextView::Draw(BRect updateRect)
|
1101 | 1104 | SourceView::MarkerManager::InstructionPointerMarker* ipMarker; |
1102 | 1105 | int32 markerIndex = 0; |
1103 | 1106 | for (int32 i = minLine; i <= maxLine; i++) { |
1104 | | SetLowColor(ViewColor()); |
| 1107 | SetLowColor(ui_color(B_DOCUMENT_BACKGROUND_COLOR)); |
1105 | 1108 | float y = i * fFontInfo->lineHeight; |
1106 | 1109 | BString lineString; |
1107 | 1110 | _FormatLine(fSourceCode->LineAt(i), lineString); |
1108 | 1111 | |
| 1112 | FillRect(BRect(0.0, y, kLeftTextMargin, y + fFontInfo->lineHeight), |
| 1113 | B_SOLID_LOW); |
1109 | 1114 | for (int32 j = markerIndex; j < markers.CountItems(); j++) { |
1110 | 1115 | marker = markers.ItemAt(j); |
1111 | 1116 | if (marker->Line() < (uint32)i) { |
… |
… |
SourceView::TextView::Draw(BRect updateRect)
|
1123 | 1128 | |
1124 | 1129 | } else |
1125 | 1130 | SetLowColor(255, 255, 0, 255); |
1126 | | FillRect(BRect(kLeftTextMargin, y, Bounds().right, |
1127 | | y + fFontInfo->lineHeight), B_SOLID_LOW); |
1128 | 1131 | break; |
1129 | 1132 | } else |
1130 | 1133 | break; |
1131 | 1134 | } |
1132 | 1135 | |
| 1136 | FillRect(BRect(kLeftTextMargin, y, Bounds().right, |
| 1137 | y + fFontInfo->lineHeight), B_SOLID_LOW); |
1133 | 1138 | DrawString(lineString, |
1134 | 1139 | BPoint(kLeftTextMargin, y + fFontInfo->fontHeight.ascent)); |
1135 | 1140 | } |
… |
… |
SourceView::SetStackTrace(StackTrace* stackTrace, Thread* activeThread)
|
2053 | 2058 | |
2054 | 2059 | fMarkerManager->SetStackTrace(fStackTrace); |
2055 | 2060 | fMarkerView->SetStackTrace(fStackTrace); |
2056 | | fTextView->Invalidate(); |
2057 | 2061 | } |
2058 | 2062 | |
2059 | 2063 | |
2060 | 2064 | void |
2061 | 2065 | SourceView::SetStackFrame(StackFrame* stackFrame) |
2062 | 2066 | { |
| 2067 | TRACE_GUI("SourceView::SetStackFrame(%p)\n", stackFrame); |
2063 | 2068 | if (stackFrame == fStackFrame) |
2064 | 2069 | return; |
2065 | 2070 | |
diff --git a/src/apps/debugger/user_interface/gui/team_window/StackTraceView.cpp b/src/apps/debugger/user_interface/gui/team_window/StackTraceView.cpp
index c36ac9b..5850f87 100644
a
|
b
|
|
1 | 1 | /* |
2 | 2 | * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@gmx.de. |
3 | | * Copyright 2011, Rene Gollent, rene@gollent.com. |
| 3 | * Copyright 2011-2013, Rene Gollent, rene@gollent.com. |
4 | 4 | * Distributed under the terms of the MIT License. |
5 | 5 | */ |
6 | 6 | |
… |
… |
|
12 | 12 | #include <new> |
13 | 13 | |
14 | 14 | #include <ControlLook.h> |
| 15 | #include <MessageRunner.h> |
| 16 | #include <Window.h> |
15 | 17 | |
16 | 18 | #include "table/TableColumns.h" |
17 | 19 | |
… |
… |
|
23 | 25 | #include "UiUtils.h" |
24 | 26 | |
25 | 27 | |
| 28 | enum { |
| 29 | MSG_CLEAR_STACK_TRACE = 'clst' |
| 30 | }; |
| 31 | |
| 32 | |
26 | 33 | // #pragma mark - FramesTableModel |
27 | 34 | |
28 | 35 | |
… |
… |
StackTraceView::StackTraceView(Listener* listener)
|
107 | 114 | fStackTrace(NULL), |
108 | 115 | fFramesTable(NULL), |
109 | 116 | fFramesTableModel(NULL), |
| 117 | fTraceUpdateRunner(NULL), |
110 | 118 | fListener(listener) |
111 | 119 | { |
112 | 120 | SetName("Stack Trace"); |
… |
… |
StackTraceView::SetStackTrace(StackTrace* stackTrace)
|
149 | 157 | { |
150 | 158 | if (stackTrace == fStackTrace) |
151 | 159 | return; |
152 | | |
153 | | if (fStackTrace != NULL) |
154 | | fStackTrace->ReleaseReference(); |
155 | | |
156 | | fStackTrace = stackTrace; |
157 | | |
158 | | if (fStackTrace != NULL) |
159 | | fStackTrace->AcquireReference(); |
160 | | |
161 | | fFramesTableModel->SetStackTrace(fStackTrace); |
| 160 | else if (stackTrace == NULL) { |
| 161 | if (fTraceUpdateRunner == NULL) { |
| 162 | BMessage message(MSG_CLEAR_STACK_TRACE); |
| 163 | message.AddPointer("currentTrace", fStackTrace); |
| 164 | fTraceUpdateRunner = new(std::nothrow) BMessageRunner(this, |
| 165 | message, 250000, 1); |
| 166 | if (fTraceUpdateRunner != NULL |
| 167 | && fTraceUpdateRunner->InitCheck() != B_OK) { |
| 168 | delete fTraceUpdateRunner; |
| 169 | fTraceUpdateRunner = NULL; |
| 170 | } |
| 171 | } |
| 172 | } else { |
| 173 | delete fTraceUpdateRunner; |
| 174 | fTraceUpdateRunner = NULL; |
| 175 | _SetStackTrace(stackTrace); |
| 176 | } |
162 | 177 | } |
163 | 178 | |
164 | 179 | |
… |
… |
StackTraceView::SaveSettings(BMessage& settings)
|
205 | 220 | |
206 | 221 | |
207 | 222 | void |
| 223 | StackTraceView::MessageReceived(BMessage* message) |
| 224 | { |
| 225 | switch (message->what) { |
| 226 | case MSG_CLEAR_STACK_TRACE: |
| 227 | { |
| 228 | StackTrace* currentStackTrace; |
| 229 | if (message->FindPointer("currentTrace", |
| 230 | reinterpret_cast<void**>(¤tStackTrace)) |
| 231 | == B_OK && currentStackTrace == fStackTrace) { |
| 232 | _SetStackTrace(NULL); |
| 233 | } |
| 234 | break; |
| 235 | } |
| 236 | default: |
| 237 | { |
| 238 | BGroupView::MessageReceived(message); |
| 239 | break; |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | |
| 245 | void |
208 | 246 | StackTraceView::TableSelectionChanged(Table* table) |
209 | 247 | { |
210 | 248 | if (fListener == NULL) |
… |
… |
StackTraceView::_Init()
|
243 | 281 | } |
244 | 282 | |
245 | 283 | |
| 284 | void |
| 285 | StackTraceView::_SetStackTrace(StackTrace* stackTrace) |
| 286 | { |
| 287 | if (fStackTrace != NULL) |
| 288 | fStackTrace->ReleaseReference(); |
| 289 | |
| 290 | fStackTrace = stackTrace; |
| 291 | |
| 292 | if (fStackTrace != NULL) |
| 293 | fStackTrace->AcquireReference(); |
| 294 | |
| 295 | fFramesTableModel->SetStackTrace(fStackTrace); |
| 296 | } |
| 297 | |
| 298 | |
246 | 299 | // #pragma mark - Listener |
247 | 300 | |
248 | 301 | |
diff --git a/src/apps/debugger/user_interface/gui/team_window/StackTraceView.h b/src/apps/debugger/user_interface/gui/team_window/StackTraceView.h
index 5ce2fbe..87e8a28 100644
a
|
b
|
|
11 | 11 | #include "Team.h" |
12 | 12 | |
13 | 13 | |
| 14 | class BMessageRunner; |
14 | 15 | class StackFrame; |
15 | 16 | |
16 | 17 | |
… |
… |
public:
|
33 | 34 | void LoadSettings(const BMessage& settings); |
34 | 35 | status_t SaveSettings(BMessage& settings); |
35 | 36 | |
| 37 | virtual void MessageReceived(BMessage* message); |
| 38 | |
36 | 39 | private: |
37 | 40 | class FramesTableModel; |
38 | 41 | |
… |
… |
private:
|
42 | 45 | |
43 | 46 | void _Init(); |
44 | 47 | |
| 48 | void _SetStackTrace(StackTrace* stackTrace); |
| 49 | |
45 | 50 | private: |
46 | 51 | StackTrace* fStackTrace; |
47 | 52 | Table* fFramesTable; |
48 | 53 | FramesTableModel* fFramesTableModel; |
| 54 | BMessageRunner* fTraceUpdateRunner; |
49 | 55 | Listener* fListener; |
50 | 56 | }; |
51 | 57 | |