aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
diff options
context:
space:
mode:
authorMichał Górny <mgorny@moritz.systems>2022-06-06 18:17:59 +0200
committerMichał Górny <mgorny@moritz.systems>2022-06-20 13:37:23 +0200
commitac570fbb8521a31a1931cc070e1b259fcac6a30f (patch)
tree835909ec78773beedffed55d175a0811c976f532 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
parente4d6ed58a86edc339ae124b74668b600f2a0f6d5 (diff)
downloadllvm-ac570fbb8521a31a1931cc070e1b259fcac6a30f.zip
llvm-ac570fbb8521a31a1931cc070e1b259fcac6a30f.tar.gz
llvm-ac570fbb8521a31a1931cc070e1b259fcac6a30f.tar.bz2
[lldb] [llgs] Include process ID in stop responses
Include the process identifier in the `T` stop responses when multiprocess extension is enabled (i.e. prepend it to the thread identifier). Use the exposed identifier to simplify the fork-and-follow tests. The LLDB client accounts for the possible PID since the multiprocess extension support was added in b601c6719226fb83c43dae62a581e5ee08bfb169. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.llvm.org/D127192
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 2b491f50..e173f04 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -809,8 +809,12 @@ GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread(
// Print the signal number.
response.PutHex8(signum & 0xff);
- // Include the tid.
- response.Printf("thread:%" PRIx64 ";", tid);
+ // Include the (pid and) tid.
+ response.PutCString("thread:");
+ if (bool(m_extensions_supported &
+ NativeProcessProtocol::Extension::multiprocess))
+ response.Format("p{0:x-}.", m_current_process->GetID());
+ response.Format("{0:x-};", tid);
// Include the thread name if there is one.
const std::string thread_name = thread->GetName();