Index: runtime/observatory/lib/src/service/object.dart |
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart |
index cf244e4f427e61f878649d51958cf95c628e7584..8133ce1ff7845421e3dc4e972152f114afdf666b 100644 |
--- a/runtime/observatory/lib/src/service/object.dart |
+++ b/runtime/observatory/lib/src/service/object.dart |
@@ -432,6 +432,16 @@ class SourceLocation extends ServiceObject { |
int tokenPos; |
int endTokenPos; |
+ Future<int> line() async { |
+ await script.load(); |
+ return script.tokenToLine(tokenPos); |
+ } |
+ |
+ Future<int> column() async { |
+ await script.load(); |
+ return script.tokenToCol(tokenPos); |
+ } |
+ |
SourceLocation._empty(ServiceObject owner) : super._empty(owner); |
void _update(ObservableMap map, bool mapIsRef) { |
@@ -1390,13 +1400,16 @@ class Isolate extends ServiceObjectOwner with Coverage { |
} |
} |
- Future<ServiceObject> addBreakpoint(Script script, int line) async { |
+ Future<ServiceObject> addBreakpoint(Script script, int line, [int col]) async { |
// TODO(turnidge): Pass line as an int instead of a string. |
try { |
Map params = { |
'scriptId': script.id, |
- 'line': '$line', |
+ 'line': line.toString(), |
}; |
+ if (col != null) { |
+ params['column'] = col.toString(); |
+ } |
Breakpoint bpt = await invokeRpc('addBreakpoint', params); |
if (bpt.resolved && |
script.loaded && |