1#include <stdio.h>
2#include <stdint.h>
3
4int32_t global = 10; // Watchpoint variable declaration.
5
6int 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'.
11 global = 20;
12 local += argc;
13 ++local; // Set 2nd break point for disable_then_enable test case.
14 printf(format: "local: %d\n", local);
15 printf(format: "global=%d\n", global);
16}
17

source code of lldb/test/API/commands/watchpoints/watchpoint_commands/main.c