Skip to content

Commit bbdf87d

Browse files
aamCommit Queue
authored andcommitted
[vm/debugger] Have debug step check point after debugger() call.
Fixes #46006 TEST=ci Change-Id: I89a7ad248b75204d1754668cfb23c8d98f554b28 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310779 Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Alexander Aprelev <[email protected]>
1 parent 43df18a commit bbdf87d

File tree

53 files changed

+579
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+579
-281
lines changed

pkg/vm_service/test/async_next_regression_18877_test.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import 'dart:developer';
88
import 'common/service_test_common.dart';
99
import 'common/test_helper.dart';
1010

11-
const int LINE_A = 24;
12-
const int LINE_B = 25;
13-
const int LINE_C = 26;
11+
const int LINE_D = 24;
12+
const int LINE_A = 25;
13+
const int LINE_B = 26;
14+
const int LINE_C = 27;
1415

1516
foo() async {}
1617

@@ -20,7 +21,7 @@ doAsync(stop) async {
2021
// an await causes the implicit breakpoint to be set for that closure instead
2122
// of the async_op, resulting in the debugger falling through.
2223
final baz = () => print('doAsync($stop) done!');
23-
if (stop) debugger();
24+
if (stop) debugger(); // LINE D
2425
await foo(); // Line A.
2526
await foo(); // Line B.
2627
await foo(); // Line C.
@@ -37,6 +38,8 @@ testMain() {
3738

3839
var tests = <IsolateTest>[
3940
hasStoppedAtBreakpoint,
41+
stoppedAtLine(LINE_D),
42+
stepOver, // foo()
4043
stoppedAtLine(LINE_A),
4144
stepOver, // foo()
4245
stoppedAtLine(LINE_A),

pkg/vm_service/test/async_next_test.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import 'dart:developer';
77
import 'common/service_test_common.dart';
88
import 'common/test_helper.dart';
99

10-
const int LINE_A = 18;
11-
const int LINE_B = 19;
12-
const int LINE_C = 20;
10+
const int LINE_D = 18;
11+
const int LINE_A = 19;
12+
const int LINE_B = 20;
13+
const int LINE_C = 21;
1314

1415
foo() async {}
1516

@@ -30,6 +31,8 @@ testMain() {
3031

3132
var tests = <IsolateTest>[
3233
hasStoppedAtBreakpoint,
34+
stoppedAtLine(LINE_D),
35+
stepOver, // foo()
3336
stoppedAtLine(LINE_A),
3437
stepOver, // foo()
3538
asyncNext,

pkg/vm_service/test/async_single_step_exception_test.dart

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,22 @@ import 'dart:developer';
66
import 'common/service_test_common.dart';
77
import 'common/test_helper.dart';
88

9-
const LINE_A = 18;
10-
const LINE_B = 19;
11-
const LINE_C = 24;
12-
const LINE_D = 26;
13-
const LINE_E = 29;
14-
const LINE_F = 32;
15-
const LINE_G = 34;
9+
const LINE_A = 19;
10+
const LINE_B = 20;
11+
const LINE_0 = 24;
12+
const LINE_C = 25;
13+
const LINE_D = 27;
14+
const LINE_E = 30;
15+
const LINE_F = 33;
16+
const LINE_G = 35;
1617

1718
helper() async {
1819
print('helper'); // LINE_A.
1920
throw 'a'; // LINE_B.
2021
}
2122

2223
testMain() async {
23-
debugger();
24+
debugger(); // LINE_0.
2425
print('mmmmm'); // LINE_C.
2526
try {
2627
await helper(); // LINE_D.
@@ -36,6 +37,9 @@ testMain() async {
3637

3738
var tests = <IsolateTest>[
3839
hasStoppedAtBreakpoint,
40+
stoppedAtLine(LINE_0), // debugger
41+
stepOver,
42+
3943
stoppedAtLine(LINE_C), // print mmmm
4044
smartNext,
4145

pkg/vm_service/test/async_single_step_into_test.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,29 @@ import 'dart:developer';
66
import 'common/service_test_common.dart';
77
import 'common/test_helper.dart';
88

9-
const LINE_A = 15;
10-
const LINE_B = 16;
11-
const LINE_C = 21;
12-
const LINE_D = 22;
9+
const LINE_A = 16;
10+
const LINE_B = 17;
11+
const LINE_0 = 21;
12+
const LINE_C = 22;
13+
const LINE_D = 23;
1314

1415
helper() async {
1516
print('helper'); // LINE_A.
1617
print('foobar'); // LINE_B.
1718
}
1819

1920
testMain() {
20-
debugger();
21+
debugger(); // LINE_0.
2122
print('mmmmm'); // LINE_C.
2223
helper(); // LINE_D.
2324
print('z');
2425
}
2526

2627
var tests = <IsolateTest>[
2728
hasStoppedAtBreakpoint,
29+
stoppedAtLine(LINE_0),
30+
stepOver, // print.
31+
2832
stoppedAtLine(LINE_C),
2933
stepOver, // print.
3034

pkg/vm_service/test/async_single_step_out_test.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,30 @@ import 'dart:developer';
66
import 'common/service_test_common.dart';
77
import 'common/test_helper.dart';
88

9-
const LINE_A = 16;
10-
const LINE_B = 17;
11-
const LINE_C = 22;
12-
const LINE_D = 23;
13-
const LINE_E = 24;
9+
const LINE_A = 17;
10+
const LINE_B = 18;
11+
const LINE_0 = 22;
12+
const LINE_C = 23;
13+
const LINE_D = 24;
14+
const LINE_E = 25;
1415

1516
helper() async {
1617
print('helper'); // LINE_A.
1718
return null; // LINE_B.
1819
}
1920

2021
testMain() async {
21-
debugger();
22+
debugger(); // LINE_0.
2223
print('mmmmm'); // LINE_C.
2324
await helper(); // LINE_D.
2425
print('z'); // LINE_E.
2526
}
2627

2728
var tests = <IsolateTest>[
2829
hasStoppedAtBreakpoint,
30+
stoppedAtLine(LINE_0), // debugger
31+
stepOver,
32+
2933
stoppedAtLine(LINE_C), // print mmmm
3034
stepOver,
3135

pkg/vm_service/test/async_star_single_step_into_test.dart

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ import 'dart:developer';
66
import 'common/service_test_common.dart';
77
import 'common/test_helper.dart';
88

9-
const LINE_A = 18;
10-
const LINE_B = 19;
11-
const LINE_C = 23;
12-
const LINE_D = 27;
13-
const LINE_E = 33;
14-
const LINE_F = 34;
15-
const LINE_G = 25;
9+
const LINE_A = 21;
10+
const LINE_B = 22;
11+
const LINE_C = 26;
12+
const LINE_D = 30;
13+
const LINE_E = 36;
14+
const LINE_F = 37;
15+
const LINE_G = 28;
16+
17+
const LINE_0 = 29;
18+
const LINE_1 = 35;
1619

1720
foobar() async* {
1821
yield 1; // LINE_A.
@@ -23,19 +26,23 @@ helper() async {
2326
print('helper'); // LINE_C.
2427
// ignore: unused_local_variable
2528
await for (var i in foobar()) /* LINE_G. */ {
26-
debugger();
29+
debugger(); // LINE_0.
2730
print('loop'); // LINE_D.
2831
}
2932
}
3033

3134
testMain() {
32-
debugger();
35+
debugger(); // LINE_1.
3336
print('mmmmm'); // LINE_E.
3437
helper(); // LINE_F.
3538
print('z');
3639
}
3740

3841
var tests = <IsolateTest>[
42+
hasStoppedAtBreakpoint,
43+
stoppedAtLine(LINE_1),
44+
stepOver, // debugger.
45+
3946
hasStoppedAtBreakpoint,
4047
stoppedAtLine(LINE_E),
4148
stepOver, // print.
@@ -62,6 +69,10 @@ var tests = <IsolateTest>[
6269
// TODO(johnmccutchan): Implement support for step-out of async functions.
6370
resumeIsolate,
6471

72+
hasStoppedAtBreakpoint,
73+
stoppedAtLine(LINE_0),
74+
stepOver, // debugger.
75+
6576
hasStoppedAtBreakpoint,
6677
stoppedAtLine(LINE_D),
6778
stepOver, // print.

pkg/vm_service/test/async_star_step_out_test.dart

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@ import 'dart:developer';
66
import 'common/service_test_common.dart';
77
import 'common/test_helper.dart';
88

9-
const LINE_A = 20;
10-
const LINE_B = 21;
11-
const LINE_C = 25;
12-
const LINE_D = 29;
13-
const LINE_E = 36;
14-
const LINE_F = 37;
15-
const LINE_G = 38;
16-
const LINE_H = 27;
17-
const LINE_I = 31;
9+
const LINE_A = 23;
10+
const LINE_B = 24;
11+
const LINE_C = 28;
12+
const LINE_D = 32;
13+
const LINE_E = 39;
14+
const LINE_F = 40;
15+
const LINE_G = 41;
16+
const LINE_H = 30;
17+
const LINE_I = 34;
18+
19+
const LINE_0 = 30;
20+
const LINE_1 = 38;
1821

1922
foobar() async* {
2023
yield 1; // LINE_A.
@@ -25,20 +28,24 @@ helper() async {
2528
print('helper'); // LINE_C.
2629
// ignore: unused_local_variable
2730
await for (var i in foobar()) /* LINE_H */ {
28-
debugger();
31+
debugger(); // LINE_0
2932
print('loop'); // LINE_D.
3033
}
3134
return null; // LINE_I.
3235
}
3336

3437
testMain() {
35-
debugger();
38+
debugger(); // LINE_1
3639
print('mmmmm'); // LINE_E.
3740
helper(); // LINE_F.
3841
print('z'); // LINE_G.
3942
}
4043

4144
var tests = <IsolateTest>[
45+
hasStoppedAtBreakpoint,
46+
stoppedAtLine(LINE_1),
47+
stepOver, // debugger.
48+
4249
hasStoppedAtBreakpoint,
4350
stoppedAtLine(LINE_E),
4451
stepOver, // print.

pkg/vm_service/test/async_step_out_test.dart

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import 'dart:developer';
66
import 'common/service_test_common.dart';
77
import 'common/test_helper.dart';
88

9-
const LINE_A = 17;
10-
const LINE_B = 18;
11-
const LINE_C = 19;
12-
const LINE_D = 24;
13-
const LINE_E = 25;
14-
const LINE_F = 26;
9+
const LINE_A = 19;
10+
const LINE_B = 20;
11+
const LINE_C = 21;
12+
const LINE_D = 26;
13+
const LINE_E = 27;
14+
const LINE_F = 28;
15+
16+
const LINE_0 = 25;
1517

1618
helper() async {
1719
await null; // LINE_A.
@@ -20,13 +22,17 @@ helper() async {
2022
}
2123

2224
testMain() async {
23-
debugger();
25+
debugger(); // LINE_0.
2426
print('mmmmm'); // LINE_D.
2527
await helper(); // LINE_E.
2628
print('z'); // LINE_F.
2729
}
2830

2931
var tests = <IsolateTest>[
32+
hasStoppedAtBreakpoint,
33+
stoppedAtLine(LINE_0),
34+
stepOver, // debugger.
35+
3036
hasStoppedAtBreakpoint,
3137
stoppedAtLine(LINE_D),
3238
stepOver, // print.

pkg/vm_service/test/awaiter_async_stack_contents_2_test.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ import 'package:vm_service/vm_service.dart';
1111
import 'common/service_test_common.dart';
1212
import 'common/test_helper.dart';
1313

14-
const LINE_A = 28;
15-
const LINE_B = 34;
16-
const LINE_C = 38;
14+
const LINE_A = 30;
15+
const LINE_B = 36;
16+
const LINE_C = 40;
17+
18+
const LINE_0 = 29;
1719

1820
notCalled() async {
1921
await null;
@@ -24,7 +26,7 @@ notCalled() async {
2426

2527
foobar() async {
2628
await null;
27-
debugger();
29+
debugger(); // LINE_0.
2830
print('foobar'); // LINE_A.
2931
}
3032

@@ -39,6 +41,9 @@ testMain() async {
3941
}
4042

4143
var tests = <IsolateTest>[
44+
hasStoppedAtBreakpoint,
45+
stoppedAtLine(LINE_0),
46+
stepOver,
4247
hasStoppedAtBreakpoint,
4348
stoppedAtLine(LINE_A),
4449
(VmService service, IsolateRef isolate) async {

0 commit comments

Comments
 (0)