Files
clang-p2996/lldb/test/API/functionalities/reverse-execution/main.c
David Spickett 7e66cf74fb Reland "[lldb] Implement basic support for reverse-continue" (#125242)
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".
2025-01-31 15:56:33 +00:00

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;
}