Skip to content

Conversation

sgrekhov
Copy link
Contributor

@sgrekhov sgrekhov commented Oct 20, 2025

Some clarification about what we are checking in this PR.

The tests consist form 5 tests defined in tests array. Below in the description each of these tests.

  1. The firsts one is hasStoppedAtBreakpoint is simple copy-paste from https://github.com/dart-lang/sdk/blob/main/pkg/vm_service/test/dot_shorthands_test.dart

  2. Test the interaction between expression evaluation and declaring constructor invocation. This test simply checks that an expression involving a declaring constructor invocation is evaluated and that the result contains the correct values.

  3. Test the interaction of breakpoints with declaring constructors. This test checks that execution stops at a breakpoint on the expression that contains a declaring constructor invocation. A breakpoint is added to LINE_X in the test code, and then we check the line and column of the breakpoint position.

  4. runStepIntoThroughProgramRecordingStops. The most interesting test here is the one that requires explanation.

This test emulates stopping at a breakpoint and then performing a "step into" operation, recording each step.

Here, we depend on the previous test (#3). In that test, we added and then removed several breakpoints, but the one on LINE_E was not removed. As a result, the service contains a single breakpoint on LINE_E, and we are debugging testeeMain while performing "step into" actions.

It’s hard to predict exactly where on class C1(var int v1, final int v2); the debugger will stop, but I suppose that this code is analogous to

class C {
  int v1;
  final int v2;
  C(this.v1, this.v2); // LINE_A
}

var c = C(1, 2);    // LINE_B

Here debugger stops at:

  '$shortFile:$LINE_B:9', // on '='
  '$shortFile:$LINE_B:11', // on 'C'
  '$shortFile:$LINE_A:17', // on 'v2'
  '$shortFile:$LINE_A:39', // on ';'

And therefore in case of the declaring constructor I expect the same stops.

  1. checkRecordedStops(stops, expected),. Check the stops written in the previous test.

Please review.

@sgrekhov sgrekhov requested review from eernstg and nshahan October 20, 2025 09:00
const LINE_I = 68;
// AUTOGENERATED END

class C1(var int v1, final int v2); // LINE_A
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When stopped at this breakpoint, do we expect to see any variables in scope and would they be named v1 and v2?

The new scoping of these constructors has me curious. It might be worth testing in another set of tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants