• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <stdio.h>
2 #include <stdint.h>
3 
4 int32_t global = 0; // Watchpoint variable declaration.
5 
modify(int32_t & var)6 static void modify(int32_t &var) {
7     ++var;
8 }
9 
main(int argc,char ** argv)10 int main(int argc, char** argv) {
11     int local = 0;
12     printf("&global=%p\n", &global);
13     printf("about to write to 'global'...\n"); // Set break point at this line.
14                                                // When stopped, watch 'global',
15                                                // for the condition "global == 5".
16     for (int i = 0; i < 10; ++i)
17         modify(global);
18 
19     printf("global=%d\n", global);
20 }
21