This commit adds support for a `SBProcess::ContinueInDirection()` API. A user-accessible command for this will follow in a later commit. This feature depends on a gdbserver implementation (e.g. `rr`) providing support for the `bc` and `bs` packets. `lldb-server` does not support those packets, and there is no plan to change that. For testing purposes, this commit adds a Python implementation of *very limited* record-and-reverse-execute functionality, implemented as a proxy between lldb and lldb-server in `lldbreverse.py`. This should not (and in practice cannot) be used for anything except testing. The tests here are quite minimal but we test that simple breakpoints and watchpoints work as expected during reverse execution, and that conditional breakpoints and watchpoints work when the condition calls a function that must be executed in the forward direction.
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;
|
|
}
|