Skip to content

Commit e4d6ed5

Browse files
committed
[lldb] [llgs] Include process id in W/X stop reasons
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
1 parent 7cd1c01 commit e4d6ed5

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ GDBRemoteCommunicationServerLLGS::SendWResponse(
474474

475475
StreamGDBRemote response;
476476
response.Format("{0:g}", *wait_status);
477+
if (bool(m_extensions_supported & NativeProcessProtocol::Extension::multiprocess))
478+
response.Format(";process:{0:x-}", process->GetID());
477479
return SendPacketNoLock(response.GetString());
478480
}
479481

lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def test_fork(self):
7474
# resume the parent
7575
self.test_sequence.add_log_lines([
7676
"read packet: $c#00",
77-
{"direction": "send", "regex": r"[$]W00#.*"},
77+
{"direction": "send", "regex": r"[$]W00;process:[0-9a-f]+#.*"},
7878
], True)
7979
self.expect_gdbremote_sequence()
8080

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

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

0 commit comments

Comments
 (0)