1long g_watch_me_read = 1;
2long g_watch_me_write = 2;
3long g_temp = 3;
4
5void watch_read() {
6 g_temp = g_watch_me_read;
7}
8
9void watch_write() { g_watch_me_write = g_temp++; }
10
11void read_watchpoint_testing() {
12 watch_read(); // break here for read watchpoints
13 g_temp = g_watch_me_read;
14}
15
16void watch_breakpoint_testing() {
17 watch_write(); // break here for modify watchpoints
18 g_watch_me_write = g_temp;
19}
20
21int main() {
22 read_watchpoint_testing();
23 watch_breakpoint_testing();
24 return 0;
25}
26

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