LLDB mainline
lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS Class Reference

#include <GDBRemoteCommunicationServerLLGS.h>

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

Classes

struct  DebuggedProcess

Public Member Functions

 GDBRemoteCommunicationServerLLGS (MainLoop &mainloop, NativeProcessProtocol::Manager &process_manager)
void SetLaunchInfo (const ProcessLaunchInfo &info)
Status LaunchProcess () override
 Launch a process with the current launch settings.
Status AttachToProcess (lldb::pid_t pid)
 Attach to a process.
Status AttachWaitProcess (llvm::StringRef process_name, bool include_existing)
 Wait to attach to a process with a given name.
void InitializeDelegate (NativeProcessProtocol *process) override
void ProcessStateChanged (NativeProcessProtocol *process, lldb::StateType state) override
void DidExec (NativeProcessProtocol *process) override
void NewSubprocess (NativeProcessProtocol *parent_process, std::unique_ptr< NativeProcessProtocol > child_process) override
Status InitializeConnection (std::unique_ptr< Connection > connection)
GDBRemoteCommunication::PacketResult SendStructuredDataPacket (const llvm::json::Value &value)
Public Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon
 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)
Public Member Functions inherited from lldb_private::NativeProcessProtocol::NativeDelegate
virtual ~NativeDelegate ()=default

Protected Member Functions

PacketResult SendONotification (const char *buffer, uint32_t len)
PacketResult SendWResponse (NativeProcessProtocol *process)
StreamString PrepareStopReplyPacketForThread (NativeThreadProtocol &thread)
PacketResult SendStopReplyPacketForThread (NativeProcessProtocol &process, lldb::tid_t tid, bool force_synchronous)
PacketResult SendStopReasonForState (NativeProcessProtocol &process, lldb::StateType process_state, bool force_synchronous)
void EnqueueStopReplyPackets (lldb::tid_t thread_to_skip)
PacketResult Handle_k (StringExtractorGDBRemote &packet)
PacketResult Handle_vKill (StringExtractorGDBRemote &packet)
PacketResult Handle_qProcessInfo (StringExtractorGDBRemote &packet)
PacketResult Handle_qC (StringExtractorGDBRemote &packet)
PacketResult Handle_QSetDisableASLR (StringExtractorGDBRemote &packet)
PacketResult Handle_QSetWorkingDir (StringExtractorGDBRemote &packet)
PacketResult Handle_qGetWorkingDir (StringExtractorGDBRemote &packet)
PacketResult Handle_QThreadSuffixSupported (StringExtractorGDBRemote &packet)
PacketResult Handle_QListThreadsInStopReply (StringExtractorGDBRemote &packet)
PacketResult ResumeProcess (NativeProcessProtocol &process, const ResumeActionList &actions)
PacketResult Handle_C (StringExtractorGDBRemote &packet)
PacketResult Handle_c (StringExtractorGDBRemote &packet)
PacketResult Handle_vCont (StringExtractorGDBRemote &packet)
PacketResult Handle_vCont_actions (StringExtractorGDBRemote &packet)
PacketResult Handle_stop_reason (StringExtractorGDBRemote &packet)
PacketResult Handle_qRegisterInfo (StringExtractorGDBRemote &packet)
void AddProcessThreads (StreamGDBRemote &response, NativeProcessProtocol &process, bool &had_any)
PacketResult Handle_qfThreadInfo (StringExtractorGDBRemote &packet)
PacketResult Handle_qsThreadInfo (StringExtractorGDBRemote &packet)
PacketResult Handle_qStructuredDataPlugins (StringExtractorGDBRemote &packet)
PacketResult Handle_p (StringExtractorGDBRemote &packet)
PacketResult Handle_P (StringExtractorGDBRemote &packet)
PacketResult Handle_H (StringExtractorGDBRemote &packet)
PacketResult Handle_I (StringExtractorGDBRemote &packet)
PacketResult Handle_interrupt (StringExtractorGDBRemote &packet)
PacketResult Handle_memory_read (StringExtractorGDBRemote &packet)
PacketResult Handle_M (StringExtractorGDBRemote &packet)
PacketResult Handle__M (StringExtractorGDBRemote &packet)
PacketResult Handle__m (StringExtractorGDBRemote &packet)
PacketResult Handle_qMemoryRegionInfoSupported (StringExtractorGDBRemote &packet)
PacketResult Handle_qMemoryRegionInfo (StringExtractorGDBRemote &packet)
PacketResult Handle_Z (StringExtractorGDBRemote &packet)
PacketResult Handle_z (StringExtractorGDBRemote &packet)
PacketResult Handle_s (StringExtractorGDBRemote &packet)
PacketResult Handle_qXfer (StringExtractorGDBRemote &packet)
PacketResult Handle_QSaveRegisterState (StringExtractorGDBRemote &packet)
PacketResult Handle_jLLDBTraceSupported (StringExtractorGDBRemote &packet)
PacketResult Handle_jLLDBTraceStart (StringExtractorGDBRemote &packet)
PacketResult Handle_jLLDBTraceStop (StringExtractorGDBRemote &packet)
PacketResult Handle_jLLDBTraceGetState (StringExtractorGDBRemote &packet)
PacketResult Handle_jLLDBTraceGetBinaryData (StringExtractorGDBRemote &packet)
PacketResult Handle_QRestoreRegisterState (StringExtractorGDBRemote &packet)
PacketResult Handle_vAttach (StringExtractorGDBRemote &packet)
PacketResult Handle_vAttachWait (StringExtractorGDBRemote &packet)
PacketResult Handle_qVAttachOrWaitSupported (StringExtractorGDBRemote &packet)
PacketResult Handle_vAttachOrWait (StringExtractorGDBRemote &packet)
PacketResult Handle_vRun (StringExtractorGDBRemote &packet)
PacketResult Handle_D (StringExtractorGDBRemote &packet)
PacketResult Handle_qThreadStopInfo (StringExtractorGDBRemote &packet)
PacketResult Handle_jThreadsInfo (StringExtractorGDBRemote &packet)
PacketResult Handle_qWatchpointSupportInfo (StringExtractorGDBRemote &packet)
PacketResult Handle_qFileLoadAddress (StringExtractorGDBRemote &packet)
PacketResult Handle_QPassSignals (StringExtractorGDBRemote &packet)
PacketResult Handle_qSaveCore (StringExtractorGDBRemote &packet)
PacketResult Handle_QNonStop (StringExtractorGDBRemote &packet)
PacketResult HandleNotificationAck (std::deque< std::string > &queue)
PacketResult Handle_vStdio (StringExtractorGDBRemote &packet)
PacketResult Handle_vStopped (StringExtractorGDBRemote &packet)
PacketResult Handle_vCtrlC (StringExtractorGDBRemote &packet)
PacketResult Handle_g (StringExtractorGDBRemote &packet)
PacketResult Handle_qMemTags (StringExtractorGDBRemote &packet)
PacketResult Handle_QMemTags (StringExtractorGDBRemote &packet)
PacketResult Handle_T (StringExtractorGDBRemote &packet)
void SetCurrentThreadID (lldb::tid_t tid)
lldb::tid_t GetCurrentThreadID () const
void SetContinueThreadID (lldb::tid_t tid)
lldb::tid_t GetContinueThreadID () const
Status SetSTDIOFileDescriptor (int fd)
FileSpec FindModuleFile (const std::string &module_path, const ArchSpec &arch) override
llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > ReadXferObject (llvm::StringRef object, llvm::StringRef annex)
std::vector< std::string > HandleFeatures (const llvm::ArrayRef< llvm::StringRef > client_features) override
PacketResult SendContinueSuccessResponse ()
void AppendThreadIDToResponse (Stream &response, lldb::pid_t pid, lldb::tid_t tid)
Protected Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon
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))
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 std::string XMLEncodeAttributeValue (llvm::StringRef value)
Static Protected Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon
static void CreateProcessInfoResponse (const ProcessInstanceInfo &proc_info, StreamString &response)
static void CreateProcessInfoResponse_DebugServerStyle (const ProcessInstanceInfo &proc_info, StreamString &response)

Protected Attributes

MainLoopm_mainloop
MainLoop::ReadHandleUP m_network_handle_up
NativeProcessProtocol::Managerm_process_manager
lldb::tid_t m_current_tid = LLDB_INVALID_THREAD_ID
lldb::tid_t m_continue_tid = LLDB_INVALID_THREAD_ID
NativeProcessProtocolm_current_process
NativeProcessProtocolm_continue_process
std::recursive_mutex m_debugged_process_mutex
std::unordered_map< lldb::pid_t, DebuggedProcessm_debugged_processes
Communication m_stdio_communication
MainLoop::ReadHandleUP m_stdio_handle_up
llvm::StringMap< std::unique_ptr< llvm::MemoryBuffer > > m_xfer_buffer_map
std::mutex m_saved_registers_mutex
std::unordered_map< uint32_t, lldb::DataBufferSPm_saved_registers_map
uint32_t m_next_saved_registers_id = 1
bool m_thread_suffix_supported = false
bool m_list_threads_in_stop_reply = false
bool m_non_stop = false
bool m_disabling_non_stop = false
std::deque< std::string > m_stdio_notification_queue
std::deque< std::string > m_stop_notification_queue
NativeProcessProtocol::Extension m_extensions_supported = {}
uint8_t m_reg_bytes [RegisterValue::kMaxRegisterByteSize]
Protected Attributes inherited from lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon
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

llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > BuildTargetXml ()
void HandleInferiorState_Exited (NativeProcessProtocol *process)
void HandleInferiorState_Stopped (NativeProcessProtocol *process)
NativeThreadProtocolGetThreadFromSuffix (StringExtractorGDBRemote &packet)
uint32_t GetNextSavedRegistersID ()
void MaybeCloseInferiorTerminalConnection ()
void ClearProcessSpecificData ()
void RegisterPacketHandlers ()
void DataAvailableCallback ()
void SendProcessOutput ()
void StartSTDIOForwarding ()
void StopSTDIOForwarding ()
void SetEnabledExtensions (NativeProcessProtocol &process)
 GDBRemoteCommunicationServerLLGS (const GDBRemoteCommunicationServerLLGS &)=delete
const GDBRemoteCommunicationServerLLGSoperator= (const GDBRemoteCommunicationServerLLGS &)=delete

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 32 of file GDBRemoteCommunicationServerLLGS.h.

Constructor & Destructor Documentation

◆ GDBRemoteCommunicationServerLLGS() [1/2]

◆ GDBRemoteCommunicationServerLLGS() [2/2]

lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::GDBRemoteCommunicationServerLLGS ( const GDBRemoteCommunicationServerLLGS & )
privatedelete

Member Function Documentation

◆ AddProcessThreads()

◆ AppendThreadIDToResponse()

void GDBRemoteCommunicationServerLLGS::AppendThreadIDToResponse ( Stream & response,
lldb::pid_t pid,
lldb::tid_t tid )
protected

◆ AttachToProcess()

Status GDBRemoteCommunicationServerLLGS::AttachToProcess ( lldb::pid_t pid)

Attach to a process.

This method supports attaching llgs to a process accessible via the configured Platform.

Returns
An Status object indicating the success or failure of the attach operation.

Definition at line 347 of file GDBRemoteCommunicationServerLLGS.cpp.

References lldb_private::Status::FromError(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::GetLog(), LLDB_LOGF, m_continue_process, m_current_process, m_debugged_processes, m_process_manager, and lldb_private::Process.

Referenced by AttachWaitProcess(), and Handle_vAttach().

◆ AttachWaitProcess()

Status GDBRemoteCommunicationServerLLGS::AttachWaitProcess ( llvm::StringRef process_name,
bool include_existing )

Wait to attach to a process with a given name.

This method supports waiting for the next instance of a process with a given name and attaching llgs to that via the configured Platform.

Returns
An Status object indicating the success or failure of the attach operation.

Definition at line 395 of file GDBRemoteCommunicationServerLLGS.cpp.

References AttachToProcess(), lldb_private::Equals, error(), lldb_private::Host::FindProcesses(), lldb_private::Stream::Format(), lldb_private::ProcessInfo::GetExecutableFile(), lldb_private::GetLog(), lldb_private::ProcessInstanceInfoMatch::GetProcessInfo(), lldb_private::StreamString::GetString(), LLDB_LOG, lldb_private::Process, lldb_private::FileSpec::SetFile(), lldb_private::ProcessInstanceInfoMatch::SetNameMatchType(), and lldb_private::Status.

Referenced by Handle_vAttachOrWait(), and Handle_vAttachWait().

◆ BuildTargetXml()

◆ ClearProcessSpecificData()

void GDBRemoteCommunicationServerLLGS::ClearProcessSpecificData ( )
private

◆ DataAvailableCallback()

◆ DidExec()

void GDBRemoteCommunicationServerLLGS::DidExec ( NativeProcessProtocol * process)
overridevirtual

◆ EnqueueStopReplyPackets()

◆ FindModuleFile()

FileSpec GDBRemoteCommunicationServerLLGS::FindModuleFile ( const std::string & module_path,
const ArchSpec & arch )
overrideprotectedvirtual

◆ GetContinueThreadID()

lldb::tid_t lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::GetContinueThreadID ( ) const
inlineprotected

Definition at line 285 of file GDBRemoteCommunicationServerLLGS.h.

References m_continue_tid.

Referenced by Handle_C(), and Handle_s().

◆ GetCurrentThreadID()

lldb::tid_t GDBRemoteCommunicationServerLLGS::GetCurrentThreadID ( ) const
protected

◆ GetNextSavedRegistersID()

uint32_t GDBRemoteCommunicationServerLLGS::GetNextSavedRegistersID ( )
private

◆ GetThreadFromSuffix()

◆ Handle__M()

◆ Handle__m()

◆ Handle_C()

◆ Handle_c()

◆ Handle_D()

◆ Handle_g()

◆ Handle_H()

◆ Handle_I()

◆ Handle_interrupt()

◆ Handle_jLLDBTraceGetBinaryData()

◆ Handle_jLLDBTraceGetState()

◆ Handle_jLLDBTraceStart()

◆ Handle_jLLDBTraceStop()

◆ Handle_jLLDBTraceSupported()

◆ Handle_jThreadsInfo()

◆ Handle_k()

◆ Handle_M()

◆ Handle_memory_read()

◆ Handle_P()

◆ Handle_p()

◆ Handle_qC()

◆ Handle_qFileLoadAddress()

◆ Handle_qfThreadInfo()

◆ Handle_qGetWorkingDir()

◆ Handle_QListThreadsInStopReply()

GDBRemoteCommunication::PacketResult GDBRemoteCommunicationServerLLGS::Handle_QListThreadsInStopReply ( StringExtractorGDBRemote & packet)
protected

◆ Handle_qMemoryRegionInfo()

◆ Handle_qMemoryRegionInfoSupported()

◆ Handle_QMemTags()

◆ Handle_qMemTags()

◆ Handle_QNonStop()

◆ Handle_QPassSignals()

◆ Handle_qProcessInfo()

◆ Handle_qRegisterInfo()

◆ Handle_QRestoreRegisterState()

◆ Handle_qSaveCore()

◆ Handle_QSaveRegisterState()

◆ Handle_QSetDisableASLR()

◆ Handle_QSetWorkingDir()

◆ Handle_qsThreadInfo()

GDBRemoteCommunication::PacketResult GDBRemoteCommunicationServerLLGS::Handle_qsThreadInfo ( StringExtractorGDBRemote & packet)
protected

◆ Handle_qStructuredDataPlugins()

◆ Handle_qThreadStopInfo()

◆ Handle_QThreadSuffixSupported()

GDBRemoteCommunication::PacketResult GDBRemoteCommunicationServerLLGS::Handle_QThreadSuffixSupported ( StringExtractorGDBRemote & packet)
protected

◆ Handle_qVAttachOrWaitSupported()

GDBRemoteCommunication::PacketResult GDBRemoteCommunicationServerLLGS::Handle_qVAttachOrWaitSupported ( StringExtractorGDBRemote & packet)
protected

◆ Handle_qWatchpointSupportInfo()

◆ Handle_qXfer()

◆ Handle_s()

◆ Handle_stop_reason()

◆ Handle_T()

◆ Handle_vAttach()

◆ Handle_vAttachOrWait()

◆ Handle_vAttachWait()

◆ Handle_vCont()

◆ Handle_vCont_actions()

◆ Handle_vCtrlC()

◆ Handle_vKill()

◆ Handle_vRun()

◆ Handle_vStdio()

GDBRemoteCommunication::PacketResult GDBRemoteCommunicationServerLLGS::Handle_vStdio ( StringExtractorGDBRemote & packet)
protected

◆ Handle_vStopped()

◆ Handle_Z()

◆ Handle_z()

◆ HandleFeatures()

std::vector< std::string > GDBRemoteCommunicationServerLLGS::HandleFeatures ( const llvm::ArrayRef< llvm::StringRef > client_features)
overrideprotectedvirtual

◆ HandleInferiorState_Exited()

◆ HandleInferiorState_Stopped()

◆ HandleNotificationAck()

◆ InitializeConnection()

Status GDBRemoteCommunicationServerLLGS::InitializeConnection ( std::unique_ptr< Connection > connection)

◆ InitializeDelegate()

◆ LaunchProcess()

Status GDBRemoteCommunicationServerLLGS::LaunchProcess ( )
overridevirtual

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.

Implements lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon.

Definition at line 264 of file GDBRemoteCommunicationServerLLGS.cpp.

References lldb_private::Status::FromError(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::GetLog(), m_continue_process, m_current_process, m_debugged_process_mutex, m_debugged_processes, lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::m_process_launch_info, m_process_manager, and lldb_private::Process.

Referenced by Handle_vRun().

◆ MaybeCloseInferiorTerminalConnection()

void GDBRemoteCommunicationServerLLGS::MaybeCloseInferiorTerminalConnection ( )
private

◆ NewSubprocess()

void GDBRemoteCommunicationServerLLGS::NewSubprocess ( NativeProcessProtocol * parent_process,
std::unique_ptr< NativeProcessProtocol > child_process )
overridevirtual

◆ operator=()

const GDBRemoteCommunicationServerLLGS & lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::operator= ( const GDBRemoteCommunicationServerLLGS & )
privatedelete

◆ PrepareStopReplyPacketForThread()

StreamString GDBRemoteCommunicationServerLLGS::PrepareStopReplyPacketForThread ( NativeThreadProtocol & thread)
protected

Definition at line 858 of file GDBRemoteCommunicationServerLLGS.cpp.

References AppendThreadIDToResponse(), lldb_private::Stream::AsRawOstream(), lldb_private::ThreadStopInfo::child_pid, lldb_private::ThreadStopInfo::child_tid, lldb_private::NativeRegisterContext::ConvertRegisterKindToRegisterNumber(), lldb_private::ThreadStopInfo::data, lldb_private::ThreadStopInfo::data_count, lldb_private::ThreadStopInfo::details, lldb::eByteOrderBig, lldb::eRegisterKindGeneric, error(), lldb::eStopReasonException, lldb::eStopReasonFork, lldb::eStopReasonVFork, lldb_private::ThreadStopInfo::exception, lldb_private::NativeProcessProtocol::fork, lldb_private::ThreadStopInfo::fork, lldb_private::Full, lldb_private::StreamString::GetData(), lldb_private::NativeRegisterContext::GetExpeditedRegisters(), lldb_private::NativeProcessProtocol::GetID(), GetJSONThreadsInfo(), lldb_private::GetLog(), lldb_private::NativeRegisterContext::GetRegisterInfoAtIndex(), GetStopReasonString(), lldb_private::endian::InlHostByteOrder(), LLDB_LOG, LLDB_LOG_ERROR, LLDB_LOGF, LLDB_REGNUM_GENERIC_PC, m_current_process, m_extensions_supported, m_list_threads_in_stop_reply, lldb_private::NativeProcessProtocol::multiprocess, lldb_private::RegisterInfo::name, lldb_private::Stream::Printf(), lldb_private::Process, lldb_private::Stream::PutChar(), lldb_private::Stream::PutCString(), lldb_private::Stream::PutHex32(), lldb_private::Stream::PutHex64(), lldb_private::Stream::PutHex8(), lldb_private::Stream::PutStringAsRawHex8(), lldb_private::NativeRegisterContext::ReadRegister(), lldb_private::ThreadStopInfo::reason, lldb_private::ThreadStopInfo::signo, lldb_private::Thread, lldb_private::NativeProcessProtocol::Threads(), lldb_private::ThreadStopInfo::type, lldb_private::RegisterInfo::value_regs, lldb_private::NativeProcessProtocol::vfork, and WriteRegisterValueInHexFixedWidth().

Referenced by EnqueueStopReplyPackets(), Handle_stop_reason(), and SendStopReplyPacketForThread().

◆ ProcessStateChanged()

◆ ReadXferObject()

llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > GDBRemoteCommunicationServerLLGS::ReadXferObject ( llvm::StringRef object,
llvm::StringRef annex )
protected

◆ RegisterPacketHandlers()

void GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers ( )
private

Definition at line 79 of file GDBRemoteCommunicationServerLLGS.cpp.

References error(), StringExtractorGDBRemote::eServerPacketType__M, StringExtractorGDBRemote::eServerPacketType__m, StringExtractorGDBRemote::eServerPacketType_C, StringExtractorGDBRemote::eServerPacketType_c, StringExtractorGDBRemote::eServerPacketType_D, StringExtractorGDBRemote::eServerPacketType_g, StringExtractorGDBRemote::eServerPacketType_H, StringExtractorGDBRemote::eServerPacketType_I, StringExtractorGDBRemote::eServerPacketType_interrupt, StringExtractorGDBRemote::eServerPacketType_jLLDBTraceGetBinaryData, StringExtractorGDBRemote::eServerPacketType_jLLDBTraceGetState, StringExtractorGDBRemote::eServerPacketType_jLLDBTraceStart, StringExtractorGDBRemote::eServerPacketType_jLLDBTraceStop, StringExtractorGDBRemote::eServerPacketType_jLLDBTraceSupported, StringExtractorGDBRemote::eServerPacketType_jThreadsInfo, StringExtractorGDBRemote::eServerPacketType_k, StringExtractorGDBRemote::eServerPacketType_M, StringExtractorGDBRemote::eServerPacketType_m, StringExtractorGDBRemote::eServerPacketType_P, StringExtractorGDBRemote::eServerPacketType_p, StringExtractorGDBRemote::eServerPacketType_qC, StringExtractorGDBRemote::eServerPacketType_qFileLoadAddress, StringExtractorGDBRemote::eServerPacketType_qfThreadInfo, StringExtractorGDBRemote::eServerPacketType_qGetWorkingDir, StringExtractorGDBRemote::eServerPacketType_QListThreadsInStopReply, StringExtractorGDBRemote::eServerPacketType_qLLDBSaveCore, StringExtractorGDBRemote::eServerPacketType_qMemoryRegionInfo, StringExtractorGDBRemote::eServerPacketType_qMemoryRegionInfoSupported, StringExtractorGDBRemote::eServerPacketType_QMemTags, StringExtractorGDBRemote::eServerPacketType_qMemTags, StringExtractorGDBRemote::eServerPacketType_QNonStop, StringExtractorGDBRemote::eServerPacketType_QPassSignals, StringExtractorGDBRemote::eServerPacketType_qProcessInfo, StringExtractorGDBRemote::eServerPacketType_qRegisterInfo, StringExtractorGDBRemote::eServerPacketType_QRestoreRegisterState, StringExtractorGDBRemote::eServerPacketType_QSaveRegisterState, StringExtractorGDBRemote::eServerPacketType_QSetDisableASLR, StringExtractorGDBRemote::eServerPacketType_QSetWorkingDir, StringExtractorGDBRemote::eServerPacketType_qsThreadInfo, StringExtractorGDBRemote::eServerPacketType_qStructuredDataPlugins, StringExtractorGDBRemote::eServerPacketType_qThreadStopInfo, StringExtractorGDBRemote::eServerPacketType_QThreadSuffixSupported, StringExtractorGDBRemote::eServerPacketType_qVAttachOrWaitSupported, StringExtractorGDBRemote::eServerPacketType_qWatchpointSupportInfo, StringExtractorGDBRemote::eServerPacketType_qXfer, StringExtractorGDBRemote::eServerPacketType_s, StringExtractorGDBRemote::eServerPacketType_stop_reason, StringExtractorGDBRemote::eServerPacketType_T, StringExtractorGDBRemote::eServerPacketType_vAttach, StringExtractorGDBRemote::eServerPacketType_vAttachOrWait, StringExtractorGDBRemote::eServerPacketType_vAttachWait, StringExtractorGDBRemote::eServerPacketType_vCont, StringExtractorGDBRemote::eServerPacketType_vCont_actions, StringExtractorGDBRemote::eServerPacketType_vCtrlC, StringExtractorGDBRemote::eServerPacketType_vKill, StringExtractorGDBRemote::eServerPacketType_vRun, StringExtractorGDBRemote::eServerPacketType_vStdio, StringExtractorGDBRemote::eServerPacketType_vStopped, StringExtractorGDBRemote::eServerPacketType_x, StringExtractorGDBRemote::eServerPacketType_Z, StringExtractorGDBRemote::eServerPacketType_z, Handle__M(), Handle__m(), Handle_C(), Handle_c(), Handle_D(), Handle_g(), Handle_H(), Handle_I(), Handle_interrupt(), Handle_jLLDBTraceGetBinaryData(), Handle_jLLDBTraceGetState(), Handle_jLLDBTraceStart(), Handle_jLLDBTraceStop(), Handle_jLLDBTraceSupported(), Handle_jThreadsInfo(), Handle_k(), Handle_M(), Handle_memory_read(), Handle_P(), Handle_p(), Handle_qC(), Handle_qFileLoadAddress(), Handle_qfThreadInfo(), Handle_qGetWorkingDir(), Handle_QListThreadsInStopReply(), Handle_qMemoryRegionInfo(), Handle_qMemoryRegionInfoSupported(), Handle_QMemTags(), Handle_qMemTags(), Handle_QNonStop(), Handle_QPassSignals(), Handle_qProcessInfo(), Handle_qRegisterInfo(), Handle_QRestoreRegisterState(), Handle_qSaveCore(), Handle_QSaveRegisterState(), Handle_QSetDisableASLR(), Handle_QSetWorkingDir(), Handle_qsThreadInfo(), Handle_qStructuredDataPlugins(), Handle_qThreadStopInfo(), Handle_QThreadSuffixSupported(), Handle_qVAttachOrWaitSupported(), Handle_qWatchpointSupportInfo(), Handle_qXfer(), Handle_s(), Handle_stop_reason(), Handle_T(), Handle_vAttach(), Handle_vAttachOrWait(), Handle_vAttachWait(), Handle_vCont(), Handle_vCont_actions(), Handle_vCtrlC(), Handle_vKill(), Handle_vRun(), Handle_vStdio(), Handle_vStopped(), Handle_Z(), Handle_z(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::RegisterMemberFunctionHandler(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::RegisterPacketHandler().

Referenced by GDBRemoteCommunicationServerLLGS().

◆ ResumeProcess()

◆ SendContinueSuccessResponse()

◆ SendONotification()

◆ SendProcessOutput()

◆ SendStopReasonForState()

◆ SendStopReplyPacketForThread()

◆ SendStructuredDataPacket()

◆ SendWResponse()

◆ SetContinueThreadID()

void GDBRemoteCommunicationServerLLGS::SetContinueThreadID ( lldb::tid_t tid)
protected

◆ SetCurrentThreadID()

void GDBRemoteCommunicationServerLLGS::SetCurrentThreadID ( lldb::tid_t tid)
protected

◆ SetEnabledExtensions()

void GDBRemoteCommunicationServerLLGS::SetEnabledExtensions ( NativeProcessProtocol & process)
private

◆ SetLaunchInfo()

void GDBRemoteCommunicationServerLLGS::SetLaunchInfo ( const ProcessLaunchInfo & info)

◆ SetSTDIOFileDescriptor()

Status GDBRemoteCommunicationServerLLGS::SetSTDIOFileDescriptor ( int fd)
protected

◆ StartSTDIOForwarding()

void GDBRemoteCommunicationServerLLGS::StartSTDIOForwarding ( )
private

◆ StopSTDIOForwarding()

void GDBRemoteCommunicationServerLLGS::StopSTDIOForwarding ( )
private

◆ XMLEncodeAttributeValue()

std::string GDBRemoteCommunicationServerLLGS::XMLEncodeAttributeValue ( llvm::StringRef value)
staticprotected

Definition at line 4278 of file GDBRemoteCommunicationServerLLGS.cpp.

Referenced by ReadXferObject().

Member Data Documentation

◆ m_continue_process

NativeProcessProtocol* lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_continue_process
protected

◆ m_continue_tid

lldb::tid_t lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_continue_tid = LLDB_INVALID_THREAD_ID
protected

Definition at line 108 of file GDBRemoteCommunicationServerLLGS.h.

Referenced by GetContinueThreadID(), and SetContinueThreadID().

◆ m_current_process

◆ m_current_tid

lldb::tid_t lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_current_tid = LLDB_INVALID_THREAD_ID
protected

Definition at line 107 of file GDBRemoteCommunicationServerLLGS.h.

Referenced by GetCurrentThreadID(), and SetCurrentThreadID().

◆ m_debugged_process_mutex

std::recursive_mutex lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_debugged_process_mutex
protected

Definition at line 111 of file GDBRemoteCommunicationServerLLGS.h.

Referenced by LaunchProcess().

◆ m_debugged_processes

◆ m_disabling_non_stop

bool lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_disabling_non_stop = false
protected

Definition at line 124 of file GDBRemoteCommunicationServerLLGS.h.

Referenced by Handle_QNonStop(), and SendStopReasonForState().

◆ m_extensions_supported

NativeProcessProtocol::Extension lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_extensions_supported = {}
protected

◆ m_list_threads_in_stop_reply

bool lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_list_threads_in_stop_reply = false
protected

◆ m_mainloop

MainLoop& lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_mainloop
protected

◆ m_network_handle_up

MainLoop::ReadHandleUP lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_network_handle_up
protected

Definition at line 105 of file GDBRemoteCommunicationServerLLGS.h.

Referenced by InitializeConnection().

◆ m_next_saved_registers_id

uint32_t lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_next_saved_registers_id = 1
protected

Definition at line 120 of file GDBRemoteCommunicationServerLLGS.h.

Referenced by GetNextSavedRegistersID().

◆ m_non_stop

◆ m_process_manager

NativeProcessProtocol::Manager& lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_process_manager
protected

◆ m_reg_bytes

uint8_t lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_reg_bytes[RegisterValue::kMaxRegisterByteSize]
protected

Definition at line 133 of file GDBRemoteCommunicationServerLLGS.h.

Referenced by Handle_P().

◆ m_saved_registers_map

std::unordered_map<uint32_t, lldb::DataBufferSP> lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_saved_registers_map
protected

◆ m_saved_registers_mutex

std::mutex lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_saved_registers_mutex
protected

◆ m_stdio_communication

Communication lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_stdio_communication
protected

◆ m_stdio_handle_up

MainLoop::ReadHandleUP lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_stdio_handle_up
protected

◆ m_stdio_notification_queue

std::deque<std::string> lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_stdio_notification_queue
protected

◆ m_stop_notification_queue

std::deque<std::string> lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_stop_notification_queue
protected

◆ m_thread_suffix_supported

bool lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_thread_suffix_supported = false
protected

◆ m_xfer_buffer_map

llvm::StringMap<std::unique_ptr<llvm::MemoryBuffer> > lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::m_xfer_buffer_map
protected

Definition at line 117 of file GDBRemoteCommunicationServerLLGS.h.

Referenced by ClearProcessSpecificData(), and Handle_qXfer().


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