Skip to content

Commit 3ec7b89

Browse files
authored
[Dexter] Only increment step index if we record the step (#156832)
Prior to this patch we incremented step_index every time the debugger stopped. Now that some stops are not recorded, we should only increment the step_index for those that are. This should make the `-v` output more consistent between platforms and debuggers.
1 parent 88effbf commit 3ec7b89

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ConditionalController.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ def _run_debugger_custom(self, cmdline):
268268
step_info = self.debugger.get_step_info(self._watches, self._step_index)
269269
backtrace = None
270270
if step_info.current_frame:
271-
self._step_index += 1
272271
backtrace = [f.function for f in step_info.frames]
273272

274273
record_step = False
@@ -369,6 +368,7 @@ def _run_debugger_custom(self, cmdline):
369368
step_function_backtraces.pop()
370369

371370
if record_step and step_info.current_frame:
371+
self._step_index += 1
372372
# Record the step.
373373
update_step_watches(
374374
step_info, self._watches, self.step_collection.commands

cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/control/dex-continue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ int main() {
5959
// CHECK-NEXT: . . . [4, "c(int)", "{{.*}}dex-continue.cpp", 19, 3, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
6060
// CHECK-NEXT: . . . [5, "c(int)", "{{.*}}dex-continue.cpp", 20, 3, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
6161
// CHECK-NEXT: . [6, "a(int)", "{{.*}}dex-continue.cpp", 33, 3, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
62-
// CHECK-NEXT: . [8, "f()", "{{.*}}dex-continue.cpp", 38, 3, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
63-
// CHECK-NEXT: . [9, "f()", "{{.*}}dex-continue.cpp", 39, 1, "StopReason.STEP", "StepKind.VERTICAL_FORWARD", []]
62+
// CHECK-NEXT: . [7, "f()", "{{.*}}dex-continue.cpp", 38, 3, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
63+
// CHECK-NEXT: . [8, "f()", "{{.*}}dex-continue.cpp", 39, 1, "StopReason.STEP", "StepKind.VERTICAL_FORWARD", []]
6464
// CHECK-NEXT: ## END (9 steps) ##

cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/control/dex_step_function.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ int main() {
3535
// CHECK-NEXT:. [1, "a(int)", "{{.*}}dex_step_function.cpp", 23, 12, "StopReason.STEP", "StepKind.VERTICAL_FORWARD", []]
3636
// CHECK-NEXT:. . . [2, "c(int)", "{{.*}}dex_step_function.cpp", 12, 3, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
3737
// CHECK-NEXT:. . . [3, "c(int)", "{{.*}}dex_step_function.cpp", 13, 3, "StopReason.STEP", "StepKind.VERTICAL_FORWARD", []]
38-
// CHECK-NEXT:. [6, "a(int)", "{{.*}}dex_step_function.cpp", 23, 3, "StopReason.STEP", "StepKind.HORIZONTAL_BACKWARD", []]
38+
// CHECK-NEXT:. [4, "a(int)", "{{.*}}dex_step_function.cpp", 23, 3, "StopReason.STEP", "StepKind.HORIZONTAL_BACKWARD", []]
3939
// CHECK-NEXT: ## END (5 steps) ##

0 commit comments

Comments
 (0)