9#ifndef LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECLIENTBASE_H
10#define LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECLIENTBASE_H
14#include <condition_variable>
17namespace process_gdb_remote {
40 bool SendAsyncSignal(
int signo, std::chrono::seconds interrupt_timeout);
42 bool Interrupt(std::chrono::seconds interrupt_timeout);
46 llvm::StringRef payload, std::chrono::seconds interrupt_timeout,
59 std::chrono::seconds interrupt_timeout = std::chrono::seconds(0));
64 llvm::function_ref<
void(llvm::StringRef)> output_callback);
68 std::chrono::seconds interrupt_timeout,
69 llvm::function_ref<
void(llvm::StringRef)> output_callback);
80 std::chrono::seconds interrupt_timeout = std::chrono::seconds(0));
An event broadcasting class.
GDBRemoteClientBase & m_comm
GDBRemoteClientBase & m_comm
bool DidInterrupt() const
void SyncWithContinueThread()
std::unique_lock< std::recursive_mutex > m_async_lock
std::chrono::seconds m_interrupt_timeout
std::recursive_mutex m_async_mutex
This handles the synchronization between individual async threads.
bool SendAsyncSignal(int signo, std::chrono::seconds interrupt_timeout)
std::string m_continue_packet
Packet with which to resume after an async interrupt.
PacketResult SendPacketAndWaitForResponse(llvm::StringRef payload, StringExtractorGDBRemote &response, std::chrono::seconds interrupt_timeout=std::chrono::seconds(0))
uint32_t m_async_count
Number of threads interested in sending.
bool Interrupt(std::chrono::seconds interrupt_timeout)
PacketResult SendPacketAndReceiveResponseWithOutputSupport(llvm::StringRef payload, StringExtractorGDBRemote &response, std::chrono::seconds interrupt_timeout, llvm::function_ref< void(llvm::StringRef)> output_callback)
bool ShouldStop(const UnixSignals &signals, StringExtractorGDBRemote &response)
std::mutex m_mutex
Variables handling synchronization between the Continue thread and any other threads wishing to send ...
std::chrono::time_point< std::chrono::steady_clock > m_interrupt_endpoint
When was the interrupt packet sent.
@ eBroadcastBitRunPacketSent
PacketResult SendPacketAndWaitForResponseNoLock(llvm::StringRef payload, StringExtractorGDBRemote &response)
bool m_is_running
Whether the continue thread has control.
PacketResult ReadPacketWithOutputSupport(StringExtractorGDBRemote &response, Timeout< std::micro > timeout, bool sync_on_timeout, llvm::function_ref< void(llvm::StringRef)> output_callback)
bool m_should_stop
Whether we should resume after a stop.
lldb::StateType SendContinuePacketAndWaitForResponse(ContinueDelegate &delegate, const UnixSignals &signals, llvm::StringRef payload, std::chrono::seconds interrupt_timeout, StringExtractorGDBRemote &response)
std::condition_variable m_cv
virtual void OnRunPacketSent(bool first)
A class that represents a running process on the host machine.
StateType
Process and Thread States.
virtual ~ContinueDelegate()
virtual void HandleStopReply()=0
virtual void HandleAsyncMisc(llvm::StringRef data)=0
virtual void HandleAsyncStructuredDataPacket(llvm::StringRef data)=0
Process asynchronously-received structured data.
virtual void HandleAsyncStdout(llvm::StringRef out)=0