aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
diff options
context:
space:
mode:
authorRobert O'Callahan <robert@ocallahan.org>2024-10-11 09:01:47 +1300
committerGitHub <noreply@github.com>2024-10-10 13:01:47 -0700
commitd5e1de6da96c1ab3b8cae68447e8ed3696a7006e (patch)
treeb9f51773b031f21c8cb9502c7de1879e8436d5b5 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
parent29e192a0bfbc75fa66498d3b1c1d1329009f1dd2 (diff)
downloadllvm-d5e1de6da96c1ab3b8cae68447e8ed3696a7006e.zip
llvm-d5e1de6da96c1ab3b8cae68447e8ed3696a7006e.tar.gz
llvm-d5e1de6da96c1ab3b8cae68447e8ed3696a7006e.tar.bz2
[lldb] Implement basic support for reverse-continue (#99736)
This commit only adds support for the `SBProcess::ReverseContinue()` 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. So, for testing purposes, `lldbreverse.py` wraps `lldb-server` with a Python implementation of *very limited* record-and-replay functionality for use by *tests only*. The majority of this PR is test infrastructure (about 700 of the 950 lines added).
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index e42526c..fc792a4 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -199,6 +199,20 @@ uint64_t GDBRemoteCommunicationClient::GetRemoteMaxPacketSize() {
return m_max_packet_size;
}
+bool GDBRemoteCommunicationClient::GetReverseContinueSupported() {
+ if (m_supports_reverse_continue == eLazyBoolCalculate) {
+ GetRemoteQSupported();
+ }
+ return m_supports_reverse_continue == eLazyBoolYes;
+}
+
+bool GDBRemoteCommunicationClient::GetReverseStepSupported() {
+ if (m_supports_reverse_step == eLazyBoolCalculate) {
+ GetRemoteQSupported();
+ }
+ return m_supports_reverse_step == eLazyBoolYes;
+}
+
bool GDBRemoteCommunicationClient::QueryNoAckModeSupported() {
if (m_supports_not_sending_acks == eLazyBoolCalculate) {
m_send_acks = true;
@@ -295,6 +309,8 @@ void GDBRemoteCommunicationClient::ResetDiscoverableSettings(bool did_exec) {
m_supports_qXfer_siginfo_read = eLazyBoolCalculate;
m_supports_augmented_libraries_svr4_read = eLazyBoolCalculate;
m_uses_native_signals = eLazyBoolCalculate;
+ m_supports_reverse_continue = eLazyBoolCalculate;
+ m_supports_reverse_step = eLazyBoolCalculate;
m_supports_qProcessInfoPID = true;
m_supports_qfProcessInfo = true;
m_supports_qUserName = true;
@@ -348,6 +364,8 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() {
m_supports_memory_tagging = eLazyBoolNo;
m_supports_qSaveCore = eLazyBoolNo;
m_uses_native_signals = eLazyBoolNo;
+ m_supports_reverse_continue = eLazyBoolNo;
+ m_supports_reverse_step = eLazyBoolNo;
m_max_packet_size = UINT64_MAX; // It's supposed to always be there, but if
// not, we assume no limit
@@ -401,6 +419,10 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() {
m_supports_qSaveCore = eLazyBoolYes;
else if (x == "native-signals+")
m_uses_native_signals = eLazyBoolYes;
+ else if (x == "ReverseContinue+")
+ m_supports_reverse_continue = eLazyBoolYes;
+ else if (x == "ReverseStep+")
+ m_supports_reverse_step = eLazyBoolYes;
// Look for a list of compressions in the features list e.g.
// qXfer:features:read+;PacketSize=20000;qEcho+;SupportedCompressions=zlib-
// deflate,lzma