[vm,debugger] Do not stop at hoisted variable declarations when stepping through patterns

TEST=pkg/vm_service/test/step_through_patterns_test.dart
Issue: https://github.com/dart-lang/sdk/issues/51812
Issue: https://github.com/dart-lang/sdk/issues/49755

Change-Id: Ieb2e6f49c613c7543e7e76119cefbc4d8f9ae3de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291840
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This commit is contained in:
Alexander Markov 2023-03-30 18:42:48 +00:00 committed by Commit Queue
parent 3da80be140
commit 103a098d64
2 changed files with 1 additions and 5 deletions

View file

@ -43,15 +43,11 @@ List<String> expected = [
"$FILE:${LINE + 0}:46", // on 'shape' after 'switch'
"$FILE:${LINE + 1}:20", // on ':'
"$FILE:${LINE + 2}:20", // on ':'
"$FILE:${LINE + 1}:26", // on 'l' right after 'var'
"$FILE:${LINE + 1}:7", // on 'Square'
"$FILE:${LINE + 2}:26", // on 'r' right after 'var'
"$FILE:${LINE + 2}:7", // on 'Circle'
"$FILE:${LINE + 2}:26", // on 'r' right after 'var'
"$FILE:${LINE + 2}:36", // on '>='
"$FILE:${LINE + 3}:26", // on 'l' right after 'var'
"$FILE:${LINE + 1}:7", // on 'Square'
"$FILE:${LINE + 4}:26", // on 'r' right after 'var'
"$FILE:${LINE + 2}:7", // on 'Circle'
"$FILE:${LINE + 4}:26", // on 'r' right after 'var'
"$FILE:${LINE + 4}:36", // on '<'

View file

@ -5802,7 +5802,7 @@ Fragment StreamingFlowGraphBuilder::BuildVariableDeclaration(
? helper.equals_position_
: helper.position_;
if (position != nullptr) *position = helper.position_;
if (NeedsDebugStepCheck(stack(), debug_position)) {
if (NeedsDebugStepCheck(stack(), debug_position) && !helper.IsHoisted()) {
instructions = DebugStepCheck(debug_position) + instructions;
}
instructions += StoreLocal(helper.position_, variable);