This reverts commit a774de807e.
This is the same changes as last time, plus:
* We load the binary into the target object so that on Windows, we can
resolve the locations of the functions.
* We now assert that each required breakpoint has at least 1 location,
to prevent an issue like that in the future.
* We are less strict about the unsupported error message, because it
prints "error: windows" on Windows instead of "error: gdb-remote".
26 lines
533 B
C
26 lines
533 B
C
int false_condition() { return 0; }
|
|
|
|
int *g_watched_var_ptr;
|
|
|
|
static void start_recording() {}
|
|
|
|
static void trigger_watchpoint() { *g_watched_var_ptr = 2; }
|
|
|
|
static void trigger_breakpoint() {}
|
|
|
|
static void stop_recording() {}
|
|
|
|
int main() {
|
|
// The watched memory location is on the stack because
|
|
// that's what our reverse execution engine records and
|
|
// replays.
|
|
int watched_var = 1;
|
|
g_watched_var_ptr = &watched_var;
|
|
|
|
start_recording();
|
|
trigger_watchpoint();
|
|
trigger_breakpoint();
|
|
stop_recording();
|
|
return 0;
|
|
}
|