| 1 | int false_condition() { return 0; } |
| 2 | |
| 3 | int *g_watched_var_ptr; |
| 4 | |
| 5 | static void start_recording() {} |
| 6 | |
| 7 | static void trigger_watchpoint() { *g_watched_var_ptr = 2; } |
| 8 | |
| 9 | static void trigger_breakpoint() {} |
| 10 | |
| 11 | static void stop_recording() {} |
| 12 | |
| 13 | int main() { |
| 14 | // The watched memory location is on the stack because |
| 15 | // that's what our reverse execution engine records and |
| 16 | // replays. |
| 17 | int watched_var = 1; |
| 18 | g_watched_var_ptr = &watched_var; |
| 19 | |
| 20 | start_recording(); |
| 21 | trigger_watchpoint(); |
| 22 | trigger_breakpoint(); |
| 23 | stop_recording(); |
| 24 | return 0; |
| 25 | } |
| 26 | |