Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: runtime/observatory/lib/src/elements/script_inset.dart

Issue 1312763010: Support column-based breakpoints in the VM and Observatory. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: hausner review Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
« no previous file with comments | « runtime/observatory/lib/src/elements/debugger.dart ('k') | runtime/observatory/lib/src/elements/script_inset.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698