diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -809,8 +809,12 @@ // 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(); diff --git a/lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py b/lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py --- a/lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py +++ b/lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py @@ -101,15 +101,12 @@ self.reset_test_sequence() # continue and expect fork - procinfo_regex = "[$]pid:([0-9a-f]+);.*" - fork_regex = "[$]T.*;{}:p([0-9a-f]+)[.]([0-9a-f]+).*".format(variant) + fork_regex = ("[$]T[0-9a-f]{{2}}thread:p([0-9a-f]+)[.][0-9a-f]+;.*" + "{}:p([0-9a-f]+)[.]([0-9a-f]+).*".format(variant)) self.test_sequence.add_log_lines([ - "read packet: $qProcessInfo#00", - {"direction": "send", "regex": procinfo_regex, - "capture": {1: "parent_pid"}}, "read packet: $c#00", {"direction": "send", "regex": fork_regex, - "capture": {1: "pid", 2: "tid"}}, + "capture": {1: "parent_pid", 2: "pid", 3: "tid"}}, ], True) ret = self.expect_gdbremote_sequence() parent_pid, pid, tid = (int(ret[x], 16) for x