* Fixed spurious IP and breakpoint markers in disassembled code.

* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31686 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-07-22 01:59:52 +00:00
parent 25598171b1
commit 0e8b72b130
@@ -4,6 +4,7 @@
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#include "SourceView.h" #include "SourceView.h"
#include <algorithm> #include <algorithm>
@@ -263,7 +264,7 @@ private:
void _ScrollByPages(int32 pageCount); void _ScrollByPages(int32 pageCount);
void _ScrollToTop(); void _ScrollToTop();
void _ScrollToBottom(); void _ScrollToBottom();
private: private:
float fMaxLineWidth; float fMaxLineWidth;
@@ -681,12 +682,16 @@ SourceView::MarkerView::_UpdateIPMarkers()
} }
Reference<Statement> statementReference(statement, true); Reference<Statement> statementReference(statement, true);
uint32 line = statement->StartSourceLocation().Line(); int32 line = statement->StartSourceLocation().Line();
if ((functionInstance->GetSourceCode() != fSourceCode if (line < 0 || line >= LineCount())
&& functionInstance->GetFunction()->SourceFile()
!= sourceFile)
|| line < 0 || line >= (uint32)LineCount()) {
continue; continue;
if (sourceFile != NULL) {
if (functionInstance->GetFunction()->SourceFile() != sourceFile)
continue;
} else {
if (functionInstance->GetSourceCode() != fSourceCode)
continue;
} }
bool isTopFrame = i == 0 bool isTopFrame = i == 0
@@ -740,12 +745,16 @@ SourceView::MarkerView::_UpdateBreakpointMarkers()
} }
Reference<Statement> statementReference(statement, true); Reference<Statement> statementReference(statement, true);
uint32 line = statement->StartSourceLocation().Line(); int32 line = statement->StartSourceLocation().Line();
if ((functionInstance->GetSourceCode() != fSourceCode if (line < 0 || line >= LineCount())
&& functionInstance->GetFunction()->SourceFile()
!= sourceFile)
|| line < 0 || line >= (uint32)LineCount()) {
continue; continue;
if (sourceFile != NULL) {
if (functionInstance->GetFunction()->SourceFile() != sourceFile)
continue;
} else {
if (functionInstance->GetSourceCode() != fSourceCode)
continue;
} }
BreakpointMarker* marker = new(std::nothrow) BreakpointMarker( BreakpointMarker* marker = new(std::nothrow) BreakpointMarker(
@@ -1062,7 +1071,7 @@ SourceView::TextView::MouseMoved(BPoint where, uint32 transit,
SelectionPoint point = _SelectionPointAt(where); SelectionPoint point = _SelectionPointAt(where);
if (point.line < 0) if (point.line < 0)
return; return;
switch (transit) { switch (transit) {
case B_INSIDE_VIEW: case B_INSIDE_VIEW:
case B_OUTSIDE_VIEW: case B_OUTSIDE_VIEW:
@@ -1080,12 +1089,12 @@ SourceView::TextView::MouseMoved(BPoint where, uint32 transit,
fSelectionStart = point; fSelectionStart = point;
} }
break; break;
case B_EXITED_VIEW: case B_EXITED_VIEW:
fScrollRunner = new BMessageRunner(BMessenger(this), fScrollRunner = new BMessageRunner(BMessenger(this),
new BMessage(MSG_TEXTVIEW_AUTOSCROLL), kScrollTimer); new BMessage(MSG_TEXTVIEW_AUTOSCROLL), kScrollTimer);
break; break;
case B_ENTERED_VIEW: case B_ENTERED_VIEW:
delete fScrollRunner; delete fScrollRunner;
fScrollRunner = NULL; fScrollRunner = NULL;
@@ -1128,7 +1137,7 @@ SourceView::TextView::MouseUp(BPoint where)
{ {
fSelectionMode = false; fSelectionMode = false;
if (fTrackState == kTracking && fClickCount < 2) { if (fTrackState == kTracking && fClickCount < 2) {
// if we clicked without dragging or double/triple clicking, // if we clicked without dragging or double/triple clicking,
// clear the current selection (if any) // clear the current selection (if any)
SelectionPoint point = _SelectionPointAt(where); SelectionPoint point = _SelectionPointAt(where);
@@ -1361,7 +1370,7 @@ SourceView::TextView::_ScrollByPages(int32 pageCount)
return; return;
float value = vertical->Value(); float value = vertical->Value();
vertical->SetValue(value + vertical->SetValue(value +
(fSourceView->Frame().Size().height * pageCount)); (fSourceView->Frame().Size().height * pageCount));
} }