xref: /llvm-project/lldb/test/API/commands/expression/unwind_expression/main.cpp (revision 99451b4453688a94c6014cac233d371ab4cc342d)
1*99451b44SJordan Rupprecht static int static_value = 0;
2*99451b44SJordan Rupprecht 
3*99451b44SJordan Rupprecht int
a_function_to_call()4*99451b44SJordan Rupprecht a_function_to_call()
5*99451b44SJordan Rupprecht {
6*99451b44SJordan Rupprecht     static_value++; // Stop inside the function here.
7*99451b44SJordan Rupprecht     return static_value;
8*99451b44SJordan Rupprecht }
9*99451b44SJordan Rupprecht 
second_function(int x)10*99451b44SJordan Rupprecht int second_function(int x){
11*99451b44SJordan Rupprecht   for(int i=0; i<10; ++i) {
12*99451b44SJordan Rupprecht     a_function_to_call();
13*99451b44SJordan Rupprecht   }
14*99451b44SJordan Rupprecht   return x;
15*99451b44SJordan Rupprecht }
16*99451b44SJordan Rupprecht 
main(int argc,char const * argv[])17*99451b44SJordan Rupprecht int main (int argc, char const *argv[])
18*99451b44SJordan Rupprecht {
19*99451b44SJordan Rupprecht     a_function_to_call();  // Set a breakpoint here to get started
20*99451b44SJordan Rupprecht     second_function(1);
21*99451b44SJordan Rupprecht     return 0;
22*99451b44SJordan Rupprecht }
23