[vm/debugger] Have debug step check point after debugger() call.

Fixes https://github.com/dart-lang/sdk/issues/46006
TEST=ci

Change-Id: I89a7ad248b75204d1754668cfb23c8d98f554b28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310779
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
diff --git a/pkg/vm_service/test/async_next_regression_18877_test.dart b/pkg/vm_service/test/async_next_regression_18877_test.dart
index 6912a67..eaf786d 100644
--- a/pkg/vm_service/test/async_next_regression_18877_test.dart
+++ b/pkg/vm_service/test/async_next_regression_18877_test.dart
@@ -8,9 +8,10 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const int LINE_A = 24;
-const int LINE_B = 25;
-const int LINE_C = 26;
+const int LINE_D = 24;
+const int LINE_A = 25;
+const int LINE_B = 26;
+const int LINE_C = 27;
 
 foo() async {}
 
@@ -20,7 +21,7 @@
   // an await causes the implicit breakpoint to be set for that closure instead
   // of the async_op, resulting in the debugger falling through.
   final baz = () => print('doAsync($stop) done!');
-  if (stop) debugger();
+  if (stop) debugger(); // LINE D
   await foo(); // Line A.
   await foo(); // Line B.
   await foo(); // Line C.
@@ -37,6 +38,8 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_D),
+  stepOver, // foo()
   stoppedAtLine(LINE_A),
   stepOver, // foo()
   stoppedAtLine(LINE_A),
diff --git a/pkg/vm_service/test/async_next_test.dart b/pkg/vm_service/test/async_next_test.dart
index fe23bf1..9678f50 100644
--- a/pkg/vm_service/test/async_next_test.dart
+++ b/pkg/vm_service/test/async_next_test.dart
@@ -7,9 +7,10 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const int LINE_A = 18;
-const int LINE_B = 19;
-const int LINE_C = 20;
+const int LINE_D = 18;
+const int LINE_A = 19;
+const int LINE_B = 20;
+const int LINE_C = 21;
 
 foo() async {}
 
@@ -30,6 +31,8 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_D),
+  stepOver, // foo()
   stoppedAtLine(LINE_A),
   stepOver, // foo()
   asyncNext,
diff --git a/pkg/vm_service/test/async_single_step_exception_test.dart b/pkg/vm_service/test/async_single_step_exception_test.dart
index 31f5394..133ab41 100644
--- a/pkg/vm_service/test/async_single_step_exception_test.dart
+++ b/pkg/vm_service/test/async_single_step_exception_test.dart
@@ -6,13 +6,14 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const LINE_A = 18;
-const LINE_B = 19;
-const LINE_C = 24;
-const LINE_D = 26;
-const LINE_E = 29;
-const LINE_F = 32;
-const LINE_G = 34;
+const LINE_A = 19;
+const LINE_B = 20;
+const LINE_0 = 24;
+const LINE_C = 25;
+const LINE_D = 27;
+const LINE_E = 30;
+const LINE_F = 33;
+const LINE_G = 35;
 
 helper() async {
   print('helper'); // LINE_A.
@@ -20,7 +21,7 @@
 }
 
 testMain() async {
-  debugger();
+  debugger(); // LINE_0.
   print('mmmmm'); // LINE_C.
   try {
     await helper(); // LINE_D.
@@ -36,6 +37,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0), // debugger
+  stepOver,
+
   stoppedAtLine(LINE_C), // print mmmm
   smartNext,
 
diff --git a/pkg/vm_service/test/async_single_step_into_test.dart b/pkg/vm_service/test/async_single_step_into_test.dart
index e5f77f7..88cbe1c 100644
--- a/pkg/vm_service/test/async_single_step_into_test.dart
+++ b/pkg/vm_service/test/async_single_step_into_test.dart
@@ -6,10 +6,11 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const LINE_A = 15;
-const LINE_B = 16;
-const LINE_C = 21;
-const LINE_D = 22;
+const LINE_A = 16;
+const LINE_B = 17;
+const LINE_0 = 21;
+const LINE_C = 22;
+const LINE_D = 23;
 
 helper() async {
   print('helper'); // LINE_A.
@@ -17,7 +18,7 @@
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_0.
   print('mmmmm'); // LINE_C.
   helper(); // LINE_D.
   print('z');
@@ -25,6 +26,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver, // print.
+
   stoppedAtLine(LINE_C),
   stepOver, // print.
 
diff --git a/pkg/vm_service/test/async_single_step_out_test.dart b/pkg/vm_service/test/async_single_step_out_test.dart
index c3da030..c65ab97 100644
--- a/pkg/vm_service/test/async_single_step_out_test.dart
+++ b/pkg/vm_service/test/async_single_step_out_test.dart
@@ -6,11 +6,12 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const LINE_A = 16;
-const LINE_B = 17;
-const LINE_C = 22;
-const LINE_D = 23;
-const LINE_E = 24;
+const LINE_A = 17;
+const LINE_B = 18;
+const LINE_0 = 22;
+const LINE_C = 23;
+const LINE_D = 24;
+const LINE_E = 25;
 
 helper() async {
   print('helper'); // LINE_A.
@@ -18,7 +19,7 @@
 }
 
 testMain() async {
-  debugger();
+  debugger(); // LINE_0.
   print('mmmmm'); // LINE_C.
   await helper(); // LINE_D.
   print('z'); // LINE_E.
@@ -26,6 +27,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0), // debugger
+  stepOver,
+
   stoppedAtLine(LINE_C), // print mmmm
   stepOver,
 
diff --git a/pkg/vm_service/test/async_star_single_step_into_test.dart b/pkg/vm_service/test/async_star_single_step_into_test.dart
index e722bbb..2c9f3c1 100644
--- a/pkg/vm_service/test/async_star_single_step_into_test.dart
+++ b/pkg/vm_service/test/async_star_single_step_into_test.dart
@@ -6,13 +6,16 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const LINE_A = 18;
-const LINE_B = 19;
-const LINE_C = 23;
-const LINE_D = 27;
-const LINE_E = 33;
-const LINE_F = 34;
-const LINE_G = 25;
+const LINE_A = 21;
+const LINE_B = 22;
+const LINE_C = 26;
+const LINE_D = 30;
+const LINE_E = 36;
+const LINE_F = 37;
+const LINE_G = 28;
+
+const LINE_0 = 29;
+const LINE_1 = 35;
 
 foobar() async* {
   yield 1; // LINE_A.
@@ -23,13 +26,13 @@
   print('helper'); // LINE_C.
   // ignore: unused_local_variable
   await for (var i in foobar()) /* LINE_G. */ {
-    debugger();
+    debugger(); // LINE_0.
     print('loop'); // LINE_D.
   }
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_1.
   print('mmmmm'); // LINE_E.
   helper(); // LINE_F.
   print('z');
@@ -37,6 +40,10 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver, // debugger.
+
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_E),
   stepOver, // print.
 
@@ -63,6 +70,10 @@
   resumeIsolate,
 
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver, // debugger.
+
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_D),
   stepOver, // print.
 
diff --git a/pkg/vm_service/test/async_star_step_out_test.dart b/pkg/vm_service/test/async_star_step_out_test.dart
index b1eba2a..d119323 100644
--- a/pkg/vm_service/test/async_star_step_out_test.dart
+++ b/pkg/vm_service/test/async_star_step_out_test.dart
@@ -6,15 +6,18 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const LINE_A = 20;
-const LINE_B = 21;
-const LINE_C = 25;
-const LINE_D = 29;
-const LINE_E = 36;
-const LINE_F = 37;
-const LINE_G = 38;
-const LINE_H = 27;
-const LINE_I = 31;
+const LINE_A = 23;
+const LINE_B = 24;
+const LINE_C = 28;
+const LINE_D = 32;
+const LINE_E = 39;
+const LINE_F = 40;
+const LINE_G = 41;
+const LINE_H = 30;
+const LINE_I = 34;
+
+const LINE_0 = 30;
+const LINE_1 = 38;
 
 foobar() async* {
   yield 1; // LINE_A.
@@ -25,14 +28,14 @@
   print('helper'); // LINE_C.
   // ignore: unused_local_variable
   await for (var i in foobar()) /* LINE_H */ {
-    debugger();
+    debugger(); // LINE_0
     print('loop'); // LINE_D.
   }
   return null; // LINE_I.
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_1
   print('mmmmm'); // LINE_E.
   helper(); // LINE_F.
   print('z'); // LINE_G.
@@ -40,6 +43,10 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver, // debugger.
+
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_E),
   stepOver, // print.
 
diff --git a/pkg/vm_service/test/async_step_out_test.dart b/pkg/vm_service/test/async_step_out_test.dart
index 7f37fe6..4c72146 100644
--- a/pkg/vm_service/test/async_step_out_test.dart
+++ b/pkg/vm_service/test/async_step_out_test.dart
@@ -6,12 +6,14 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const LINE_A = 17;
-const LINE_B = 18;
-const LINE_C = 19;
-const LINE_D = 24;
-const LINE_E = 25;
-const LINE_F = 26;
+const LINE_A = 19;
+const LINE_B = 20;
+const LINE_C = 21;
+const LINE_D = 26;
+const LINE_E = 27;
+const LINE_F = 28;
+
+const LINE_0 = 25;
 
 helper() async {
   await null; // LINE_A.
@@ -20,7 +22,7 @@
 }
 
 testMain() async {
-  debugger();
+  debugger(); // LINE_0.
   print('mmmmm'); // LINE_D.
   await helper(); // LINE_E.
   print('z'); // LINE_F.
@@ -28,6 +30,10 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver, // debugger.
+
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_D),
   stepOver, // print.
 
diff --git a/pkg/vm_service/test/awaiter_async_stack_contents_2_test.dart b/pkg/vm_service/test/awaiter_async_stack_contents_2_test.dart
index 1e018e6..4c9fb0f 100644
--- a/pkg/vm_service/test/awaiter_async_stack_contents_2_test.dart
+++ b/pkg/vm_service/test/awaiter_async_stack_contents_2_test.dart
@@ -11,9 +11,11 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const LINE_A = 28;
-const LINE_B = 34;
-const LINE_C = 38;
+const LINE_A = 30;
+const LINE_B = 36;
+const LINE_C = 40;
+
+const LINE_0 = 29;
 
 notCalled() async {
   await null;
@@ -24,7 +26,7 @@
 
 foobar() async {
   await null;
-  debugger();
+  debugger(); // LINE_0.
   print('foobar'); // LINE_A.
 }
 
@@ -40,6 +42,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (VmService service, IsolateRef isolate) async {
     final isolateId = isolate.id!;
diff --git a/pkg/vm_service/test/awaiter_async_stack_contents_test.dart b/pkg/vm_service/test/awaiter_async_stack_contents_test.dart
index cca3da3..175a264 100644
--- a/pkg/vm_service/test/awaiter_async_stack_contents_test.dart
+++ b/pkg/vm_service/test/awaiter_async_stack_contents_test.dart
@@ -11,31 +11,38 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const LINE_C = 22;
-const LINE_A = 28;
-const LINE_B = 34;
-const LINE_D = 29;
+const LINE_C = 26;
+const LINE_A = 32;
+const LINE_B = 38;
+const LINE_D = 33;
+
+const LINE_0 = 25;
+const LINE_1 = 31;
+const LINE_2 = 37;
 
 foobar() async {
   await null;
-  debugger();
+  debugger(); // LINE_0.
   print('foobar'); // LINE_C.
 }
 
 helper() async {
   await null;
-  debugger();
+  debugger(); // LINE_1.
   print('helper'); // LINE_A.
   await foobar(); // LINE_D
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_2.
   helper(); // LINE_B.
 }
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_2),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   (VmService service, IsolateRef isolateRef) async {
     Stack stack = await service.getStack(isolateRef.id!);
@@ -44,9 +51,15 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C),
   (VmService service, IsolateRef isolateRef) async {
     // Verify awaiter stack trace is the current frame + the awaiter.
diff --git a/pkg/vm_service/test/causal_async_stack_contents_test.dart b/pkg/vm_service/test/causal_async_stack_contents_test.dart
index aad6986..067738a 100644
--- a/pkg/vm_service/test/causal_async_stack_contents_test.dart
+++ b/pkg/vm_service/test/causal_async_stack_contents_test.dart
@@ -11,29 +11,36 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const LINE_C = 20;
-const LINE_A = 26;
-const LINE_B = 32;
+const LINE_C = 24;
+const LINE_A = 30;
+const LINE_B = 36;
+
+const LINE_0 = 23;
+const LINE_1 = 29;
+const LINE_2 = 35;
 
 foobar() {
-  debugger();
+  debugger(); // LINE_0.
   print('foobar'); // LINE_C.
 }
 
 helper() async {
   await 0; // force async gap
-  debugger();
+  debugger(); // LINE_1.
   print('helper'); // LINE_A.
   foobar();
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_2.
   helper(); // LINE_B.
 }
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_2),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   (VmService service, IsolateRef isolateRef) async {
     Stack stack = await service.getStack(isolateRef.id!);
@@ -42,6 +49,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (VmService service, IsolateRef isolateRef) async {
     Stack stack = await service.getStack(isolateRef.id!);
@@ -55,6 +65,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C),
   (VmService service, IsolateRef isolateRef) async {
     Stack stack = await service.getStack(isolateRef.id!);
diff --git a/pkg/vm_service/test/causal_async_stack_presence_test.dart b/pkg/vm_service/test/causal_async_stack_presence_test.dart
index 5eb2c46..eb3504b 100644
--- a/pkg/vm_service/test/causal_async_stack_presence_test.dart
+++ b/pkg/vm_service/test/causal_async_stack_presence_test.dart
@@ -10,29 +10,36 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const LINE_C = 19;
-const LINE_A = 25;
-const LINE_B = 31;
+const LINE_C = 23;
+const LINE_A = 29;
+const LINE_B = 35;
+
+const LINE_0 = 22;
+const LINE_1 = 28;
+const LINE_2 = 34;
 
 foobar() {
-  debugger();
+  debugger(); // LINE_0.
   print('foobar'); // LINE_C.
 }
 
 helper() async {
   await 0; // Yield. The rest will run async.
-  debugger();
+  debugger(); // LINE_1.
   print('helper'); // LINE_A.
   foobar();
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_2.
   helper(); // LINE_B.
 }
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_2),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   (VmService service, IsolateRef isolateRef) async {
     Stack stack = await service.getStack(isolateRef.id!);
@@ -42,6 +49,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (VmService service, IsolateRef isolateRef) async {
     Stack stack = await service.getStack(isolateRef.id!);
@@ -50,6 +60,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C),
   (VmService service, IsolateRef isolateRef) async {
     Stack stack = await service.getStack(isolateRef.id!);
diff --git a/pkg/vm_service/test/causal_async_star_stack_contents_test.dart b/pkg/vm_service/test/causal_async_star_stack_contents_test.dart
index 3d0e892..106c660 100644
--- a/pkg/vm_service/test/causal_async_star_stack_contents_test.dart
+++ b/pkg/vm_service/test/causal_async_star_stack_contents_test.dart
@@ -11,21 +11,25 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const LINE_A = 29;
-const LINE_B = 21;
-const LINE_C = 23;
+const LINE_A = 33;
+const LINE_B = 25;
+const LINE_C = 27;
+
+const LINE_0 = 24;
+const LINE_1 = 26;
+const LINE_2 = 32;
 
 foobar() async* {
   await 0; // force async gap
-  debugger();
+  debugger(); // LINE_0.
   yield 1; // LINE_B.
-  debugger();
+  debugger(); // LINE_1.
   yield 2; // LINE_C.
 }
 
 helper() async {
   await 0; // force async gap
-  debugger();
+  debugger(); // LINE_2.
   print('helper'); // LINE_A.
   await for (var i in foobar()) {
     print('helper $i');
@@ -38,6 +42,9 @@
 
 final tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_2),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (VmService service, IsolateRef isolateRef) async {
     Stack stack = await service.getStack(isolateRef.id!);
@@ -50,6 +57,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   (VmService service, IsolateRef isolateRef) async {
     Stack stack = await service.getStack(isolateRef.id!);
@@ -64,6 +74,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C),
   (VmService service, IsolateRef isolateRef) async {
     Stack stack = await service.getStack(isolateRef.id!);
@@ -82,7 +95,7 @@
     expect(asyncStack[2].function!.name, contains('helper'));
     expect(
       script.getLineNumberFromTokenPos(asyncStack[2].location!.tokenPos!),
-      30,
+      34,
     );
     expect(asyncStack[3].kind, equals(FrameKind.kAsyncSuspensionMarker));
   },
diff --git a/pkg/vm_service/test/causal_async_star_stack_presence_test.dart b/pkg/vm_service/test/causal_async_star_stack_presence_test.dart
index 15dba5a..63403ca 100644
--- a/pkg/vm_service/test/causal_async_star_stack_presence_test.dart
+++ b/pkg/vm_service/test/causal_async_star_stack_presence_test.dart
@@ -10,19 +10,23 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const LINE_A = 26;
-const LINE_B = 19;
-const LINE_C = 21;
+const LINE_A = 30;
+const LINE_B = 23;
+const LINE_C = 25;
+
+const LINE_0 = 22;
+const LINE_1 = 24;
+const LINE_2 = 29;
 
 foobar() async* {
-  debugger();
+  debugger(); // LINE_0.
   yield 1; // LINE_B.
-  debugger();
+  debugger(); // LINE_1.
   yield 2; // LINE_C.
 }
 
 helper() async {
-  debugger();
+  debugger(); // LINE_2.
   print('helper'); // LINE_A.
   await for (var i in foobar()) {
     print('helper $i');
@@ -35,6 +39,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_2),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (VmService service, IsolateRef isolateRef) async {
     Stack stack = await service.getStack(isolateRef.id!);
@@ -43,6 +50,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   (VmService service, IsolateRef isolateRef) async {
     Stack stack = await service.getStack(isolateRef.id!);
@@ -51,6 +61,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C),
   (VmService service, IsolateRef isolateRef) async {
     Stack stack = await service.getStack(isolateRef.id!);
diff --git a/pkg/vm_service/test/get_allocation_traces_test.dart b/pkg/vm_service/test/get_allocation_traces_test.dart
index 4d12086..e96cc40 100644
--- a/pkg/vm_service/test/get_allocation_traces_test.dart
+++ b/pkg/vm_service/test/get_allocation_traces_test.dart
@@ -23,19 +23,17 @@
 }
 
 void test() {
+  List l = <Object>[];
   debugger();
   // Toggled on for Foo.
-  debugger();
-  debugger();
   // Traced allocation.
-  Foo();
+  l.add(Foo());
   // Untraced allocation.
-  Bar();
+  l.add(Bar());
   // Toggled on for Bar.
   debugger();
-  debugger();
   // Traced allocation.
-  Bar();
+  l.add(Bar());
   debugger();
 }
 
@@ -57,6 +55,7 @@
 
 final tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(27),
 
   // Initial.
   (VmService service, IsolateRef isolate) async {
@@ -72,10 +71,7 @@
 
   resumeIsolate,
   hasStoppedAtBreakpoint,
-  // Extra debugger stop, continue to allow the allocation stubs to be switched
-  // over. This is a bug but low priority.
-  resumeIsolate,
-  hasStoppedAtBreakpoint,
+  stoppedAtLine(34),
 
   // Allocation profile.
   (VmService service, IsolateRef isolate) async {
@@ -86,6 +82,7 @@
     expect(profileResponse, isNotNull);
     expect(profileResponse.samples!.length, 1);
     expect(profileResponse.samples!.first.identityHashCode != 0, true);
+    print(profileResponse.samples);
 
     final instances = await service.getInstances(
       isolate.id!,
@@ -102,10 +99,7 @@
 
     fooClass = await service.getObject(isolate.id!, fooClass.id!) as Class;
     expect(fooClass.traceAllocations, false);
-  },
-  resumeIsolate,
-  hasStoppedAtBreakpoint,
-  (VmService service, IsolateRef isolate) async {
+
     // Trace Bar.
     Class barClass = (await getClassFromRootLib(service, isolate, 'Bar'))!;
     expect(barClass.traceAllocations, false);
@@ -116,10 +110,7 @@
 
   resumeIsolate,
   hasStoppedAtBreakpoint,
-  // Extra debugger stop, continue to allow the allocation stubs to be switched
-  // over. This is a bug but low priority.
-  resumeIsolate,
-  hasStoppedAtBreakpoint,
+  stoppedAtLine(37),
 
   (VmService service, IsolateRef isolate) async {
     // Ensure the allocation of `Bar()` was recorded.
diff --git a/pkg/vm_service/test/get_stack_test.dart b/pkg/vm_service/test/get_stack_test.dart
index 880bc55..e5dd418 100644
--- a/pkg/vm_service/test/get_stack_test.dart
+++ b/pkg/vm_service/test/get_stack_test.dart
@@ -12,8 +12,11 @@
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
-const LINE_A = 33;
-const LINE_B = 35;
+const LINE_A = 36;
+const LINE_B = 38;
+
+const LINE_0 = 35;
+const LINE_1 = 37;
 
 Future<void> testMain() async {
   await func1();
@@ -29,10 +32,10 @@
 Future func8() async => await func9();
 Future func9() async => await func10();
 Future func10() async {
-  debugger(); // LINE_A
-  await 0;
-  debugger(); // LINE_B
-  print("Hello, world!");
+  debugger(); // LINE_0.
+  await 0; // LINE_A
+  debugger(); // LINE_1.
+  print("Hello, world!"); // LINE_B.
 }
 
 void expectFrame(
@@ -51,6 +54,9 @@
 final tests = <IsolateTest>[
   // Before the first await.
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   // At LINE_A we're still running sync. so no asyncCausalFrames.
   (VmService service, IsolateRef isolateRef) async {
@@ -75,6 +81,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   // After resuming the continuation - i.e. running async.
   (VmService service, IsolateRef isolateRef) async {
diff --git a/runtime/observatory/tests/service/async_next_regression_18877_test.dart b/runtime/observatory/tests/service/async_next_regression_18877_test.dart
index 8b56841..b99413e 100644
--- a/runtime/observatory/tests/service/async_next_regression_18877_test.dart
+++ b/runtime/observatory/tests/service/async_next_regression_18877_test.dart
@@ -7,9 +7,11 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const int LINE_A = 23;
-const int LINE_B = 24;
-const int LINE_C = 25;
+const int LINE_A = 25;
+const int LINE_B = 26;
+const int LINE_C = 27;
+
+const int LINE_0 = 24;
 
 foo() async {}
 
@@ -19,7 +21,7 @@
   // an await causes the implicit breakpoint to be set for that closure instead
   // of the async_op, resulting in the debugger falling through.
   final baz = () => print('doAsync($stop) done!');
-  if (stop) debugger();
+  if (stop) debugger(); // LINE_0.
   await foo(); // Line A.
   await foo(); // Line B.
   await foo(); // Line C.
@@ -36,6 +38,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  hasStoppedAtBreakpoint,
+  stepOver, // debugger()
   stoppedAtLine(LINE_A),
   stepOver, // foo()
   stoppedAtLine(LINE_A),
diff --git a/runtime/observatory/tests/service/async_next_test.dart b/runtime/observatory/tests/service/async_next_test.dart
index f717e0a..57026ee 100644
--- a/runtime/observatory/tests/service/async_next_test.dart
+++ b/runtime/observatory/tests/service/async_next_test.dart
@@ -7,14 +7,16 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const int LINE_A = 18;
-const int LINE_B = 19;
-const int LINE_C = 20;
+const int LINE_A = 20;
+const int LINE_B = 21;
+const int LINE_C = 22;
+
+const int LINE_0 = 19;
 
 foo() async {}
 
 doAsync(stop) async {
-  if (stop) debugger();
+  if (stop) debugger(); // LINE_0.
   await foo(); // Line A.
   await foo(); // Line B.
   await foo(); // Line C.
@@ -30,6 +32,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver, // debugger()
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   stepOver, // foo()
   asyncNext,
diff --git a/runtime/observatory/tests/service/async_single_step_exception_test.dart b/runtime/observatory/tests/service/async_single_step_exception_test.dart
index 0712ba4..18f1d16 100644
--- a/runtime/observatory/tests/service/async_single_step_exception_test.dart
+++ b/runtime/observatory/tests/service/async_single_step_exception_test.dart
@@ -8,13 +8,15 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_A = 20;
-const LINE_B = 21;
-const LINE_C = 26;
-const LINE_D = 28;
-const LINE_E = 31;
-const LINE_F = 34;
-const LINE_G = 36;
+const LINE_A = 22;
+const LINE_B = 23;
+const LINE_C = 28;
+const LINE_D = 30;
+const LINE_E = 33;
+const LINE_F = 36;
+const LINE_G = 38;
+
+const LINE_0 = 27;
 
 helper() async {
   print('helper'); // LINE_A.
@@ -22,7 +24,7 @@
 }
 
 testMain() async {
-  debugger();
+  debugger(); // LINE_0.
   print('mmmmm'); // LINE_C.
   try {
     await helper(); // LINE_D.
@@ -38,6 +40,10 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0), // debugger
+  stepOver,
+
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C), // print mmmm
   smartNext,
 
diff --git a/runtime/observatory/tests/service/async_single_step_into_test.dart b/runtime/observatory/tests/service/async_single_step_into_test.dart
index 2685cac..62455b8 100644
--- a/runtime/observatory/tests/service/async_single_step_into_test.dart
+++ b/runtime/observatory/tests/service/async_single_step_into_test.dart
@@ -8,10 +8,12 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_A = 17;
-const LINE_B = 18;
-const LINE_C = 23;
-const LINE_D = 24;
+const LINE_A = 19;
+const LINE_B = 20;
+const LINE_C = 25;
+const LINE_D = 26;
+
+const LINE_0 = 24;
 
 helper() async {
   print('helper'); // LINE_A.
@@ -19,7 +21,7 @@
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_0.
   print('mmmmm'); // LINE_C.
   helper(); // LINE_D.
   print('z');
@@ -27,6 +29,10 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver, // debugger.
+
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C),
   stepOver, // print.
 
diff --git a/runtime/observatory/tests/service/async_single_step_out_test.dart b/runtime/observatory/tests/service/async_single_step_out_test.dart
index bf09b4d..810ef79 100644
--- a/runtime/observatory/tests/service/async_single_step_out_test.dart
+++ b/runtime/observatory/tests/service/async_single_step_out_test.dart
@@ -8,11 +8,13 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_A = 18;
-const LINE_B = 19;
-const LINE_C = 24;
-const LINE_D = 25;
-const LINE_E = 26;
+const LINE_A = 20;
+const LINE_B = 21;
+const LINE_C = 26;
+const LINE_D = 27;
+const LINE_E = 28;
+
+const LINE_0 = 25;
 
 helper() async {
   print('helper'); // LINE_A.
@@ -20,7 +22,7 @@
 }
 
 testMain() async {
-  debugger();
+  debugger(); // LINE_0.
   print('mmmmm'); // LINE_C.
   await helper(); // LINE_D.
   print('z'); // LINE_E.
@@ -28,6 +30,10 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0), // debugger
+  stepOver,
+
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C), // print mmmm
   stepOver,
 
diff --git a/runtime/observatory/tests/service/async_star_single_step_into_test.dart b/runtime/observatory/tests/service/async_star_single_step_into_test.dart
index 6984a7fe..dff847b 100644
--- a/runtime/observatory/tests/service/async_star_single_step_into_test.dart
+++ b/runtime/observatory/tests/service/async_star_single_step_into_test.dart
@@ -8,13 +8,16 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_A = 20;
-const LINE_B = 21;
-const LINE_C = 25;
-const LINE_D = 28;
-const LINE_E = 34;
-const LINE_F = 35;
-const LINE_G = 26;
+const LINE_A = 23;
+const LINE_B = 24;
+const LINE_C = 28;
+const LINE_D = 31;
+const LINE_E = 37;
+const LINE_F = 38;
+const LINE_G = 29;
+
+const LINE_0 = 30;
+const LINE_1 = 36;
 
 foobar() async* {
   yield 1; // LINE_A.
@@ -24,13 +27,13 @@
 helper() async {
   print('helper'); // LINE_C.
   await for (var _ in foobar()) /* LINE_G. */ {
-    debugger();
+    debugger(); // LINE_0.
     print('loop'); // LINE_D.
   }
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_1.
   print('mmmmm'); // LINE_E.
   helper(); // LINE_F.
   print('z');
@@ -38,6 +41,10 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver, // debugger.
+
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_E),
   stepOver, // print.
 
@@ -64,6 +71,10 @@
   resumeIsolate,
 
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver, // debugger.
+
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_D),
   stepOver, // print.
 
diff --git a/runtime/observatory/tests/service/async_star_step_out_test.dart b/runtime/observatory/tests/service/async_star_step_out_test.dart
index 2265a33..110f704 100644
--- a/runtime/observatory/tests/service/async_star_step_out_test.dart
+++ b/runtime/observatory/tests/service/async_star_step_out_test.dart
@@ -8,15 +8,18 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_A = 22;
-const LINE_B = 23;
-const LINE_C = 27;
-const LINE_D = 30;
-const LINE_E = 37;
-const LINE_F = 38;
-const LINE_G = 39;
-const LINE_H = 28;
-const LINE_I = 32;
+const LINE_A = 25;
+const LINE_B = 26;
+const LINE_C = 30;
+const LINE_D = 33;
+const LINE_E = 40;
+const LINE_F = 41;
+const LINE_G = 42;
+const LINE_H = 31;
+const LINE_I = 35;
+
+const LINE_0 = 31;
+const LINE_1 = 39;
 
 foobar() async* {
   yield 1; // LINE_A.
@@ -26,14 +29,14 @@
 helper() async {
   print('helper'); // LINE_C.
   await for (var _ in foobar()) /* LINE_H */ {
-    debugger();
+    debugger(); // LINE_0.
     print('loop'); // LINE_D.
   }
   return null; // LINE_I.
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_1.
   print('mmmmm'); // LINE_E.
   helper(); // LINE_F.
   print('z'); // LINE_G.
@@ -41,6 +44,10 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver, // debugger.
+
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_E),
   stepOver, // print.
 
diff --git a/runtime/observatory/tests/service/async_step_out_test.dart b/runtime/observatory/tests/service/async_step_out_test.dart
index 5359d1e..64be6e4 100644
--- a/runtime/observatory/tests/service/async_step_out_test.dart
+++ b/runtime/observatory/tests/service/async_step_out_test.dart
@@ -8,12 +8,14 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_A = 19;
-const LINE_B = 20;
-const LINE_C = 21;
-const LINE_D = 26;
-const LINE_E = 27;
-const LINE_F = 28;
+const LINE_A = 21;
+const LINE_B = 22;
+const LINE_C = 23;
+const LINE_D = 28;
+const LINE_E = 29;
+const LINE_F = 30;
+
+const LINE_0 = 27;
 
 helper() async {
   await null; // LINE_A.
@@ -22,7 +24,7 @@
 }
 
 testMain() async {
-  debugger();
+  debugger(); // LINE_0.
   print('mmmmm'); // LINE_D.
   await helper(); // LINE_E.
   print('z'); // LINE_F.
@@ -30,6 +32,10 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver, // debugger.
+
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_D),
   stepOver, // print.
 
diff --git a/runtime/observatory/tests/service/awaiter_async_stack_contents_2_test.dart b/runtime/observatory/tests/service/awaiter_async_stack_contents_2_test.dart
index 2492b93..ba060b7 100644
--- a/runtime/observatory/tests/service/awaiter_async_stack_contents_2_test.dart
+++ b/runtime/observatory/tests/service/awaiter_async_stack_contents_2_test.dart
@@ -11,9 +11,11 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_A = 28;
-const LINE_B = 34;
-const LINE_C = 38;
+const LINE_A = 30;
+const LINE_B = 36;
+const LINE_C = 40;
+
+const LINE_0 = 29;
 
 notCalled() async {
   await null;
@@ -24,7 +26,7 @@
 
 foobar() async {
   await null;
-  debugger();
+  debugger(); // LINE_0.
   print('foobar'); // LINE_A.
 }
 
@@ -40,6 +42,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (Isolate isolate) async {
     // Verify awaiter stack trace is the current frame + the awaiter.
diff --git a/runtime/observatory/tests/service/awaiter_async_stack_contents_test.dart b/runtime/observatory/tests/service/awaiter_async_stack_contents_test.dart
index 4e9f16a..51d79dd 100644
--- a/runtime/observatory/tests/service/awaiter_async_stack_contents_test.dart
+++ b/runtime/observatory/tests/service/awaiter_async_stack_contents_test.dart
@@ -11,31 +11,38 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_C = 22;
-const LINE_A = 28;
-const LINE_B = 34;
-const LINE_D = 29;
+const LINE_C = 26;
+const LINE_A = 32;
+const LINE_B = 38;
+const LINE_D = 33;
+
+const LINE_0 = 25;
+const LINE_1 = 31;
+const LINE_2 = 37;
 
 foobar() async {
   await null;
-  debugger();
+  debugger(); // LINE_0.
   print('foobar'); // LINE_C.
 }
 
 helper() async {
   await null;
-  debugger();
+  debugger(); // LINE_1.
   print('helper'); // LINE_A.
   await foobar(); // LINE_D
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_2.
   helper(); // LINE_B.
 }
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_2),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
@@ -44,9 +51,15 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C),
   (Isolate isolate) async {
     // Verify awaiter stack trace is the current frame + the awaiter.
diff --git a/runtime/observatory/tests/service/break_on_function_many_child_isolates_test.dart b/runtime/observatory/tests/service/break_on_function_many_child_isolates_test.dart
index 8e13203..8d05b0d 100644
--- a/runtime/observatory/tests/service/break_on_function_many_child_isolates_test.dart
+++ b/runtime/observatory/tests/service/break_on_function_many_child_isolates_test.dart
@@ -52,6 +52,9 @@
   hasPausedAtStart,
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_B),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B + 1),
   (Isolate isolate) async {
     // Set up a listener to wait for child isolate launch and breakpoint events.
@@ -111,6 +114,9 @@
     await Future.wait(completerAtFoo.map((c) => c.future));
   },
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_C),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C + 1),
   resumeIsolate,
 ];
diff --git a/runtime/observatory/tests/service/causal_async_stack_contents_test.dart b/runtime/observatory/tests/service/causal_async_stack_contents_test.dart
index c92f417..a64aa1d 100644
--- a/runtime/observatory/tests/service/causal_async_stack_contents_test.dart
+++ b/runtime/observatory/tests/service/causal_async_stack_contents_test.dart
@@ -10,29 +10,36 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_C = 19;
-const LINE_A = 25;
-const LINE_B = 31;
+const LINE_C = 23;
+const LINE_A = 29;
+const LINE_B = 35;
+
+const LINE_0 = 22;
+const LINE_1 = 28;
+const LINE_2 = 34;
 
 foobar() {
-  debugger();
+  debugger(); // LINE_0.
   print('foobar'); // LINE_C.
 }
 
 helper() async {
   await 0; // force async gap
-  debugger();
+  debugger(); // LINE_1.
   print('helper'); // LINE_A.
   foobar();
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_2.
   helper(); // LINE_B.
 }
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_2),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
@@ -41,6 +48,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
@@ -52,6 +62,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
diff --git a/runtime/observatory/tests/service/causal_async_stack_presence_test.dart b/runtime/observatory/tests/service/causal_async_stack_presence_test.dart
index 008447e..30e5679 100644
--- a/runtime/observatory/tests/service/causal_async_stack_presence_test.dart
+++ b/runtime/observatory/tests/service/causal_async_stack_presence_test.dart
@@ -10,29 +10,36 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_C = 19;
-const LINE_A = 25;
-const LINE_B = 31;
+const LINE_C = 23;
+const LINE_A = 29;
+const LINE_B = 35;
+
+const LINE_0 = 22;
+const LINE_1 = 28;
+const LINE_2 = 34;
 
 foobar() {
-  debugger();
+  debugger(); // LINE_0.
   print('foobar'); // LINE_C.
 }
 
 helper() async {
   await 0; // Yield. The rest will run async.
-  debugger();
+  debugger(); // LINE_1.
   print('helper'); // LINE_A.
   foobar();
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_2.
   helper(); // LINE_B.
 }
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_2),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
@@ -42,6 +49,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
@@ -50,6 +60,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
diff --git a/runtime/observatory/tests/service/causal_async_star_stack_contents_test.dart b/runtime/observatory/tests/service/causal_async_star_stack_contents_test.dart
index d9f4a85..2dd6d48 100644
--- a/runtime/observatory/tests/service/causal_async_star_stack_contents_test.dart
+++ b/runtime/observatory/tests/service/causal_async_star_stack_contents_test.dart
@@ -11,21 +11,25 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_A = 29;
-const LINE_B = 21;
-const LINE_C = 23;
+const LINE_A = 33;
+const LINE_B = 25;
+const LINE_C = 27;
+
+const LINE_0 = 24;
+const LINE_1 = 26;
+const LINE_2 = 32;
 
 foobar() async* {
   await 0; // force async gap
-  debugger();
+  debugger(); // LINE_0.
   yield 1; // LINE_B.
-  debugger();
+  debugger(); // LINE_1.
   yield 2; // LINE_C.
 }
 
 helper() async {
   await 0; // force async gap
-  debugger();
+  debugger(); // LINE_2.
   print('helper'); // LINE_A.
   await for (var i in foobar()) {
     print('helper $i');
@@ -38,6 +42,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_2),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
@@ -50,6 +57,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
@@ -64,6 +74,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
@@ -80,7 +93,7 @@
         await asyncStack[0].location.toUserString(), contains('.dart:$LINE_C'));
     expect(asyncStack[1].kind, equals(M.FrameKind.asyncSuspensionMarker));
     expect(asyncStack[2].toString(), contains('helper'));
-    expect(await asyncStack[2].location.toUserString(), contains('.dart:30'));
+    expect(await asyncStack[2].location.toUserString(), contains('.dart:34'));
     expect(asyncStack[3].kind, equals(M.FrameKind.asyncSuspensionMarker));
   },
 ];
diff --git a/runtime/observatory/tests/service/causal_async_star_stack_presence_test.dart b/runtime/observatory/tests/service/causal_async_star_stack_presence_test.dart
index 4015c42..1659f2f 100644
--- a/runtime/observatory/tests/service/causal_async_star_stack_presence_test.dart
+++ b/runtime/observatory/tests/service/causal_async_star_stack_presence_test.dart
@@ -10,19 +10,23 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_A = 26;
-const LINE_B = 19;
-const LINE_C = 21;
+const LINE_A = 30;
+const LINE_B = 23;
+const LINE_C = 25;
+
+const LINE_0 = 22;
+const LINE_1 = 24;
+const LINE_2 = 29;
 
 foobar() async* {
-  debugger();
+  debugger(); // LINE_0.
   yield 1; // LINE_B.
-  debugger();
+  debugger(); // LINE_1.
   yield 2; // LINE_C.
 }
 
 helper() async {
-  debugger();
+  debugger(); // LINE_2.
   print('helper'); // LINE_A.
   await for (var i in foobar()) {
     print('helper $i');
@@ -35,6 +39,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_2),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
@@ -43,6 +50,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
@@ -51,6 +61,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
diff --git a/runtime/observatory/tests/service/debugger_location_test.dart b/runtime/observatory/tests/service/debugger_location_test.dart
index fe66893..c88329c 100644
--- a/runtime/observatory/tests/service/debugger_location_test.dart
+++ b/runtime/observatory/tests/service/debugger_location_test.dart
@@ -10,15 +10,15 @@
 import 'dart:async';
 import 'dart:developer';
 
-const int LINE_A = 21;
+const int LINE_A = 20;
 const int LINE_B = 111;
 const int LINE_C = 11;
 
 void testFunction() {
   int i = 0;
   while (i == 0) {
-    debugger();
-    print('loop'); // Line A.
+    debugger(); // Line A
+    print('loop');
     print('loop');
   }
 }
diff --git a/runtime/observatory/tests/service/evaluate_class_type_parameters_test.dart b/runtime/observatory/tests/service/evaluate_class_type_parameters_test.dart
index 38b34fc..5394669 100644
--- a/runtime/observatory/tests/service/evaluate_class_type_parameters_test.dart
+++ b/runtime/observatory/tests/service/evaluate_class_type_parameters_test.dart
@@ -33,7 +33,7 @@
     var stack = await isolate.getStack();
     var topFrame = 0;
     expect(stack.type, equals('Stack'));
-    expect(await stack['frames'][topFrame].location.getLine(), 20);
+    expect(await stack['frames'][topFrame].location.getLine(), 19);
 
     Instance result = await isolate.evalFrame(topFrame, '"\$S"') as Instance;
     print(result);
@@ -46,7 +46,7 @@
     var stack = await isolate.getStack();
     var topFrame = 0;
     expect(stack.type, equals('Stack'));
-    expect(await stack['frames'][topFrame].location.getLine(), 14);
+    expect(await stack['frames'][topFrame].location.getLine(), 13);
 
     Instance result = await isolate.evalFrame(topFrame, '"\$T"') as Instance;
     print(result);
diff --git a/runtime/observatory/tests/service/evaluate_function_type_parameters_test.dart b/runtime/observatory/tests/service/evaluate_function_type_parameters_test.dart
index 1eb0f4f..1d53553 100644
--- a/runtime/observatory/tests/service/evaluate_function_type_parameters_test.dart
+++ b/runtime/observatory/tests/service/evaluate_function_type_parameters_test.dart
@@ -47,7 +47,7 @@
     var stack = await isolate.getStack();
     var topFrame = 0;
     expect(stack.type, equals('Stack'));
-    expect(await stack['frames'][topFrame].location.getLine(), 14);
+    expect(await stack['frames'][topFrame].location.getLine(), 12);
 
     Instance result =
         await isolate.evalFrame(topFrame, "S.toString()") as Instance;
@@ -61,7 +61,7 @@
     var stack = await isolate.getStack();
     var topFrame = 0;
     expect(stack.type, equals('Stack'));
-    expect(await stack['frames'][topFrame].location.getLine(), 16);
+    expect(await stack['frames'][topFrame].location.getLine(), 15);
 
     Instance result =
         await isolate.evalFrame(topFrame, "TBool.toString()") as Instance;
@@ -97,7 +97,7 @@
     var stack = await isolate.getStack();
     var topFrame = 0;
     expect(stack.type, equals('Stack'));
-    expect(await stack['frames'][topFrame].location.getLine(), 22);
+    expect(await stack['frames'][topFrame].location.getLine(), 21);
 
     Instance result =
         await isolate.evalFrame(topFrame, "S.toString()") as Instance;
@@ -111,7 +111,7 @@
     var stack = await isolate.getStack();
     var topFrame = 0;
     expect(stack.type, equals('Stack'));
-    expect(await stack['frames'][topFrame].location.getLine(), 30);
+    expect(await stack['frames'][topFrame].location.getLine(), 29);
 
     Instance result =
         await isolate.evalFrame(topFrame, "T.toString()") as Instance;
@@ -129,7 +129,7 @@
     var stack = await isolate.getStack();
     var topFrame = 0;
     expect(stack.type, equals('Stack'));
-    expect(await stack['frames'][topFrame].location.getLine(), 34);
+    expect(await stack['frames'][topFrame].location.getLine(), 33);
 
     Instance result =
         await isolate.evalFrame(topFrame, "T.toString()") as Instance;
diff --git a/runtime/observatory/tests/service/evaluate_in_async_activation_test.dart b/runtime/observatory/tests/service/evaluate_in_async_activation_test.dart
index 1c41188..7551b13 100644
--- a/runtime/observatory/tests/service/evaluate_in_async_activation_test.dart
+++ b/runtime/observatory/tests/service/evaluate_in_async_activation_test.dart
@@ -25,7 +25,7 @@
     var stack = await isolate.getStack();
     var topFrame = 0;
     expect(stack.type, equals('Stack'));
-    expect(await stack['frames'][topFrame].location.getLine(), 16);
+    expect(await stack['frames'][topFrame].location.getLine(), 15);
 
     Instance result = await isolate.evalFrame(topFrame, "x") as Instance;
     print(result);
@@ -38,7 +38,7 @@
     var stack = await isolate.getStack();
     var topFrame = 0;
     expect(stack.type, equals('Stack'));
-    expect(await stack['frames'][topFrame].location.getLine(), 18);
+    expect(await stack['frames'][topFrame].location.getLine(), 17);
 
     Instance result = await isolate.evalFrame(topFrame, "z") as Instance;
     print(result);
diff --git a/runtime/observatory/tests/service/evaluate_in_async_star_activation_test.dart b/runtime/observatory/tests/service/evaluate_in_async_star_activation_test.dart
index 6bb1a2f..b048f96 100644
--- a/runtime/observatory/tests/service/evaluate_in_async_star_activation_test.dart
+++ b/runtime/observatory/tests/service/evaluate_in_async_star_activation_test.dart
@@ -29,7 +29,7 @@
     var stack = await isolate.getStack();
     var topFrame = 0;
     expect(stack.type, equals('Stack'));
-    expect(await stack['frames'][topFrame].location.getLine(), 15);
+    expect(await stack['frames'][topFrame].location.getLine(), 14);
 
     Instance result = await isolate.evalFrame(topFrame, "x") as Instance;
     print(result);
@@ -42,7 +42,7 @@
     var stack = await isolate.getStack();
     var topFrame = 0;
     expect(stack.type, equals('Stack'));
-    expect(await stack['frames'][topFrame].location.getLine(), 18);
+    expect(await stack['frames'][topFrame].location.getLine(), 17);
 
     Instance result = await isolate.evalFrame(topFrame, "z") as Instance;
     print(result);
diff --git a/runtime/observatory/tests/service/evaluate_in_sync_star_activation_test.dart b/runtime/observatory/tests/service/evaluate_in_sync_star_activation_test.dart
index 6f4c3fd..1089d9a 100644
--- a/runtime/observatory/tests/service/evaluate_in_sync_star_activation_test.dart
+++ b/runtime/observatory/tests/service/evaluate_in_sync_star_activation_test.dart
@@ -29,7 +29,7 @@
     var stack = await isolate.getStack();
     var topFrame = 0;
     expect(stack.type, equals('Stack'));
-    expect(await stack['frames'][topFrame].location.getLine(), 15);
+    expect(await stack['frames'][topFrame].location.getLine(), 14);
 
     Instance result = await isolate.evalFrame(topFrame, "x") as Instance;
     print(result);
@@ -42,7 +42,7 @@
     var stack = await isolate.getStack();
     var topFrame = 0;
     expect(stack.type, equals('Stack'));
-    expect(await stack['frames'][topFrame].location.getLine(), 18);
+    expect(await stack['frames'][topFrame].location.getLine(), 17);
 
     Instance result = await isolate.evalFrame(topFrame, "z") as Instance;
     print(result);
diff --git a/runtime/observatory/tests/service/get_allocation_samples_test.dart b/runtime/observatory/tests/service/get_allocation_samples_test.dart
index 5ad524a..c06a01c 100644
--- a/runtime/observatory/tests/service/get_allocation_samples_test.dart
+++ b/runtime/observatory/tests/service/get_allocation_samples_test.dart
@@ -17,12 +17,11 @@
 }
 
 void test() {
+  final l = <Object>[];
   debugger();
   // Toggled on.
-  debugger();
-  debugger();
   // Allocation.
-  new Foo();
+  l.add(new Foo());
   debugger();
 }
 
@@ -44,10 +43,6 @@
 
   resumeIsolate,
   hasStoppedAtBreakpoint,
-  // Extra debugger stop, continue to allow the allocation stubs to be switched
-  // over. This is a bug but low priority.
-  resumeIsolate,
-  hasStoppedAtBreakpoint,
 
   // Allocation profile.
   (Isolate isolate) async {
diff --git a/runtime/observatory/tests/service/get_allocation_traces_test.dart b/runtime/observatory/tests/service/get_allocation_traces_test.dart
index f43e26a..72d7d69 100644
--- a/runtime/observatory/tests/service/get_allocation_traces_test.dart
+++ b/runtime/observatory/tests/service/get_allocation_traces_test.dart
@@ -23,24 +23,23 @@
 }
 
 void test() {
+  List l = <Object>[];
   debugger();
   // Toggled on for Foo.
-  debugger();
-  debugger();
   // Traced allocation.
-  Foo();
+  l.add(Foo());
   // Untraced allocation.
-  Bar();
+  l.add(Bar());
   // Toggled on for Bar.
   debugger();
-  debugger();
   // Traced allocation.
-  Bar();
+  l.add(Bar());
   debugger();
 }
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(27),
 
   // Initial.
   (Isolate isolate) async {
@@ -56,10 +55,7 @@
 
   resumeIsolate,
   hasStoppedAtBreakpoint,
-  // Extra debugger stop, continue to allow the allocation stubs to be switched
-  // over. This is a bug but low priority.
-  resumeIsolate,
-  hasStoppedAtBreakpoint,
+  stoppedAtLine(34),
 
   // Allocation profile.
   (Isolate isolate) async {
@@ -102,8 +98,6 @@
       expect(node, isNotNull);
     }
   },
-  resumeIsolate,
-  hasStoppedAtBreakpoint,
   (Isolate isolate) async {
     // Trace Bar.
     final barClass = (await getClassFromRootLib(isolate, 'Bar'))!;
@@ -116,10 +110,7 @@
 
   resumeIsolate,
   hasStoppedAtBreakpoint,
-  // Extra debugger stop, continue to allow the allocation stubs to be switched
-  // over. This is a bug but low priority.
-  resumeIsolate,
-  hasStoppedAtBreakpoint,
+  stoppedAtLine(37),
 
   (Isolate isolate) async {
     // Ensure the allocation of `Bar()` was recorded.
diff --git a/runtime/observatory/tests/service/get_stack_rpc_test.dart b/runtime/observatory/tests/service/get_stack_rpc_test.dart
index 1c7a6e2..cb7ce7866 100644
--- a/runtime/observatory/tests/service/get_stack_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_stack_rpc_test.dart
@@ -12,7 +12,7 @@
 import 'dart:developer' as developer;
 
 int counter = 0;
-const stoppedAtLine = 24;
+const stoppedAtLine = 23;
 var port = new isolate.RawReceivePort(msgHandler);
 
 // This name is used in a test below.
@@ -20,7 +20,7 @@
 
 void periodicTask(_) {
   port.sendPort.send(34);
-  developer.debugger(message: "fo", when: true); // We will be at the next line.
+  developer.debugger(message: "fo", when: true);
   counter++;
   if (counter % 300 == 0) {
     print('counter = $counter');
diff --git a/runtime/observatory/tests/service/issue_27238_test.dart b/runtime/observatory/tests/service/issue_27238_test.dart
index 60c7497..2b7d380 100644
--- a/runtime/observatory/tests/service/issue_27238_test.dart
+++ b/runtime/observatory/tests/service/issue_27238_test.dart
@@ -8,14 +8,16 @@
 import 'test_helper.dart';
 import 'dart:developer';
 
-const int LINE_A = 19;
-const int LINE_B = 22;
-const int LINE_C = 23;
-const int LINE_D = 25;
-const int LINE_E = 26;
+const int LINE_A = 21;
+const int LINE_B = 24;
+const int LINE_C = 25;
+const int LINE_D = 27;
+const int LINE_E = 28;
+
+const int LINE_0 = 20;
 
 testMain() async {
-  debugger();
+  debugger(); // LINE_0.
   Future future1 = new Future.value(); // LINE_A.
   Future future2 = new Future.value();
 
@@ -28,6 +30,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   smartNext,
   hasStoppedAtBreakpoint,
diff --git a/runtime/observatory/tests/service/issue_27287_test.dart b/runtime/observatory/tests/service/issue_27287_test.dart
index 872ad12..1ffe6ef 100644
--- a/runtime/observatory/tests/service/issue_27287_test.dart
+++ b/runtime/observatory/tests/service/issue_27287_test.dart
@@ -7,13 +7,15 @@
 import 'test_helper.dart';
 import 'dart:developer';
 
-const int LINE_A = 17;
-const int LINE_B = 18;
+const int LINE_A = 19;
+const int LINE_B = 20;
+
+const int LINE_0 = 18;
 
 var libVariable;
 
 testMain() {
-  debugger();
+  debugger(); // LINE_0
   print("Before"); // LINE_A
   libVariable = 0; // LINE_B
   print("and after");
@@ -21,6 +23,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   stepOver,
   // Check that debugger stops at assignment to top-level variable.
diff --git a/runtime/observatory/tests/service/parameters_in_scope_at_entry_test.dart b/runtime/observatory/tests/service/parameters_in_scope_at_entry_test.dart
index 48cacd2..82147c0 100644
--- a/runtime/observatory/tests/service/parameters_in_scope_at_entry_test.dart
+++ b/runtime/observatory/tests/service/parameters_in_scope_at_entry_test.dart
@@ -10,8 +10,11 @@
 
 import 'service_test_common.dart';
 
-const int LINE_A = 30;
-const int LINE_B = 34;
+const int LINE_A = 33;
+const int LINE_B = 37;
+
+const int LINE_0 = 32;
+const int LINE_1 = 36;
 
 foo(param) {
   return param;
@@ -26,16 +29,19 @@
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_0.
   foo("in-scope"); // Line A.
 
   var f = fooClosure();
-  debugger();
+  debugger(); // LINE_1.
   f("in-scope"); // Line B.
 }
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (isolate) => isolate.stepInto(),
   hasStoppedAtBreakpoint,
@@ -52,6 +58,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   (isolate) => isolate.stepInto(),
   hasStoppedAtBreakpoint,
diff --git a/runtime/observatory/tests/service/positive_token_pos_test.dart b/runtime/observatory/tests/service/positive_token_pos_test.dart
index 6ebfbae..76fe0c2 100644
--- a/runtime/observatory/tests/service/positive_token_pos_test.dart
+++ b/runtime/observatory/tests/service/positive_token_pos_test.dart
@@ -20,6 +20,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(17),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(18),
   stepInto,
   (Isolate isolate) async {
diff --git a/runtime/observatory/tests/service/rewind_optimized_out_test.dart b/runtime/observatory/tests/service/rewind_optimized_out_test.dart
index 21cf92a..7573b2a 100644
--- a/runtime/observatory/tests/service/rewind_optimized_out_test.dart
+++ b/runtime/observatory/tests/service/rewind_optimized_out_test.dart
@@ -8,10 +8,12 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-int LINE_A = 31;
-int LINE_B = 36;
-int LINE_C = 39;
-int LINE_D = 43;
+int LINE_A = 33;
+int LINE_B = 38;
+int LINE_C = 41;
+int LINE_D = 45;
+
+int LINE_0 = 31;
 
 int global = 0;
 
@@ -26,7 +28,7 @@
     print("caught $e");
   }
   if (global >= 100) {
-    debugger();
+    debugger(); // LINE_0.
   }
   global = global + 1; // Line A
   return sum;
@@ -46,6 +48,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (Isolate isolate) async {
     // We are at our breakpoint with global=100.
diff --git a/runtime/observatory/tests/service/rewind_test.dart b/runtime/observatory/tests/service/rewind_test.dart
index 5ec932d..055c96f 100644
--- a/runtime/observatory/tests/service/rewind_test.dart
+++ b/runtime/observatory/tests/service/rewind_test.dart
@@ -8,10 +8,12 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-int LINE_A = 31;
-int LINE_B = 36;
-int LINE_C = 39;
-int LINE_D = 43;
+int LINE_A = 33;
+int LINE_B = 38;
+int LINE_C = 41;
+int LINE_D = 45;
+
+int LINE_0 = 31;
 
 int global = 0;
 
@@ -26,7 +28,7 @@
     print("caught $e");
   }
   if (global >= 100) {
-    debugger();
+    debugger(); // LINE_0.
   }
   global = global + 1; // Line A
   return sum;
@@ -46,6 +48,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (Isolate isolate) async {
     // We are not able to rewind frame 0.
@@ -91,6 +96,9 @@
     expect(result['type'], equals('Success'));
   },
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (Isolate isolate) async {
     // global still is equal to 100.  We did not execute "global++".
@@ -117,6 +125,9 @@
     expect(result2['type'], equals('Success'));
   },
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (Isolate isolate) async {
     // We are at our breakpoint with global=100.
diff --git a/runtime/observatory/tests/service/set_library_debuggable_test.dart b/runtime/observatory/tests/service/set_library_debuggable_test.dart
index adac834..cc670db 100644
--- a/runtime/observatory/tests/service/set_library_debuggable_test.dart
+++ b/runtime/observatory/tests/service/set_library_debuggable_test.dart
@@ -10,12 +10,14 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_A = 19;
-const LINE_B = 20;
-const LINE_C = 21;
+const LINE_A = 21;
+const LINE_B = 22;
+const LINE_C = 23;
+
+const LINE_0 = 20;
 
 testMain() async {
-  debugger();
+  debugger(); // LINE_0.
   print('hi'); // LINE_A.
   print('yep'); // LINE_B.
   print('zoo'); // LINE_C.
@@ -32,6 +34,8 @@
     expect(dartCore.debuggable, equals(true));
   },
   stoppedInFunction('testMain'),
+  stoppedAtLine(LINE_0),
+  stepOver,
   stoppedAtLine(LINE_A),
   stepInto,
   stoppedInFunction('print'),
diff --git a/runtime/observatory/tests/service/step_into_async_no_await_test.dart b/runtime/observatory/tests/service/step_into_async_no_await_test.dart
index 23cf4df..07ab838 100644
--- a/runtime/observatory/tests/service/step_into_async_no_await_test.dart
+++ b/runtime/observatory/tests/service/step_into_async_no_await_test.dart
@@ -7,7 +7,9 @@
 import 'dart:developer';
 import 'service_test_common.dart';
 
-const int LINE_A = 20;
+const int LINE_A = 22;
+
+const int LINE_0 = 21;
 
 // :async_op will not be captured in this function because it never needs to
 // reschedule it.
@@ -22,6 +24,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (isolate) => isolate.stepInto(),
   hasStoppedAtBreakpoint,
diff --git a/runtime/observatory/tests/service/step_over_await_test.dart b/runtime/observatory/tests/service/step_over_await_test.dart
index e8103b2..7474aa9 100644
--- a/runtime/observatory/tests/service/step_over_await_test.dart
+++ b/runtime/observatory/tests/service/step_over_await_test.dart
@@ -13,12 +13,13 @@
 import 'package:observatory/service_io.dart';
 import 'package:test/test.dart';
 
-const int LINE_A = 22;
-const int LINE_B = 24;
+const int LINE_0 = 22;
+const int LINE_A = 23;
+const int LINE_B = 25;
 
 // This tests the asyncNext command.
 asyncFunction() async {
-  debugger();
+  debugger(); // LINE_0
   print('a'); // LINE_A
   await new Future.delayed(new Duration(seconds: 2));
   print('b'); // LINE_B
@@ -30,6 +31,9 @@
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   stepOver, // At new Duration().
   stepOver, // At new Future.delayed().
diff --git a/runtime/observatory_2/tests/service_2/causal_async_stack_contents_test.dart b/runtime/observatory_2/tests/service_2/causal_async_stack_contents_test.dart
index 4a89449..5aa548a 100644
--- a/runtime/observatory_2/tests/service_2/causal_async_stack_contents_test.dart
+++ b/runtime/observatory_2/tests/service_2/causal_async_stack_contents_test.dart
@@ -10,29 +10,36 @@
 import 'service_test_common.dart';
 import 'test_helper.dart';
 
-const LINE_C = 19;
-const LINE_A = 25;
-const LINE_B = 31;
+const LINE_C = 23;
+const LINE_A = 29;
+const LINE_B = 35;
+
+const LINE_0 = 22;
+const LINE_1 = 28;
+const LINE_2 = 34;
 
 foobar() {
-  debugger();
+  debugger(); // LINE_0.
   print('foobar'); // LINE_C.
 }
 
 helper() async {
   await 0; // force async gap
-  debugger();
+  debugger(); // LINE_1.
   print('helper'); // LINE_A.
   foobar();
 }
 
 testMain() {
-  debugger();
+  debugger(); // LINE_2.
   helper(); // LINE_B.
 }
 
 var tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_2),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
@@ -41,6 +48,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_1),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
@@ -52,6 +62,9 @@
   },
   resumeIsolate,
   hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_0),
+  stepOver,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_C),
   (Isolate isolate) async {
     ServiceMap stack = await isolate.getStack();
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
index 075e8b0..7ce8ff5 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
@@ -3461,6 +3461,12 @@
       // on top-of-stack.
       instructions += Drop();
     }
+
+    // After reaching debugger(), we automatically do one single-step.
+    // Ensure this doesn't cause us to exit the current scope.
+    if (recognized_kind == MethodRecognizer::kDebugger) {
+      instructions += DebugStepCheck(position);
+    }
   }
 
   return instructions;
diff --git a/runtime/vm/compiler/recognized_methods_list.h b/runtime/vm/compiler/recognized_methods_list.h
index f493e11..efc20ce 100644
--- a/runtime/vm/compiler/recognized_methods_list.h
+++ b/runtime/vm/compiler/recognized_methods_list.h
@@ -329,6 +329,7 @@
   V(_Mint, get:hashCode, Mint_hashCode, 0x75d240f2)                            \
   V(_Double, get:hashCode, Double_hashCode, 0x75d240f2)                        \
   V(::, _memCopy, MemCopy, 0x2740bc36)                                         \
+  V(::, debugger, Debugger, 0xf0b98af4)                                        \
 
 // List of intrinsics:
 // (class-name, function-name, intrinsification method, fingerprint).
diff --git a/sdk/lib/_internal/vm/lib/developer.dart b/sdk/lib/_internal/vm/lib/developer.dart
index 47ab1c3..c28a48d 100644
--- a/sdk/lib/_internal/vm/lib/developer.dart
+++ b/sdk/lib/_internal/vm/lib/developer.dart
@@ -18,6 +18,7 @@
 part "timeline.dart";
 
 @patch
+@pragma("vm:recognized", "other")
 @pragma("vm:external-name", "Developer_debugger")
 external bool debugger({bool when = true, String? message});