aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2025-01-30 16:45:36 +0000
committerGitHub <noreply@github.com>2025-01-30 16:45:36 +0000
commita774de807e56c1147d4630bfec3110c11d41776e (patch)
tree4ff5d75de0671dd0bb71d9a90414a22adac86b89 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parentc39fba209ce655cf5997878b0bf794da269f008a (diff)
downloadllvm-a774de807e56c1147d4630bfec3110c11d41776e.zip
llvm-a774de807e56c1147d4630bfec3110c11d41776e.tar.gz
llvm-a774de807e56c1147d4630bfec3110c11d41776e.tar.bz2
Revert "Reland "[lldb] Implement basic support for reverse-continue" (#123906)"" (#125091)
Reverts llvm/llvm-project#123945 Has failed on the Windows on Arm buildbot: https://lab.llvm.org/buildbot/#/builders/141/builds/5865 ``` ******************** Unresolved Tests (2): lldb-api :: functionalities/reverse-execution/TestReverseContinueBreakpoints.py lldb-api :: functionalities/reverse-execution/TestReverseContinueWatchpoints.py ******************** Failed Tests (1): lldb-api :: functionalities/reverse-execution/TestReverseContinueNotSupported.py ``` Reverting while I reproduce locally.
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp98
1 files changed, 13 insertions, 85 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index fa511af..538c868 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -169,8 +169,6 @@ public:
}
};
-std::chrono::seconds ResumeTimeout() { return std::chrono::seconds(5); }
-
} // namespace
static PluginProperties &GetGlobalPluginProperties() {
@@ -1182,16 +1180,10 @@ Status ProcessGDBRemote::WillResume() {
return Status();
}
-bool ProcessGDBRemote::SupportsReverseDirection() {
- return m_gdb_comm.GetReverseStepSupported() ||
- m_gdb_comm.GetReverseContinueSupported();
-}
-
-Status ProcessGDBRemote::DoResume(RunDirection direction) {
+Status ProcessGDBRemote::DoResume() {
Status error;
Log *log = GetLog(GDBRLog::Process);
- LLDB_LOGF(log, "ProcessGDBRemote::Resume(%s)",
- direction == RunDirection::eRunForward ? "" : "reverse");
+ LLDB_LOGF(log, "ProcessGDBRemote::Resume()");
ListenerSP listener_sp(
Listener::MakeListener("gdb-remote.resume-packet-sent"));
@@ -1205,24 +1197,12 @@ Status ProcessGDBRemote::DoResume(RunDirection direction) {
StreamString continue_packet;
bool continue_packet_error = false;
- // Number of threads continuing with "c", i.e. continuing without a signal
- // to deliver.
- const size_t num_continue_c_tids = m_continue_c_tids.size();
- // Number of threads continuing with "C", i.e. continuing with a signal to
- // deliver.
- const size_t num_continue_C_tids = m_continue_C_tids.size();
- // Number of threads continuing with "s", i.e. single-stepping.
- const size_t num_continue_s_tids = m_continue_s_tids.size();
- // Number of threads continuing with "S", i.e. single-stepping with a signal
- // to deliver.
- const size_t num_continue_S_tids = m_continue_S_tids.size();
- if (direction == RunDirection::eRunForward &&
- m_gdb_comm.HasAnyVContSupport()) {
+ if (m_gdb_comm.HasAnyVContSupport()) {
std::string pid_prefix;
if (m_gdb_comm.GetMultiprocessSupported())
pid_prefix = llvm::formatv("p{0:x-}.", GetID());
- if (num_continue_c_tids == num_threads ||
+ if (m_continue_c_tids.size() == num_threads ||
(m_continue_c_tids.empty() && m_continue_C_tids.empty() &&
m_continue_s_tids.empty() && m_continue_S_tids.empty())) {
// All threads are continuing
@@ -1285,10 +1265,14 @@ Status ProcessGDBRemote::DoResume(RunDirection direction) {
} else
continue_packet_error = true;
- if (direction == RunDirection::eRunForward && continue_packet_error) {
+ if (continue_packet_error) {
// Either no vCont support, or we tried to use part of the vCont packet
// that wasn't supported by the remote GDB server. We need to try and
- // make a simple packet that can do our continue.
+ // make a simple packet that can do our continue
+ const size_t num_continue_c_tids = m_continue_c_tids.size();
+ const size_t num_continue_C_tids = m_continue_C_tids.size();
+ const size_t num_continue_s_tids = m_continue_s_tids.size();
+ const size_t num_continue_S_tids = m_continue_S_tids.size();
if (num_continue_c_tids > 0) {
if (num_continue_c_tids == num_threads) {
// All threads are resuming...
@@ -1379,59 +1363,9 @@ Status ProcessGDBRemote::DoResume(RunDirection direction) {
}
}
- if (direction == RunDirection::eRunReverse) {
- if (num_continue_s_tids > 0 || num_continue_S_tids > 0) {
- if (!m_gdb_comm.GetReverseStepSupported()) {
- LLDB_LOGF(log, "ProcessGDBRemote::DoResume: target does not "
- "support reverse-stepping");
- return Status::FromErrorString(
- "target does not support reverse-stepping");
- }
-
- if (num_continue_S_tids > 0) {
- LLDB_LOGF(
- log,
- "ProcessGDBRemote::DoResume: Signals not supported in reverse");
- return Status::FromErrorString(
- "can't deliver signals while running in reverse");
- }
-
- if (num_continue_s_tids > 1) {
- LLDB_LOGF(log, "ProcessGDBRemote::DoResume: can't step multiple "
- "threads in reverse");
- return Status::FromErrorString(
- "can't step multiple threads while reverse-stepping");
- }
-
- m_gdb_comm.SetCurrentThreadForRun(m_continue_s_tids.front());
- continue_packet.PutCString("bs");
- } else {
- if (!m_gdb_comm.GetReverseContinueSupported()) {
- LLDB_LOGF(log, "ProcessGDBRemote::DoResume: target does not "
- "support reverse-continue");
- return Status::FromErrorString(
- "target does not support reverse-continue");
- }
-
- if (num_continue_C_tids > 0) {
- LLDB_LOGF(
- log,
- "ProcessGDBRemote::DoResume: Signals not supported in reverse");
- return Status::FromErrorString(
- "can't deliver signals while running in reverse");
- }
-
- // All threads continue whether requested or not ---
- // we can't change how threads ran in the past.
- continue_packet.PutCString("bc");
- }
-
- continue_packet_error = false;
- }
-
if (continue_packet_error) {
- return Status::FromErrorString(
- "can't make continue packet for this resume");
+ error =
+ Status::FromErrorString("can't make continue packet for this resume");
} else {
EventSP event_sp;
if (!m_async_thread.IsJoinable()) {
@@ -1446,7 +1380,7 @@ Status ProcessGDBRemote::DoResume(RunDirection direction) {
std::make_shared<EventDataBytes>(continue_packet.GetString());
m_async_broadcaster.BroadcastEvent(eBroadcastBitAsyncContinue, data_sp);
- if (!listener_sp->GetEvent(event_sp, ResumeTimeout())) {
+ if (!listener_sp->GetEvent(event_sp, std::chrono::seconds(5))) {
error = Status::FromErrorString("Resume timed out.");
LLDB_LOGF(log, "ProcessGDBRemote::DoResume: Resume timed out.");
} else if (event_sp->BroadcasterIs(&m_async_broadcaster)) {
@@ -1929,10 +1863,6 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
thread_sp->SetStopInfo(StopInfo::CreateStopReasonWithException(
*thread_sp, description.c_str()));
handled = true;
- } else if (reason == "history boundary") {
- thread_sp->SetStopInfo(StopInfo::CreateStopReasonHistoryBoundary(
- *thread_sp, description.c_str()));
- handled = true;
} else if (reason == "exec") {
did_exec = true;
thread_sp->SetStopInfo(
@@ -2388,8 +2318,6 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
description = std::string(ostr.GetString());
} else if (key.compare("swbreak") == 0 || key.compare("hwbreak") == 0) {
reason = "breakpoint";
- } else if (key.compare("replaylog") == 0) {
- reason = "history boundary";
} else if (key.compare("library") == 0) {
auto error = LoadModules();
if (error) {