| 1 | #include <stdio.h> |
| 2 | |
| 3 | // This simple program is to test the lldb Python API related to thread. |
| 4 | |
| 5 | char my_char = 'u'; |
| 6 | int my_int = 0; |
| 7 | |
| 8 | void |
| 9 | call_me(bool should_spin) { |
| 10 | int counter = 0; |
| 11 | if (should_spin) { |
| 12 | while (1) |
| 13 | counter++; // Set a breakpoint in call_me |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | int main (int argc, char const *argv[]) |
| 18 | { |
| 19 | call_me(should_spin: false); |
| 20 | for (int i = 0; i < 3; ++i) { |
| 21 | printf(format: "my_char='%c'\n" , my_char); |
| 22 | ++my_char; |
| 23 | } |
| 24 | |
| 25 | printf(format: "after the loop: my_char='%c'\n" , my_char); // 'my_char' should print out as 'x'. |
| 26 | |
| 27 | return 0; // Set break point at this line and check variable 'my_char'. |
| 28 | } |
| 29 | |