aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
diff options
context:
space:
mode:
authorMichał Górny <mgorny@moritz.systems>2022-06-29 21:48:10 +0200
committerMichał Górny <mgorny@moritz.systems>2022-07-15 17:20:39 +0200
commit1903f358bcc74fd96c65f0d1deba577c63238c86 (patch)
tree6e05de7b758bf8db603c9c180ccedf1b28b189e9 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
parentb9f5b02fd071d494f828c3c9c2b25c671a457928 (diff)
downloadllvm-1903f358bcc74fd96c65f0d1deba577c63238c86.zip
llvm-1903f358bcc74fd96c65f0d1deba577c63238c86.tar.gz
llvm-1903f358bcc74fd96c65f0d1deba577c63238c86.tar.bz2
[lldb] [llgs] Send process output asynchronously in non-stop mode
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 Differential Revision: https://reviews.llvm.org/D128849
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
index 47e8a78..3d67032 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
@@ -117,6 +117,7 @@ protected:
bool m_thread_suffix_supported = false;
bool m_list_threads_in_stop_reply = false;
bool m_non_stop = false;
+ std::deque<std::string> m_stdio_notification_queue;
std::deque<std::string> m_stop_notification_queue;
NativeProcessProtocol::Extension m_extensions_supported = {};
@@ -247,6 +248,10 @@ protected:
PacketResult Handle_QNonStop(StringExtractorGDBRemote &packet);
+ PacketResult HandleNotificationAck(std::deque<std::string> &queue);
+
+ PacketResult Handle_vStdio(StringExtractorGDBRemote &packet);
+
PacketResult Handle_vStopped(StringExtractorGDBRemote &packet);
PacketResult Handle_vCtrlC(StringExtractorGDBRemote &packet);