diff options
author | Pavel Labath <labath@google.com> | 2015-11-27 13:33:29 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2015-11-27 13:33:29 +0000 |
commit | abadc2217225d0cfe09a8960ba8cd0722c5104e3 (patch) | |
tree | 0b4d7da1c4abeb0839131b811d3580bb86290af5 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h | |
parent | 97f4d2c47fc3f807efc6908fbe31c396715c64bd (diff) | |
download | bcm5719-llvm-abadc2217225d0cfe09a8960ba8cd0722c5104e3.tar.gz bcm5719-llvm-abadc2217225d0cfe09a8960ba8cd0722c5104e3.zip |
[LLGS] Don't forward I/O when process is stopped
Summary:
This makes sure we do not attempt to send output over the gdb-remote protocol when the client is
not expecting it (i.e., after sending the stop-reply packet). Normally, this should not happen
(the process cannot generate output when it is stopped), but due to the fact that pty
communication is asynchronous in the linux kernel (llvm.org/pr25652), we may sometimes get this
output too late. Instead, we just hold the output, and send it next time we resume. This is not
ideal, but at least it makes sure we do not violate the remote protocol. Given that this happens
extremely rarely it's not worth trying to work around it with sleeps or something like that.
I also remove the m_stdio_communication_mutex, as all of LLGS is now single-threaded anyway.
Reviewers: tberghammer, ovyalov
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D15019
llvm-svn: 254200
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h index fe3f718274e..f16057781dd 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h @@ -122,7 +122,6 @@ protected: Mutex m_debugged_process_mutex; NativeProcessProtocolSP m_debugged_process_sp; - Mutex m_stdio_communication_mutex; // Protects m_stdio_communication and m_stdio_handle_up Communication m_stdio_communication; MainLoop::ReadHandleUP m_stdio_handle_up; @@ -298,6 +297,9 @@ private: SendProcessOutput (); void + StartSTDIOForwarding(); + + void StopSTDIOForwarding(); //------------------------------------------------------------------ |