Index: runtime/observatory/lib/src/elements/script_inset.dart |
diff --git a/runtime/observatory/lib/src/elements/script_inset.dart b/runtime/observatory/lib/src/elements/script_inset.dart |
index 8a9546740a599840b78565617ff376ce22b50198..2269c12bf9a03851c3f54a5419bc0b6f6a652512 100644 |
--- a/runtime/observatory/lib/src/elements/script_inset.dart |
+++ b/runtime/observatory/lib/src/elements/script_inset.dart |
@@ -121,9 +121,17 @@ class BreakpointAnnotation extends Annotation { |
BreakpointAnnotation(this.bpt) { |
var script = bpt.location.script; |
- var pos = bpt.location.tokenPos; |
- line = script.tokenToLine(pos); |
- columnStart = script.tokenToCol(pos) - 1; // tokenToCol is 1-origin. |
+ if (bpt.location.tokenPos != null) { |
+ var pos = bpt.location.tokenPos; |
+ line = script.tokenToLine(pos); |
+ columnStart = script.tokenToCol(pos) - 1; // tokenToCol is 1-origin. |
+ } else { |
+ line = bpt.location.line; |
+ columnStart = bpt.location.column; |
+ if (columnStart == null) { |
+ columnStart = 0; |
+ } |
+ } |
var length = script.guessTokenLength(line, columnStart); |
if (length == null) { |
length = 1; |
@@ -139,7 +147,11 @@ class BreakpointAnnotation extends Annotation { |
var pos = bpt.location.tokenPos; |
int line = script.tokenToLine(pos); |
int column = script.tokenToCol(pos); |
- element.classes.add("breakAnnotation"); |
+ if (bpt.resolved) { |
+ element.classes.add("resolvedBreakAnnotation"); |
+ } else { |
+ element.classes.add("unresolvedBreakAnnotation"); |
+ } |
element.title = "Breakpoint ${bpt.number} at ${line}:${column}"; |
} |
} |
@@ -448,6 +460,11 @@ class ScriptInsetElement extends ObservatoryElement { |
Element a(String text) => new AnchorElement()..text = text; |
Element span(String text) => new SpanElement()..text = text; |
+ Element hitsCurrent(Element element) { |
+ element.classes.add('hitsCurrent'); |
+ element.title = ""; |
+ return element; |
+ } |
Element hitsUnknown(Element element) { |
element.classes.add('hitsNone'); |
element.title = ""; |
@@ -930,7 +947,9 @@ class ScriptInsetElement extends ObservatoryElement { |
var e = span("$nbsp$lineNumber$nbsp"); |
e.classes.add('noCopy'); |
- if ((line == null) || (line.hits == null)) { |
+ if (lineNumber == _currentLine) { |
+ hitsCurrent(e); |
+ } else if ((line == null) || (line.hits == null)) { |
hitsUnknown(e); |
} else if (line.hits == 0) { |
hitsNotExecuted(e); |