| 1 | #include <stdio.h> |
|---|---|
| 2 | #include <stdint.h> |
| 3 | |
| 4 | int32_t global = 10; // Watchpoint variable declaration. |
| 5 | |
| 6 | int main(int argc, char** argv) { |
| 7 | int local = 0; |
| 8 | printf(format: "&global=%p\n", &global); |
| 9 | printf(format: "about to write to 'global'...\n"); // Set break point at this line. |
| 10 | // When stopped, watch 'global' for read&write. |
| 11 | global = 20; |
| 12 | local += argc; |
| 13 | ++local; |
| 14 | printf(format: "local: %d\n", local); |
| 15 | printf(format: "global=%d\n", global); |
| 16 | } |
| 17 |
