LLDB  mainline
Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
lldb_private::process_gdb_remote::GDBRemoteClientBase Class Reference

#include <GDBRemoteClientBase.h>

Inheritance diagram for lldb_private::process_gdb_remote::GDBRemoteClientBase:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::process_gdb_remote::GDBRemoteClientBase:
Collaboration graph
[legend]

Classes

struct  ContinueDelegate
 
class  ContinueLock
 
class  Lock
 

Public Member Functions

 GDBRemoteClientBase (const char *comm_name, const char *listener_name)
 
bool SendAsyncSignal (int signo)
 
bool Interrupt ()
 
lldb::StateType SendContinuePacketAndWaitForResponse (ContinueDelegate &delegate, const UnixSignals &signals, llvm::StringRef payload, StringExtractorGDBRemote &response)
 
PacketResult SendPacketAndWaitForResponse (llvm::StringRef payload, StringExtractorGDBRemote &response, bool send_async)
 
PacketResult SendPacketAndReceiveResponseWithOutputSupport (llvm::StringRef payload, StringExtractorGDBRemote &response, bool send_async, llvm::function_ref< void(llvm::StringRef)> output_callback)
 
bool SendvContPacket (llvm::StringRef payload, StringExtractorGDBRemote &response)
 
- Public Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteCommunication
 GDBRemoteCommunication (const char *comm_name, const char *listener_name)
 
 ~GDBRemoteCommunication () override
 
PacketResult GetAck ()
 
size_t SendAck ()
 
size_t SendNack ()
 
char CalculcateChecksum (llvm::StringRef payload)
 
PacketType CheckForPacket (const uint8_t *src, size_t src_len, StringExtractorGDBRemote &packet)
 
bool GetSendAcks ()
 
std::chrono::seconds SetPacketTimeout (std::chrono::seconds packet_timeout)
 
std::chrono::seconds GetPacketTimeout () const
 
Status StartDebugserverProcess (const char *url, Platform *platform, ProcessLaunchInfo &launch_info, uint16_t *port, const Args *inferior_args, int pass_comm_fd)
 
void DumpHistory (Stream &strm)
 
void SetPacketRecorder (repro::PacketRecorder *recorder)
 
- Public Member Functions inherited from lldb_private::Communication
 FLAGS_ANONYMOUS_ENUM ()
 
 Communication (const char *broadcaster_name)
 Construct the Communication object with the specified name for the Broadcaster that this object inherits from. More...
 
 ~Communication () override
 Destructor. More...
 
void Clear ()
 
lldb::ConnectionStatus Connect (const char *url, Status *error_ptr)
 Connect using the current connection by passing url to its connect function. More...
 
lldb::ConnectionStatus Disconnect (Status *error_ptr=nullptr)
 Disconnect the communications connection if one is currently connected. More...
 
bool IsConnected () const
 Check if the connection is valid. More...
 
bool HasConnection () const
 
lldb_private::ConnectionGetConnection ()
 
size_t Read (void *dst, size_t dst_len, const Timeout< std::micro > &timeout, lldb::ConnectionStatus &status, Status *error_ptr)
 Read bytes from the current connection. More...
 
size_t Write (const void *src, size_t src_len, lldb::ConnectionStatus &status, Status *error_ptr)
 The actual write function that attempts to write to the communications protocol. More...
 
void SetConnection (std::unique_ptr< Connection > connection)
 Sets the connection that it to be used by this class. More...
 
virtual bool StartReadThread (Status *error_ptr=nullptr)
 Starts a read thread whose sole purpose it to read bytes from the current connection. More...
 
virtual bool StopReadThread (Status *error_ptr=nullptr)
 Stops the read thread by cancelling it. More...
 
virtual bool JoinReadThread (Status *error_ptr=nullptr)
 
bool ReadThreadIsRunning ()
 Checks if there is a currently running read thread. More...
 
void SetReadThreadBytesReceivedCallback (ReadThreadBytesReceived callback, void *callback_baton)
 
void SynchronizeWithReadThread ()
 Wait for the read thread to process all outstanding data. More...
 
bool GetCloseOnEOF () const
 
void SetCloseOnEOF (bool b)
 
ConstStringGetBroadcasterClass () const override
 This needs to be filled in if you are going to register the broadcaster with the broadcaster manager and do broadcaster class matching. More...
 
- Public Member Functions inherited from lldb_private::Broadcaster
 Broadcaster (lldb::BroadcasterManagerSP manager_sp, const char *name)
 Construct with a broadcaster with a name. More...
 
virtual ~Broadcaster ()
 Destructor. More...
 
void CheckInWithManager ()
 
void BroadcastEvent (lldb::EventSP &event_sp)
 Broadcast an event which has no associated data. More...
 
void BroadcastEventIfUnique (lldb::EventSP &event_sp)
 
void BroadcastEvent (uint32_t event_type, const lldb::EventDataSP &event_data_sp)
 
void BroadcastEvent (uint32_t event_type, EventData *event_data=nullptr)
 
void BroadcastEventIfUnique (uint32_t event_type, EventData *event_data=nullptr)
 
void Clear ()
 
virtual void AddInitialEventsToListener (const lldb::ListenerSP &listener_sp, uint32_t requested_events)
 
uint32_t AddListener (const lldb::ListenerSP &listener_sp, uint32_t event_mask)
 Listen for any events specified by event_mask. More...
 
ConstString GetBroadcasterName ()
 Get the NULL terminated C string name of this Broadcaster object. More...
 
bool GetEventNames (Stream &s, const uint32_t event_mask, bool prefix_with_broadcaster_name) const
 Get the event name(s) for one or more event bits. More...
 
void SetEventName (uint32_t event_mask, const char *name)
 Set the name for an event bit. More...
 
const char * GetEventName (uint32_t event_mask) const
 
bool EventTypeHasListeners (uint32_t event_type)
 
bool RemoveListener (const lldb::ListenerSP &listener_sp, uint32_t event_mask=UINT32_MAX)
 Removes a Listener from this broadcasters list and frees the event bits specified by event_mask that were previously acquired by listener (assuming listener was listening to this object) for other listener objects to use. More...
 
bool HijackBroadcaster (const lldb::ListenerSP &listener_sp, uint32_t event_mask=UINT32_MAX)
 Provides a simple mechanism to temporarily redirect events from broadcaster. More...
 
bool IsHijackedForEvent (uint32_t event_mask)
 
void RestoreBroadcaster ()
 Restore the state of the Broadcaster from a previous hijack attempt. More...
 
lldb::BroadcasterManagerSP GetManager ()
 

Protected Member Functions

PacketResult SendPacketAndWaitForResponseNoLock (llvm::StringRef payload, StringExtractorGDBRemote &response)
 
virtual void OnRunPacketSent (bool first)
 
- Protected Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteCommunication
PacketResult SendPacketNoLock (llvm::StringRef payload)
 
PacketResult SendRawPacketNoLock (llvm::StringRef payload, bool skip_ack=false)
 
PacketResult ReadPacket (StringExtractorGDBRemote &response, Timeout< std::micro > timeout, bool sync_on_timeout)
 
PacketResult ReadPacketWithOutputSupport (StringExtractorGDBRemote &response, Timeout< std::micro > timeout, bool sync_on_timeout, llvm::function_ref< void(llvm::StringRef)> output_callback)
 
PacketResult PopPacketFromQueue (StringExtractorGDBRemote &response, Timeout< std::micro > timeout)
 
PacketResult WaitForPacketNoLock (StringExtractorGDBRemote &response, Timeout< std::micro > timeout, bool sync_on_timeout)
 
bool CompressionIsEnabled ()
 
bool DecompressPacket ()
 
Status StartListenThread (const char *hostname="127.0.0.1", uint16_t port=0)
 
bool JoinListenThread ()
 
void AppendBytesToCache (const uint8_t *bytes, size_t len, bool broadcast, lldb::ConnectionStatus status) override
 Append new bytes that get read from the read thread into the internal object byte cache. More...
 
- Protected Member Functions inherited from lldb_private::Communication
size_t ReadFromConnection (void *dst, size_t dst_len, const Timeout< std::micro > &timeout, lldb::ConnectionStatus &status, Status *error_ptr)
 
size_t GetCachedBytes (void *dst, size_t dst_len)
 Get any available bytes from our data cache. More...
 
- Protected Member Functions inherited from lldb_private::Broadcaster
BroadcasterImplSP GetBroadcasterImpl ()
 
const char * GetHijackingListenerName ()
 

Private Member Functions

bool ShouldStop (const UnixSignals &signals, StringExtractorGDBRemote &response)
 

Private Attributes

std::recursive_mutex m_async_mutex
 This handles the synchronization between individual async threads. More...
 
std::mutex m_mutex
 Variables handling synchronization between the Continue thread and any other threads wishing to send packets over the connection. More...
 
std::condition_variable m_cv
 
std::string m_continue_packet
 Packet with which to resume after an async interrupt. More...
 
std::chrono::time_point< std::chrono::steady_clock > m_interrupt_time
 When was the interrupt packet sent. More...
 
uint32_t m_async_count
 Number of threads interested in sending. More...
 
bool m_is_running
 Whether the continue thread has control. More...
 
bool m_should_stop
 Whether we should resume after a stop. More...
 

Additional Inherited Members

- Public Types inherited from lldb_private::process_gdb_remote::GDBRemoteCommunication
enum  { eBroadcastBitRunPacketSent = kLoUserBroadcastBit, eBroadcastBitGdbReadThreadGotNotify }
 
enum  PacketType { PacketType::Invalid = 0, PacketType::Standard, PacketType::Notify }
 
enum  PacketResult {
  PacketResult::Success = 0, PacketResult::ErrorSendFailed, PacketResult::ErrorSendAck, PacketResult::ErrorReplyFailed,
  PacketResult::ErrorReplyTimeout, PacketResult::ErrorReplyInvalid, PacketResult::ErrorReplyAck, PacketResult::ErrorDisconnected,
  PacketResult::ErrorNoSequenceLock
}
 
- Public Types inherited from lldb_private::Communication
typedef void(* ReadThreadBytesReceived) (void *baton, const void *src, size_t src_len)
 
- Static Public Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteCommunication
static llvm::Error ConnectLocally (GDBRemoteCommunication &client, GDBRemoteCommunication &server)
 
static std::string ExpandRLE (std::string)
 Expand GDB run-length encoding. More...
 
- Static Public Member Functions inherited from lldb_private::Communication
static lldb::thread_result_t ReadThread (lldb::thread_arg_t comm_ptr)
 The static read thread function. More...
 
static const char * ConnectionStatusAsCString (lldb::ConnectionStatus status)
 
static ConstStringGetStaticBroadcasterClass ()
 
- Protected Types inherited from lldb_private::Broadcaster
typedef std::shared_ptr< BroadcasterImplBroadcasterImplSP
 
typedef std::weak_ptr< BroadcasterImplBroadcasterImplWP
 
- Static Protected Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteCommunication
static lldb::thread_result_t ListenThread (lldb::thread_arg_t arg)
 
- Protected Attributes inherited from lldb_private::process_gdb_remote::GDBRemoteCommunication
std::chrono::seconds m_packet_timeout
 
uint32_t m_echo_number
 
LazyBool m_supports_qEcho
 
GDBRemoteCommunicationHistory m_history
 
bool m_send_acks
 
bool m_is_platform
 
CompressionType m_compression_type
 
- Protected Attributes inherited from lldb_private::Communication
lldb::ConnectionSP m_connection_sp
 The connection that is current in use by this communications class. More...
 
HostThread m_read_thread
 The read thread handle in case we need to cancel the thread. More...
 
std::atomic< bool > m_read_thread_enabled
 
std::atomic< bool > m_read_thread_did_exit
 
std::string m_bytes
 A buffer to cache bytes read in the ReadThread function. More...
 
std::recursive_mutex m_bytes_mutex
 A mutex to protect multi-threaded access to the cached bytes. More...
 
std::mutex m_write_mutex
 Don't let multiple threads write at the same time... More...
 
std::mutex m_synchronize_mutex
 
ReadThreadBytesReceived m_callback
 
void * m_callback_baton
 
bool m_close_on_eof
 

Detailed Description

Definition at line 19 of file GDBRemoteClientBase.h.

Constructor & Destructor Documentation

◆ GDBRemoteClientBase()

GDBRemoteClientBase::GDBRemoteClientBase ( const char *  comm_name,
const char *  listener_name 
)

Definition at line 31 of file GDBRemoteClientBase.cpp.

Member Function Documentation

◆ Interrupt()

bool GDBRemoteClientBase::Interrupt ( )

◆ OnRunPacketSent()

void GDBRemoteClientBase::OnRunPacketSent ( bool  first)
protectedvirtual

◆ SendAsyncSignal()

bool GDBRemoteClientBase::SendAsyncSignal ( int  signo)

◆ SendContinuePacketAndWaitForResponse()

StateType GDBRemoteClientBase::SendContinuePacketAndWaitForResponse ( ContinueDelegate delegate,
const UnixSignals signals,
llvm::StringRef  payload,
StringExtractorGDBRemote response 
)

Definition at line 36 of file GDBRemoteClientBase.cpp.

References lldb_private::process_gdb_remote::GDBRemoteClientBase::ContinueLock::Cancelled, StringExtractor::Clear(), StringExtractor::Empty(), lldb_private::process_gdb_remote::GDBRemoteCommunication::ErrorReplyTimeout, lldb::eStateExited, lldb::eStateInvalid, lldb::eStateStopped, lldb_private::process_gdb_remote::GDBRemoteClientBase::ContinueLock::Failed, GDBR_LOG_PROCESS, StringExtractor::GetChar(), StringExtractor::GetHexByteString(), lldb_private::process_gdb_remote::ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(), StringExtractor::GetStringRef(), lldb_private::process_gdb_remote::GDBRemoteClientBase::ContinueDelegate::HandleAsyncMisc(), lldb_private::process_gdb_remote::GDBRemoteClientBase::ContinueDelegate::HandleAsyncStdout(), lldb_private::process_gdb_remote::GDBRemoteClientBase::ContinueDelegate::HandleAsyncStructuredDataPacket(), lldb_private::process_gdb_remote::GDBRemoteClientBase::ContinueDelegate::HandleStopReply(), kInterruptTimeout(), LLDB_LOGF, lldb_private::process_gdb_remote::GDBRemoteClientBase::ContinueLock::lock(), m_async_count, m_continue_packet, m_interrupt_time, m_mutex, m_should_stop, OnRunPacketSent(), lldb_private::process_gdb_remote::GDBRemoteCommunication::ReadPacket(), StringExtractor::SetFilePos(), ShouldStop(), lldb_private::process_gdb_remote::GDBRemoteCommunication::Success, lldb_private::process_gdb_remote::GDBRemoteClientBase::ContinueLock::Success, and lldb_private::process_gdb_remote::GDBRemoteClientBase::ContinueLock::unlock().

Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::AsyncThread().

◆ SendPacketAndReceiveResponseWithOutputSupport()

GDBRemoteCommunication::PacketResult GDBRemoteClientBase::SendPacketAndReceiveResponseWithOutputSupport ( llvm::StringRef  payload,
StringExtractorGDBRemote response,
bool  send_async,
llvm::function_ref< void(llvm::StringRef)>  output_callback 
)

◆ SendPacketAndWaitForResponse()

GDBRemoteCommunication::PacketResult GDBRemoteClientBase::SendPacketAndWaitForResponse ( llvm::StringRef  payload,
StringExtractorGDBRemote response,
bool  send_async 
)

Definition at line 155 of file GDBRemoteClientBase.cpp.

References lldb_private::process_gdb_remote::GDBRemoteCommunication::ErrorSendFailed, GDBR_LOG_PROCESS, lldb_private::process_gdb_remote::ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(), LLDB_LOGF, and SendPacketAndWaitForResponseNoLock().

Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::AllocateMemory(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::CalculateMD5(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::CloseFile(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ConfigureRemoteStructuredData(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::CreateSymlink(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::DeallocateMemory(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::Detach(), CommandObjectProcessGDBRemotePacketSend::DoExecute(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::EnableErrorStringInPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::FindProcesses(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetCurrentProcessID(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetCurrentProcessInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetDefaultThreadId(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetFileExists(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetFilePermissions(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetFileSize(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetGDBServerVersion(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetGroupName(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetHostInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetLaunchSuccess(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetListThreadsInStopReplySupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetLoadedDynamicLibrariesInfosSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetMemoryRegionInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetModuleInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetModulesInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetProcessInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetQOffsets(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetRemoteQSupported(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::GetRemoteUnixSignals(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetSharedCacheInfoSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetShlibInfoAddr(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetStopReply(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetSupportedStructuredDataPlugins(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetSyncThreadStateSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetThreadExtendedInfoSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetThreadsInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetThreadStopInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetThreadSuffixSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetUserName(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetVAttachOrWaitSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetVContSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetWatchpointSupportInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetWorkingDir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetxPacketSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::KillSpawnedProcess(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::LaunchGDBServer(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::MakeDirectory(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::MaybeEnableCompression(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::OpenFile(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::QueryGDBServer(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::QueryNoAckModeSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ReadExtFeature(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ReadFile(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::RunShellCommand(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendArgumentsPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendAttach(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendEnvironmentPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendGDBStoppointTypePacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendGetTraceConfigPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendGetTraceDataPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendLaunchArchPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendLaunchEventDataPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendSignalsToIgnore(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendSpeedTestPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendStartTracePacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendStdinNotification(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendStopTracePacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetCurrentThread(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetCurrentThreadForRun(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetDetachOnError(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetDisableASLR(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetFilePermissions(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetNonStopMode(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetSTDERR(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetSTDIN(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetSTDOUT(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetWorkingDir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SyncThreadState(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::TestPacketSpeed(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::Unlink(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::WriteFile().

◆ SendPacketAndWaitForResponseNoLock()

GDBRemoteCommunication::PacketResult GDBRemoteClientBase::SendPacketAndWaitForResponseNoLock ( llvm::StringRef  payload,
StringExtractorGDBRemote response 
)
protected

◆ SendvContPacket()

bool GDBRemoteClientBase::SendvContPacket ( llvm::StringRef  payload,
StringExtractorGDBRemote response 
)

◆ ShouldStop()

bool GDBRemoteClientBase::ShouldStop ( const UnixSignals signals,
StringExtractorGDBRemote response 
)
private

Member Data Documentation

◆ m_async_count

uint32_t lldb_private::process_gdb_remote::GDBRemoteClientBase::m_async_count
private

◆ m_async_mutex

std::recursive_mutex lldb_private::process_gdb_remote::GDBRemoteClientBase::m_async_mutex
private

This handles the synchronization between individual async threads.

For now they just use a simple mutex.

Definition at line 126 of file GDBRemoteClientBase.h.

◆ m_continue_packet

std::string lldb_private::process_gdb_remote::GDBRemoteClientBase::m_continue_packet
private

Packet with which to resume after an async interrupt.

Can be changed by an async thread e.g. to inject a signal.

Definition at line 108 of file GDBRemoteClientBase.h.

Referenced by lldb_private::process_gdb_remote::GDBRemoteClientBase::ContinueLock::lock(), SendAsyncSignal(), and SendContinuePacketAndWaitForResponse().

◆ m_cv

std::condition_variable lldb_private::process_gdb_remote::GDBRemoteClientBase::m_cv
private

◆ m_interrupt_time

std::chrono::time_point<std::chrono::steady_clock> lldb_private::process_gdb_remote::GDBRemoteClientBase::m_interrupt_time
private

When was the interrupt packet sent.

Used to make sure we time out if the stub does not respond to interrupt requests.

Definition at line 112 of file GDBRemoteClientBase.h.

Referenced by SendContinuePacketAndWaitForResponse(), and lldb_private::process_gdb_remote::GDBRemoteClientBase::Lock::SyncWithContinueThread().

◆ m_is_running

bool lldb_private::process_gdb_remote::GDBRemoteClientBase::m_is_running
private

◆ m_mutex

std::mutex lldb_private::process_gdb_remote::GDBRemoteClientBase::m_mutex
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).

Definition at line 103 of file GDBRemoteClientBase.h.

Referenced by lldb_private::process_gdb_remote::GDBRemoteClientBase::ContinueLock::lock(), SendContinuePacketAndWaitForResponse(), ShouldStop(), lldb_private::process_gdb_remote::GDBRemoteClientBase::Lock::SyncWithContinueThread(), lldb_private::process_gdb_remote::GDBRemoteClientBase::ContinueLock::unlock(), and lldb_private::process_gdb_remote::GDBRemoteClientBase::Lock::~Lock().

◆ m_should_stop

bool lldb_private::process_gdb_remote::GDBRemoteClientBase::m_should_stop
private

The documentation for this class was generated from the following files: