LLDB mainline
lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon Class Referenceabstract

#include <GDBRemoteCommunicationServerCommon.h>

Inheritance diagram for lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon:
[legend]

Public Member Functions

 GDBRemoteCommunicationServerCommon ()
 ~GDBRemoteCommunicationServerCommon () override
Public Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteCommunicationServer
 GDBRemoteCommunicationServer ()
 ~GDBRemoteCommunicationServer () override
void RegisterPacketHandler (StringExtractorGDBRemote::ServerPacketType packet_type, PacketHandler handler)
PacketResult GetPacketAndSendResponse (Timeout< std::micro > timeout, Status &error, bool &interrupt, bool &quit)
Public Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteCommunication
 GDBRemoteCommunication ()
 ~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
void DumpHistory (Stream &strm)
Public Member Functions inherited from lldb_private::Communication
 Communication ()
 Construct the Communication object.
virtual ~Communication ()
 Destructor.
virtual void Clear ()
lldb::ConnectionStatus Connect (const char *url, Status *error_ptr)
 Connect using the current connection by passing url to its connect function.
virtual lldb::ConnectionStatus Disconnect (Status *error_ptr=nullptr)
 Disconnect the communications connection if one is currently connected.
bool IsConnected () const
 Check if the connection is valid.
bool HasConnection () const
lldb_private::ConnectionGetConnection ()
virtual 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.
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.
size_t WriteAll (const void *src, size_t src_len, lldb::ConnectionStatus &status, Status *error_ptr)
 Repeatedly attempt writing until either src_len bytes are written or a permanent failure occurs.
virtual void SetConnection (std::unique_ptr< Connection > connection)
 Sets the connection that it to be used by this class.
bool GetCloseOnEOF () const
void SetCloseOnEOF (bool b)

Protected Member Functions

PacketResult Handle_A (StringExtractorGDBRemote &packet)
PacketResult Handle_qHostInfo (StringExtractorGDBRemote &packet)
PacketResult Handle_qProcessInfoPID (StringExtractorGDBRemote &packet)
PacketResult Handle_qfProcessInfo (StringExtractorGDBRemote &packet)
PacketResult Handle_qsProcessInfo (StringExtractorGDBRemote &packet)
PacketResult Handle_qUserName (StringExtractorGDBRemote &packet)
PacketResult Handle_qGroupName (StringExtractorGDBRemote &packet)
PacketResult Handle_qSpeedTest (StringExtractorGDBRemote &packet)
PacketResult Handle_vFile_Open (StringExtractorGDBRemote &packet)
PacketResult Handle_vFile_Close (StringExtractorGDBRemote &packet)
PacketResult Handle_vFile_pRead (StringExtractorGDBRemote &packet)
PacketResult Handle_vFile_pWrite (StringExtractorGDBRemote &packet)
PacketResult Handle_vFile_Size (StringExtractorGDBRemote &packet)
PacketResult Handle_vFile_Mode (StringExtractorGDBRemote &packet)
PacketResult Handle_vFile_Exists (StringExtractorGDBRemote &packet)
PacketResult Handle_vFile_symlink (StringExtractorGDBRemote &packet)
PacketResult Handle_vFile_unlink (StringExtractorGDBRemote &packet)
PacketResult Handle_vFile_FStat (StringExtractorGDBRemote &packet)
PacketResult Handle_vFile_Stat (StringExtractorGDBRemote &packet)
PacketResult Handle_vFile_MD5 (StringExtractorGDBRemote &packet)
PacketResult Handle_qEcho (StringExtractorGDBRemote &packet)
PacketResult Handle_qModuleInfo (StringExtractorGDBRemote &packet)
PacketResult Handle_jModulesInfo (StringExtractorGDBRemote &packet)
PacketResult Handle_qPlatform_shell (StringExtractorGDBRemote &packet)
PacketResult Handle_qPlatform_mkdir (StringExtractorGDBRemote &packet)
PacketResult Handle_qPlatform_chmod (StringExtractorGDBRemote &packet)
PacketResult Handle_qSupported (StringExtractorGDBRemote &packet)
PacketResult Handle_QSetDetachOnError (StringExtractorGDBRemote &packet)
PacketResult Handle_QStartNoAckMode (StringExtractorGDBRemote &packet)
PacketResult Handle_QSetSTDIN (StringExtractorGDBRemote &packet)
PacketResult Handle_QSetSTDOUT (StringExtractorGDBRemote &packet)
PacketResult Handle_QSetSTDERR (StringExtractorGDBRemote &packet)
PacketResult Handle_qLaunchSuccess (StringExtractorGDBRemote &packet)
PacketResult Handle_QEnvironment (StringExtractorGDBRemote &packet)
PacketResult Handle_QEnvironmentHexEncoded (StringExtractorGDBRemote &packet)
PacketResult Handle_QLaunchArch (StringExtractorGDBRemote &packet)
template<typename T>
void RegisterMemberFunctionHandler (StringExtractorGDBRemote::ServerPacketType packet_type, PacketResult(T::*handler)(StringExtractorGDBRemote &packet))
virtual Status LaunchProcess ()=0
 Launch a process with the current launch settings.
virtual FileSpec FindModuleFile (const std::string &module_path, const ArchSpec &arch)
virtual std::vector< std::string > HandleFeatures (llvm::ArrayRef< llvm::StringRef > client_features)
Protected Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteCommunicationServer
PacketResult Handle_QErrorStringEnable (StringExtractorGDBRemote &packet)
PacketResult SendErrorResponse (const Status &error)
PacketResult SendErrorResponse (llvm::Error error)
PacketResult SendUnimplementedResponse (const char *packet)
PacketResult SendErrorResponse (uint8_t error)
PacketResult SendIllFormedResponse (const StringExtractorGDBRemote &packet, const char *error_message)
PacketResult SendOKResponse ()
PacketResult SendJSONResponse (const llvm::json::Value &value)
 Serialize and send a JSON object response.
PacketResult SendJSONResponse (llvm::Expected< llvm::json::Value > value)
 Serialize and send a JSON object response, or respond with an error if the input object is an llvm::Error.
Protected Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteCommunication
PacketResult SendPacketNoLock (llvm::StringRef payload)
PacketResult SendNotificationPacketNoLock (llvm::StringRef notify_type, std::deque< std::string > &queue, 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 WaitForPacketNoLock (StringExtractorGDBRemote &response, Timeout< std::micro > timeout, bool sync_on_timeout)
bool CompressionIsEnabled ()
bool DecompressPacket ()
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)

Static Protected Member Functions

static void CreateProcessInfoResponse (const ProcessInstanceInfo &proc_info, StreamString &response)
static void CreateProcessInfoResponse_DebugServerStyle (const ProcessInstanceInfo &proc_info, StreamString &response)

Protected Attributes

ProcessLaunchInfo m_process_launch_info
Status m_process_launch_error
ProcessInstanceInfoList m_proc_infos
uint32_t m_proc_infos_index
Protected Attributes inherited from lldb_private::process_gdb_remote::GDBRemoteCommunicationServer
std::map< StringExtractorGDBRemote::ServerPacketType, PacketHandlerm_packet_handlers
bool m_exit_now
bool m_send_error_strings = false
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
std::string m_bytes
std::recursive_mutex m_bytes_mutex
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.
std::mutex m_write_mutex
 Don't let multiple threads write at the same time...
bool m_close_on_eof

Private Member Functions

ModuleSpec GetModuleInfo (llvm::StringRef module_path, llvm::StringRef triple)

Additional Inherited Members

Public Types inherited from lldb_private::process_gdb_remote::GDBRemoteCommunicationServer
using PacketHandler
Public Types inherited from lldb_private::process_gdb_remote::GDBRemoteCommunication
enum class  PacketType { Invalid = 0 , Standard , Notify }
enum class  PacketResult {
  Success = 0 , ErrorSendFailed , ErrorSendAck , ErrorReplyFailed ,
  ErrorReplyTimeout , ErrorReplyInvalid , ErrorReplyAck , ErrorDisconnected ,
  ErrorNoSequenceLock
}
Static Public Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteCommunication
static Status StartDebugserverProcess (std::variant< llvm::StringRef, shared_fd_t > comm, ProcessLaunchInfo &launch_info, const Args *inferior_args)
static std::optional< std::string > ExpandRLE (std::string)
 Expand GDB run-length encoding.
Static Public Member Functions inherited from lldb_private::Communication
static std::string ConnectionStatusAsString (lldb::ConnectionStatus status)

Detailed Description

Definition at line 26 of file GDBRemoteCommunicationServerCommon.h.

Constructor & Destructor Documentation

◆ GDBRemoteCommunicationServerCommon()

GDBRemoteCommunicationServerCommon::GDBRemoteCommunicationServerCommon ( )

Definition at line 61 of file GDBRemoteCommunicationServerCommon.cpp.

References StringExtractorGDBRemote::eServerPacketType_A, StringExtractorGDBRemote::eServerPacketType_jModulesInfo, StringExtractorGDBRemote::eServerPacketType_qEcho, StringExtractorGDBRemote::eServerPacketType_QEnvironment, StringExtractorGDBRemote::eServerPacketType_QEnvironmentHexEncoded, StringExtractorGDBRemote::eServerPacketType_qfProcessInfo, StringExtractorGDBRemote::eServerPacketType_qGroupName, StringExtractorGDBRemote::eServerPacketType_qHostInfo, StringExtractorGDBRemote::eServerPacketType_QLaunchArch, StringExtractorGDBRemote::eServerPacketType_qLaunchSuccess, StringExtractorGDBRemote::eServerPacketType_qModuleInfo, StringExtractorGDBRemote::eServerPacketType_qPlatform_chmod, StringExtractorGDBRemote::eServerPacketType_qPlatform_mkdir, StringExtractorGDBRemote::eServerPacketType_qPlatform_shell, StringExtractorGDBRemote::eServerPacketType_qProcessInfoPID, StringExtractorGDBRemote::eServerPacketType_QSetDetachOnError, StringExtractorGDBRemote::eServerPacketType_QSetSTDERR, StringExtractorGDBRemote::eServerPacketType_QSetSTDIN, StringExtractorGDBRemote::eServerPacketType_QSetSTDOUT, StringExtractorGDBRemote::eServerPacketType_qSpeedTest, StringExtractorGDBRemote::eServerPacketType_qsProcessInfo, StringExtractorGDBRemote::eServerPacketType_QStartNoAckMode, StringExtractorGDBRemote::eServerPacketType_qSupported, StringExtractorGDBRemote::eServerPacketType_qUserName, StringExtractorGDBRemote::eServerPacketType_vFile_close, StringExtractorGDBRemote::eServerPacketType_vFile_exists, StringExtractorGDBRemote::eServerPacketType_vFile_fstat, StringExtractorGDBRemote::eServerPacketType_vFile_md5, StringExtractorGDBRemote::eServerPacketType_vFile_mode, StringExtractorGDBRemote::eServerPacketType_vFile_open, StringExtractorGDBRemote::eServerPacketType_vFile_pread, StringExtractorGDBRemote::eServerPacketType_vFile_pwrite, StringExtractorGDBRemote::eServerPacketType_vFile_size, StringExtractorGDBRemote::eServerPacketType_vFile_stat, StringExtractorGDBRemote::eServerPacketType_vFile_symlink, StringExtractorGDBRemote::eServerPacketType_vFile_unlink, lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GDBRemoteCommunicationServer(), Handle_A(), Handle_jModulesInfo(), Handle_qEcho(), Handle_QEnvironment(), Handle_QEnvironmentHexEncoded(), Handle_qfProcessInfo(), Handle_qGroupName(), Handle_qHostInfo(), Handle_QLaunchArch(), Handle_qLaunchSuccess(), Handle_qModuleInfo(), Handle_qPlatform_chmod(), Handle_qPlatform_mkdir(), Handle_qPlatform_shell(), Handle_qProcessInfoPID(), Handle_QSetDetachOnError(), Handle_QSetSTDERR(), Handle_QSetSTDIN(), Handle_QSetSTDOUT(), Handle_qSpeedTest(), Handle_qsProcessInfo(), Handle_QStartNoAckMode(), Handle_qSupported(), Handle_qUserName(), Handle_vFile_Close(), Handle_vFile_Exists(), Handle_vFile_FStat(), Handle_vFile_MD5(), Handle_vFile_Mode(), Handle_vFile_Open(), Handle_vFile_pRead(), Handle_vFile_pWrite(), Handle_vFile_Size(), Handle_vFile_Stat(), Handle_vFile_symlink(), Handle_vFile_unlink(), m_proc_infos, m_proc_infos_index, m_process_launch_error, m_process_launch_info, and RegisterMemberFunctionHandler().

Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::GDBRemoteCommunicationServerLLGS().

◆ ~GDBRemoteCommunicationServerCommon()

GDBRemoteCommunicationServerCommon::~GDBRemoteCommunicationServerCommon ( )
overridedefault

Member Function Documentation

◆ CreateProcessInfoResponse()

◆ CreateProcessInfoResponse_DebugServerStyle()

◆ FindModuleFile()

◆ GetModuleInfo()

◆ Handle_A()

◆ Handle_jModulesInfo()

◆ Handle_qEcho()

◆ Handle_QEnvironment()

◆ Handle_QEnvironmentHexEncoded()

◆ Handle_qfProcessInfo()

◆ Handle_qGroupName()

◆ Handle_qHostInfo()

◆ Handle_QLaunchArch()

◆ Handle_qLaunchSuccess()

◆ Handle_qModuleInfo()

◆ Handle_qPlatform_chmod()

◆ Handle_qPlatform_mkdir()

◆ Handle_qPlatform_shell()

◆ Handle_qProcessInfoPID()

◆ Handle_QSetDetachOnError()

◆ Handle_QSetSTDERR()

◆ Handle_QSetSTDIN()

◆ Handle_QSetSTDOUT()

◆ Handle_qSpeedTest()

◆ Handle_qsProcessInfo()

◆ Handle_QStartNoAckMode()

◆ Handle_qSupported()

◆ Handle_qUserName()

◆ Handle_vFile_Close()

◆ Handle_vFile_Exists()

◆ Handle_vFile_FStat()

◆ Handle_vFile_MD5()

◆ Handle_vFile_Mode()

◆ Handle_vFile_Open()

◆ Handle_vFile_pRead()

◆ Handle_vFile_pWrite()

◆ Handle_vFile_Size()

◆ Handle_vFile_Stat()

◆ Handle_vFile_symlink()

◆ Handle_vFile_unlink()

◆ HandleFeatures()

std::vector< std::string > GDBRemoteCommunicationServerCommon::HandleFeatures ( llvm::ArrayRef< llvm::StringRef > client_features)
protectedvirtual

◆ LaunchProcess()

virtual Status lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::LaunchProcess ( )
protectedpure virtual

Launch a process with the current launch settings.

This method supports running an lldb-gdbserver or similar server in a situation where the startup code has been provided with all the information for a child process to be launched.

Returns
An Status object indicating the success or failure of the launch.

Implemented in lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS, and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform.

Referenced by Handle_A().

◆ RegisterMemberFunctionHandler()

Member Data Documentation

◆ m_proc_infos

ProcessInstanceInfoList lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::m_proc_infos
protected

◆ m_proc_infos_index

uint32_t lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::m_proc_infos_index
protected

◆ m_process_launch_error

Status lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::m_process_launch_error
protected

◆ m_process_launch_info


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