Skip to content

Commit

Permalink
[lldb] [llgs] Include process id in W/X stop reasons
Browse files Browse the repository at this point in the history
Include the process identifier in W/X stop reasons when multiprocess
extensions are enabled.

The LLDB client does not support process identifiers there at the moment
but it parses packets in such a way that their presence does not cause
any problems.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D127191
  • Loading branch information
mgorny committed Jun 20, 2022
1 parent 7cd1c01 commit e4d6ed5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ GDBRemoteCommunicationServerLLGS::SendWResponse(

StreamGDBRemote response;
response.Format("{0:g}", *wait_status);
if (bool(m_extensions_supported & NativeProcessProtocol::Extension::multiprocess))
response.Format(";process:{0:x-}", process->GetID());
return SendPacketNoLock(response.GetString());
}

Expand Down
6 changes: 3 additions & 3 deletions lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_fork(self):
# resume the parent
self.test_sequence.add_log_lines([
"read packet: $c#00",
{"direction": "send", "regex": r"[$]W00#.*"},
{"direction": "send", "regex": r"[$]W00;process:[0-9a-f]+#.*"},
], True)
self.expect_gdbremote_sequence()

Expand All @@ -87,7 +87,7 @@ def test_vfork(self):
"read packet: $c#00",
{"direction": "send", "regex": r"[$]T.*vforkdone.*"},
"read packet: $c#00",
{"direction": "send", "regex": r"[$]W00#.*"},
{"direction": "send", "regex": r"[$]W00;process:[0-9a-f]+#.*"},
], True)
self.expect_gdbremote_sequence()

Expand Down Expand Up @@ -135,7 +135,7 @@ def fork_and_follow_test(self, variant):
# resume the child
self.test_sequence.add_log_lines([
"read packet: $c#00",
{"direction": "send", "regex": r"[$]W00#.*"},
{"direction": "send", "regex": r"[$]W00;process:[0-9a-f]+#.*"},
], True)
self.expect_gdbremote_sequence()

Expand Down

0 comments on commit e4d6ed5

Please sign in to comment.