1 | #include <stdio.h> |
2 | |
3 | // This simple program is to test the lldb Python API related to events. |
4 | |
5 | int a(int); |
6 | int b(int); |
7 | int c(int); |
8 | |
9 | int a(int val) |
10 | { |
11 | if (val <= 1) |
12 | return b(val); |
13 | else if (val >= 3) |
14 | return c(val); |
15 | |
16 | return val; |
17 | } |
18 | |
19 | int b(int val) |
20 | { |
21 | return c(val); |
22 | } |
23 | |
24 | int c(int val) |
25 | { |
26 | return val + 3; // Find the line number of function "c" here. |
27 | } |
28 | |
29 | int main (int argc, char const *argv[]) |
30 | { |
31 | int A1 = a(val: 1); // a(1) -> b(1) -> c(1) |
32 | printf(format: "a(1) returns %d\n" , A1); |
33 | |
34 | int B2 = b(val: 2); // b(2) -> c(2) |
35 | printf(format: "b(2) returns %d\n" , B2); |
36 | |
37 | int A3 = a(val: 3); // a(3) -> c(3) |
38 | printf(format: "a(3) returns %d\n" , A3); |
39 | |
40 | return 0; |
41 | } |
42 | |