aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
diff options
context:
space:
mode:
authoreleviant <56861949+eleviant@users.noreply.github.com>2025-06-25 13:38:37 +0200
committerGitHub <noreply@github.com>2025-06-25 13:38:37 +0200
commitc941bee75d252ac9a9787dd0594959d890ddb073 (patch)
tree5fe5f945c5e0a23f58afbb6f4f756a8460295b7e /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
parent97fdc237ddda7565c7c902cc4fc764f73e70686b (diff)
downloadllvm-c941bee75d252ac9a9787dd0594959d890ddb073.zip
llvm-c941bee75d252ac9a9787dd0594959d890ddb073.tar.gz
llvm-c941bee75d252ac9a9787dd0594959d890ddb073.tar.bz2
[lldb] Fix qEcho message handling. (#145675)
This fixes issues found in e066f35c6981c720e3a7e5883efc40c861b3b7, which was later reverted. The problem was with "k" message which was sent with sync_on_timeout flag set to true, so lldb was waiting for response, which is currently not being sent by lldb-server. Not waiting for response at all seems to be not a solution, because on MAC OS X lldb waits for response from "k" to gracefully kill inferior.
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index adbf06b..7d2bd45 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -406,7 +406,7 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() {
m_supports_qXfer_memory_map_read = eLazyBoolYes;
else if (x == "qXfer:siginfo:read+")
m_supports_qXfer_siginfo_read = eLazyBoolYes;
- else if (x == "qEcho")
+ else if (x == "qEcho+")
m_supports_qEcho = eLazyBoolYes;
else if (x == "QPassSignals+")
m_supports_QPassSignals = eLazyBoolYes;
@@ -4358,7 +4358,9 @@ llvm::Expected<int> GDBRemoteCommunicationClient::KillProcess(lldb::pid_t pid) {
StringExtractorGDBRemote response;
GDBRemoteCommunication::ScopedTimeout(*this, seconds(3));
- if (SendPacketAndWaitForResponse("k", response, GetPacketTimeout()) !=
+ // LLDB server typically sends no response for "k", so we shouldn't try
+ // to sync on timeout.
+ if (SendPacketAndWaitForResponse("k", response, GetPacketTimeout(), false) !=
PacketResult::Success)
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"failed to send k packet");