aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
diff options
context:
space:
mode:
authorRobert O'Callahan <rocallahan@google.com>2025-01-22 20:37:17 +1300
committerGitHub <noreply@github.com>2025-01-22 08:37:17 +0100
commitb7b9ccf44988edf49886743ae5c3cf4184db211f (patch)
tree23a42c4f7287081feb4b958f53c1a7f9f49e9d08 /lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
parent830bd0e8f263c6efcfd37f38cc621b0476582b83 (diff)
downloadllvm-b7b9ccf44988edf49886743ae5c3cf4184db211f.zip
llvm-b7b9ccf44988edf49886743ae5c3cf4184db211f.tar.gz
llvm-b7b9ccf44988edf49886743ae5c3cf4184db211f.tar.bz2
[lldb] Implement basic support for reverse-continue (#112079)
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.
Diffstat (limited to 'lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp')
-rw-r--r--lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
index d2111ce..3360bd9 100644
--- a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
+++ b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
@@ -182,10 +182,15 @@ void ScriptedProcess::DidResume() {
m_pid = GetInterface().GetProcessID();
}
-Status ScriptedProcess::DoResume() {
+Status ScriptedProcess::DoResume(RunDirection direction) {
LLDB_LOGF(GetLog(LLDBLog::Process), "ScriptedProcess::%s resuming process", __FUNCTION__);
- return GetInterface().Resume();
+ if (direction == RunDirection::eRunForward)
+ return GetInterface().Resume();
+ // FIXME: Pipe reverse continue through Scripted Processes
+ return Status::FromErrorStringWithFormatv(
+ "error: {0} does not support reverse execution of processes",
+ GetPluginName());
}
Status ScriptedProcess::DoAttach(const ProcessAttachInfo &attach_info) {