diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-07-31 20:47:44 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-07-31 20:47:44 +0000 |
| commit | 970a57907ed34e4f5b502ec071f2266937c40cad (patch) | |
| tree | 7c4f9438a0de7683944d1bd84e0fcec8145a03ad | |
| parent | 70402bfc46e032ef4f826bf1cc984cf18bd8f63d (diff) | |
| download | bcm5719-llvm-970a57907ed34e4f5b502ec071f2266937c40cad.tar.gz bcm5719-llvm-970a57907ed34e4f5b502ec071f2266937c40cad.zip | |
[GDBRemote] Reflow comments and improve docs.
Improved the GDB client base documentation while I was reading through
it. Looks like it got messed up during the automatic comment reflow a
while ago.
llvm-svn: 367481
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h index 54f69e8caac..ea294ffcef2 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h @@ -24,12 +24,10 @@ public: virtual void HandleAsyncMisc(llvm::StringRef data) = 0; virtual void HandleStopReply() = 0; - // ========================================================================= /// Process asynchronously-received structured data. /// /// \param[in] data /// The complete data packet, expected to start with JSON-async. - // ========================================================================= virtual void HandleAsyncStructuredDataPacket(llvm::StringRef data) = 0; }; @@ -83,42 +81,48 @@ protected: virtual void OnRunPacketSent(bool first); private: - // Variables handling synchronization between the Continue thread and any - // other threads - // wishing to send packets over the connection. Either the continue thread has - // control over - // the connection (m_is_running == true) or the connection is free for an - // arbitrary number of - // other senders to take which indicate their interest by incrementing - // m_async_count. - // Semantics of individual states: - // - m_continue_packet == false, m_async_count == 0: connection is free - // - m_continue_packet == true, m_async_count == 0: only continue thread is - // present - // - m_continue_packet == true, m_async_count > 0: continue thread has - // control, async threads - // should interrupt it and wait for it to set m_continue_packet to false - // - m_continue_packet == false, m_async_count > 0: async threads have - // control, continue - // thread needs to wait for them to finish (m_async_count goes down to 0). + /// Variables handling synchronization between the Continue thread and any + /// other threads wishing to send packets over the connection. Either the + /// continue thread has control over the connection (m_is_running == true) or + /// the connection is free for an arbitrary number of other senders to take + /// which indicate their interest by incrementing m_async_count. + /// + /// Semantics of individual states: + /// + /// - m_continue_packet == false, m_async_count == 0: + /// connection is free + /// - m_continue_packet == true, m_async_count == 0: + /// only continue thread is present + /// - m_continue_packet == true, m_async_count > 0: + /// continue thread has control, async threads should interrupt it and wait + /// for it to set m_continue_packet to false + /// - m_continue_packet == false, m_async_count > 0: + /// async threads have control, continue thread needs to wait for them to + /// finish (m_async_count goes down to 0). + /// @{ std::mutex m_mutex; std::condition_variable m_cv; - // Packet with which to resume after an async interrupt. Can be changed by an - // async thread - // e.g. to inject a signal. + + /// Packet with which to resume after an async interrupt. Can be changed by + /// an async thread e.g. to inject a signal. std::string m_continue_packet; - // When was the interrupt packet sent. Used to make sure we time out if the - // stub does not - // respond to interrupt requests. + + /// When was the interrupt packet sent. Used to make sure we time out if the + /// stub does not respond to interrupt requests. std::chrono::time_point<std::chrono::steady_clock> m_interrupt_time; + + /// Number of threads interested in sending. uint32_t m_async_count; + + /// Whether the continue thread has control. bool m_is_running; - bool m_should_stop; // Whether we should resume after a stop. - // end of continue thread synchronization block - // This handles the synchronization between individual async threads. For now - // they just use a - // simple mutex. + /// Whether we should resume after a stop. + bool m_should_stop; + /// @} + + /// This handles the synchronization between individual async threads. For + /// now they just use a simple mutex. std::recursive_mutex m_async_mutex; bool ShouldStop(const UnixSignals &signals, |

