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

Unified Diff: runtime/observatory/lib/src/service/object.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: 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/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 &&

Powered by Google App Engine
This is Rietveld 408576698