File tree 4 files changed +51
-0
lines changed
observatory/tests/service
4 files changed +51
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ library breakpoint_in_parts_class;
6
+
7
+ import 'package:observatory_test_package/has_part.dart' as hasPart;
8
+ import 'test_helper.dart' ;
9
+ import 'service_test_common.dart' ;
10
+
11
+ const int LINE = 8 ;
12
+ const String breakpointFile =
13
+ "package:observatory_test_package/the_part_2.dart" ;
14
+ const String shortFile = "the_part_2.dart" ;
15
+
16
+ code () {
17
+ hasPart.bar ();
18
+ }
19
+
20
+ List <String > stops = [];
21
+
22
+ List <String > expected = [
23
+ "$shortFile :${LINE + 0 }:3" , // on 'print'
24
+ "$shortFile :${LINE + 1 }:1" // on class ending '}'
25
+ ];
26
+
27
+ var tests = < IsolateTest > [
28
+ hasPausedAtStart,
29
+ setBreakpointAtUriAndLine (breakpointFile, LINE ),
30
+ runStepThroughProgramRecordingStops (stops),
31
+ checkRecordedStops (stops, expected)
32
+ ];
33
+
34
+ main (args) {
35
+ runIsolateTestsSynchronous (args, tests,
36
+ testeeConcurrent: code, pause_on_start: true , pause_on_exit: true );
37
+ }
Original file line number Diff line number Diff line change 5
5
library has_part;
6
6
7
7
part 'the_part.dart' ;
8
+ part 'the_part_2.dart' ;
8
9
9
10
main () {
10
11
Foo10 foo = new Foo10 ("Foo!" );
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ part of has_part;
6
+
7
+ void bar () {
8
+ print ('Should break here' );
9
+ }
Original file line number Diff line number Diff line change @@ -3014,6 +3014,10 @@ BreakpointLocation* Debugger::BreakpointLocationAtLineCol(
3014
3014
bool is_package = script_url.StartsWith (Symbols::PackageScheme ());
3015
3015
for (intptr_t i = 0 ; i < libs.Length (); i++) {
3016
3016
lib ^= libs.At (i);
3017
+ // Ensure that all top-level members are loaded so their scripts
3018
+ // are available for look up. When certain script only contains
3019
+ // top level functions, scripts could still be loaded correctly.
3020
+ lib.EnsureTopLevelClassIsFinalized ();
3017
3021
script = lib.LookupScript (script_url, !is_package);
3018
3022
if (!script.IsNull ()) {
3019
3023
scripts.Add (script);
You can’t perform that action at this time.
0 commit comments