aboutsummaryrefslogtreecommitdiffstats
path: root/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h')
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h66
1 files changed, 35 insertions, 31 deletions
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h b/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
index 54f69e8caac6..ea294ffcef26 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
+++ b/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,