| 1 |
// Purpose: |
| 2 |
// \DexStepFunction smoke test. Only steps in a and c should be logged. |
| 3 |
// |
| 4 |
// This command is only implemented for debuggers with DAP support. |
| 5 |
// UNSUPPORTED: system-windows |
| 6 |
// |
| 7 |
// RUN: %dexter_regression_test_cxx_build %s -o %t |
| 8 |
// RUN: %dexter_regression_test_run -v --binary %t -- %s 2>&1 | FileCheck %s |
| 9 |
|
| 10 |
int g = 0; |
| 11 |
int c(int) { |
| 12 |
++g; |
| 13 |
return 0; |
| 14 |
} |
| 15 |
|
| 16 |
int b(int) { |
| 17 |
++g; |
| 18 |
return c(g); |
| 19 |
} |
| 20 |
|
| 21 |
int a(int) { |
| 22 |
++g; |
| 23 |
return b(g); |
| 24 |
} |
| 25 |
|
| 26 |
int main() { |
| 27 |
return a(g); |
| 28 |
} |
| 29 |
|
| 30 |
// DexStepFunction('a') |
| 31 |
// DexStepFunction('c') |
| 32 |
|
| 33 |
// CHECK: ## BEGIN ## |
| 34 |
// CHECK-NEXT:. [0, "a(int)", "{{.*}}dex_step_function.cpp", 22, 3, "StopReason.BREAKPOINT", "StepKind.FUNC", []] |
| 35 |
// CHECK-NEXT:. [1, "a(int)", "{{.*}}dex_step_function.cpp", 23, 12, "StopReason.STEP", "StepKind.VERTICAL_FORWARD", []] |
| 36 |
// CHECK-NEXT:. . . [2, "c(int)", "{{.*}}dex_step_function.cpp", 12, 3, "StopReason.BREAKPOINT", "StepKind.FUNC", []] |
| 37 |
// CHECK-NEXT:. . . [3, "c(int)", "{{.*}}dex_step_function.cpp", 13, 3, "StopReason.STEP", "StepKind.VERTICAL_FORWARD", []] |
| 38 |
// CHECK-NEXT:. [4, "a(int)", "{{.*}}dex_step_function.cpp", 23, 3, "StopReason.STEP", "StepKind.HORIZONTAL_BACKWARD", []] |
| 39 |
// CHECK-NEXT: ## END (5 steps) ## |