summaryrefslogtreecommitdiff
path: root/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/control/dex_step_function.cpp
blob: 900e10b64a96ebc339008c5029e53166ef0f8fec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Purpose:
//    \DexStepFunction smoke test. Only steps in a and c should be logged.
//
// This command is only implemented for debuggers with DAP support.
// UNSUPPORTED: system-windows
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run -v --binary %t -- %s 2>&1 | FileCheck %s

int g = 0;
int c(int) {
  ++g;
  return 0;
}

int b(int) {
  ++g;
  return c(g);
}

int a(int) {
  ++g;
  return b(g);
}

int main() {
  return a(g);
}

// DexStepFunction('a')
// DexStepFunction('c')

// CHECK:      ## BEGIN ##
// CHECK-NEXT:.   [0, "a(int)", "{{.*}}dex_step_function.cpp", 22, 3, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
// CHECK-NEXT:.   [1, "a(int)", "{{.*}}dex_step_function.cpp", 23, 12, "StopReason.STEP", "StepKind.VERTICAL_FORWARD", []]
// CHECK-NEXT:.   .   .   [2, "c(int)", "{{.*}}dex_step_function.cpp", 12, 3, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
// CHECK-NEXT:.   .   .   [3, "c(int)", "{{.*}}dex_step_function.cpp", 13, 3, "StopReason.STEP", "StepKind.VERTICAL_FORWARD", []]
// CHECK-NEXT:.   [4, "a(int)", "{{.*}}dex_step_function.cpp", 23, 3, "StopReason.STEP", "StepKind.HORIZONTAL_BACKWARD", []]
// CHECK-NEXT: ## END (5 steps) ##