Files
sdk/runtime/observatory/tests/service/column_breakpoint_test.dart
T
Zichang Guo 482c36d9ae [vm/debugger] Remove script soucre look up in debugger
When resolving column breakpoint, debugger will lookup the character in the source of script to make sure the column has been specified within the range of a valid identifier.
With this CL, column breakpoint will be resolved previous safepoint position, if requested column falls within [saftpoint, next_safepoint/end of line(smaller one)]. For example, setting column breakpoint on left bracket of a function call might be resolved to function call now. Setting on the end of line will resolved to previous safepoint.

BUG: https://github.com/dart-lang/sdk/issues/36642
Change-Id: I16427772fde4c653da7629e3340282ef1d9046eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100404
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-05-02 18:43:55 +00:00

39 lines
1.1 KiB
Dart

// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'test_helper.dart';
import 'service_test_common.dart';
code() {
var b = [1, 2].map((i) => i == 0).toList();
print(b.length);
}
const int LINE = 9;
const int COLUMN = 29;
const String shortFile = "column_breakpoint_test.dart";
const String breakpointFile =
"package:observatory_test_package/column_breakpoint_test.dart";
List<String> stops = [];
List<String> expected = [
"$shortFile:${LINE + 0}:23", // on 'i == 0'
"$shortFile:${LINE + 0}:23", // iterate twice
"$shortFile:${LINE + 1}:3" //on 'b.length'
];
var tests = <IsolateTest>[
hasPausedAtStart,
setBreakpointAtLineColumn(LINE, COLUMN), // on 'i == 0'
setBreakpointAtLineColumn(LINE + 1, 9), // on 'b.length'
resumeProgramRecordingStops(stops, false),
checkRecordedStops(stops, expected)
];
main(args) {
runIsolateTestsSynchronous(args, tests,
testeeConcurrent: code, pause_on_start: true, pause_on_exit: true);
}