brintos

brintos / llvm-project-archived public Read only

0
0
Text · 628 B · d4b0ad2 Raw
29 lines · cpp
1#include <stdio.h>2 3// This simple program is to test the lldb Python API related to thread.4 5char my_char = 'u';6int my_int = 0;7 8void9call_me(bool should_spin) {10    int counter = 0;11    if (should_spin) {12        while (1)13            counter++;  // Set a breakpoint in call_me14     }15}16 17int main (int argc, char const *argv[])18{19    call_me(false);20    for (int i = 0; i < 3; ++i) {21        printf("my_char='%c'\n", my_char);22        ++my_char;23    }24 25    printf("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