This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [llgs] Send process output asynchronously in non-stop mode
ClosedPublic

Authored by mgorny on Jun 29 2022, 12:55 PM.

Details

Summary

Introduce a new %Stdio notification category and use it to send process
output asynchronously when running in non-stop mode. This is an LLDB
extension since GDB does not use the 'O' packet for process output,
just for replies to 'qRcmd' packets.

Using the async notification mechanism implies that only the first
output packet is sent immediately to the client. The client needs
to request subsequent notifications (if any) using the new vStdio packet
(that works pretty much like vStopped for the Stop notification queue).

The packet handler in lldb-server tests is updated to handle the async
stdio packets in addition to the regular O packets. However, due
to the implications noted above, it can only handle the first output
packet sent by the server. Subsequent packets need to be explicitly
requested via vStdio.

Sponsored by: The FreeBSD Foundation

Diff Detail

Event Timeline

mgorny created this revision.Jun 29 2022, 12:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2022, 12:55 PM
Herald added a subscriber: arichardson. · View Herald Transcript
mgorny requested review of this revision.Jun 29 2022, 12:55 PM
labath accepted this revision.Jun 30 2022, 1:23 AM
labath added inline comments.
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
3915

this could use formatting

This revision is now accepted and ready to land.Jun 30 2022, 1:23 AM
mgorny marked an inline comment as done.Jun 30 2022, 1:25 AM
mgorny added inline comments.
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
3915

Yes, indeed. I've left it like this for clang-format, then forgotten to run it. Sorry.

mgorny marked an inline comment as done.Jun 30 2022, 1:43 AM
This revision was landed with ongoing or failed builds.Jul 15 2022, 8:27 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2022, 8:27 AM