brintos

brintos / llvm-project-archived public Read only

0
0
Text · 498 B · 09dd1f7 Raw
26 lines · c
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 watchpoints13  g_temp = g_watch_me_read;14}15 16void watch_breakpoint_testing() {17  watch_write(); // break here for modify watchpoints18  g_watch_me_write = g_temp;19}20 21int main() {22  read_watchpoint_testing();23  watch_breakpoint_testing();24  return 0;25}26