1 #include <stdio.h>
2
3 // This simple program is to test the lldb Python API related to frames.
4
5 int a(int, char);
6 int b(int, char);
7 int c(int, char);
8
a(int val,char ch)9 int a(int val, char ch)
10 {
11 int my_val = val;
12 char my_ch = ch;
13 printf("a(val=%d, ch='%c')\n", val, ch);
14 if (val <= 1)
15 return b(val+1, ch+1);
16 else if (val >= 3)
17 return c(val+1, ch+1);
18
19 return val;
20 }
21
b(int val,char ch)22 int b(int val, char ch)
23 {
24 int my_val = val;
25 char my_ch = ch;
26 printf("b(val=%d, ch='%c')\n", val, ch);
27 return c(val+1, ch+1);
28 }
29
c(int val,char ch)30 int c(int val, char ch)
31 {
32 int my_val = val;
33 char my_ch = ch;
34 printf("c(val=%d, ch='%c')\n", val, ch);
35 return val + 3 + ch;
36 }
37
main(int argc,char const * argv[])38 int main (int argc, char const *argv[])
39 {
40 int A1 = a(1, 'A'); // a(1, 'A') -> b(2, 'B') -> c(3, 'C')
41 printf("a(1, 'A') returns %d\n", A1);
42
43 int B2 = b(2, 'B'); // b(2, 'B') -> c(3, 'C')
44 printf("b(2, 'B') returns %d\n", B2);
45
46 int A3 = a(3, 'A'); // a(3, 'A') -> c(4, 'B')
47 printf("a(3, 'A') returns %d\n", A3);
48
49 return 0;
50 }
51