forked from OSchip/llvm-project
[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 b601c67192
.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D127192
This commit is contained in:
parent
e4d6ed58a8
commit
ac570fbb85
|
@ -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();
|
||||
|
|
|
@ -101,15 +101,12 @@ class TestGdbRemoteFork(gdbremote_testcase.GdbRemoteTestCaseBase):
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue