|
LLDB mainline
|
#include <GDBRemoteCommunication.h>
Classes | |
| class | ScopedTimeout |
Public Types | |
| enum class | PacketType { Invalid = 0 , Standard , Notify } |
| enum class | PacketResult { Success = 0 , ErrorSendFailed , ErrorSendAck , ErrorReplyFailed , ErrorReplyTimeout , ErrorReplyInvalid , ErrorReplyAck , ErrorDisconnected , ErrorNoSequenceLock } |
Public Member Functions | |
| GDBRemoteCommunication (llvm::StringRef name) | |
Construct a GDB-remote communication channel named 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) |
| PacketType | CheckForPacketIgnoreNotifications (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::Connection * | GetConnection () |
| 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) |
Static Public Member Functions | |
| 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) |
Protected Member Functions | |
| 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) |
Protected Attributes | |
| 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 |
| size_t | m_hash_search_start = 0 |
| Where CheckForPacket resumes its search for the '#' that ends the first packet in m_bytes. | |
| size_t | m_hash_search_bytes_size = 0 |
| m_bytes.size() when m_hash_search_start was recorded, so CheckForPacket can assert that nothing else changed 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 | |
| GDBRemoteCommunication (const GDBRemoteCommunication &)=delete | |
| const GDBRemoteCommunication & | operator= (const GDBRemoteCommunication &)=delete |
Private Attributes | |
| const std::string | m_name |
| The communication channel name included in packet logs. | |
Definition at line 76 of file GDBRemoteCommunication.h.
|
strong |
| Enumerator | |
|---|---|
| Success | |
| ErrorSendFailed | |
| ErrorSendAck | |
| ErrorReplyFailed | |
| ErrorReplyTimeout | |
| ErrorReplyInvalid | |
| ErrorReplyAck | |
| ErrorDisconnected | |
| ErrorNoSequenceLock | |
Definition at line 80 of file GDBRemoteCommunication.h.
|
strong |
| Enumerator | |
|---|---|
| Invalid | |
| Standard | |
| Notify | |
Definition at line 78 of file GDBRemoteCommunication.h.
|
explicit |
Construct a GDB-remote communication channel named name.
The name identifies the channel in packet logs.
Definition at line 50 of file GDBRemoteCommunication.cpp.
References lldb_private::Communication::Communication(), lldb_private::eLazyBoolCalculate, m_compression_type, m_echo_number, m_history, m_is_platform, m_name, m_packet_timeout, m_send_acks, m_supports_qEcho, and lldb_private::process_gdb_remote::None.
Referenced by lldb_private::process_gdb_remote::GDBRemoteClientBase::GDBRemoteClientBase(), GDBRemoteCommunication(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GDBRemoteCommunicationServer(), operator=(), and lldb_private::process_gdb_remote::GDBRemoteCommunication::ScopedTimeout::ScopedTimeout().
|
override |
Definition at line 63 of file GDBRemoteCommunication.cpp.
References lldb_private::Communication::Disconnect(), and lldb_private::Communication::IsConnected().
|
privatedelete |
References GDBRemoteCommunication().
| char GDBRemoteCommunication::CalculcateChecksum | ( | llvm::StringRef | payload | ) |
Definition at line 74 of file GDBRemoteCommunication.cpp.
Referenced by CheckForPacket(), DecompressPacket(), SendNotificationPacketNoLock(), and SendPacketNoLock().
| GDBRemoteCommunication::PacketType GDBRemoteCommunication::CheckForPacket | ( | const uint8_t * | src, |
| size_t | src_len, | ||
| StringExtractorGDBRemote & | packet ) |
Definition at line 691 of file GDBRemoteCommunication.cpp.
References AddToLog(), CalculcateChecksum(), StringExtractor::Clear(), CompressionIsEnabled(), DecompressPacket(), lldb_private::GDBRemotePacket::ePacketTypeRecv, ExpandRLE(), lldb_private::GetLog(), GetSendAcks(), lldb_private::Log::GetVerbose(), Invalid, LLDB_LOGF, m_bytes, m_bytes_mutex, m_hash_search_bytes_size, m_hash_search_start, m_history, m_name, Notify, lldb_private::process_gdb_remote::Packets, SendAck(), SendNack(), StringExtractor::SetFilePos(), and Standard.
Referenced by CheckForPacketIgnoreNotifications().
| GDBRemoteCommunication::PacketType GDBRemoteCommunication::CheckForPacketIgnoreNotifications | ( | const uint8_t * | src, |
| size_t | src_len, | ||
| StringExtractorGDBRemote & | packet ) |
Definition at line 878 of file GDBRemoteCommunication.cpp.
References CheckForPacket(), Invalid, Notify, and Standard.
Referenced by WaitForPacketNoLock().
|
inlineprotected |
Definition at line 195 of file GDBRemoteCommunication.h.
References m_compression_type, and lldb_private::process_gdb_remote::None.
Referenced by CheckForPacket(), and DecompressPacket().
|
protected |
Definition at line 400 of file GDBRemoteCommunication.cpp.
References CalculcateChecksum(), CompressionIsEnabled(), lldb_private::GetLog(), GetSendAcks(), LLDB_LOGF, lldb_private::process_gdb_remote::LZ4, lldb_private::process_gdb_remote::LZFSE, lldb_private::process_gdb_remote::LZMA, m_bytes, m_compression_type, lldb_private::process_gdb_remote::Packets, SendAck(), SendNack(), and lldb_private::process_gdb_remote::ZlibDeflate.
Referenced by CheckForPacket().
| void GDBRemoteCommunication::DumpHistory | ( | Stream & | strm | ) |
Definition at line 1079 of file GDBRemoteCommunication.cpp.
References m_history.
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::DumpPluginHistory().
|
static |
Expand GDB run-length encoding.
Definition at line 1136 of file GDBRemoteCommunication.cpp.
Referenced by CheckForPacket().
| GDBRemoteCommunication::PacketResult GDBRemoteCommunication::GetAck | ( | ) |
Definition at line 207 of file GDBRemoteCommunication.cpp.
References StringExtractorGDBRemote::eAck, ErrorSendAck, GetPacketTimeout(), StringExtractorGDBRemote::GetResponseType(), Success, and WaitForPacketNoLock().
Referenced by SendRawPacketNoLock().
|
inline |
Definition at line 147 of file GDBRemoteCommunication.h.
References m_packet_timeout.
Referenced by GetAck(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::KillProcess(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::QueryNoAckModeSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunication::ScopedTimeout::ScopedTimeout(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendPacketAndReceiveResponseWithOutputSupport(), and lldb_private::process_gdb_remote::GDBRemoteClientBase::SendPacketAndWaitForResponseNoLock().
|
inline |
Definition at line 134 of file GDBRemoteCommunication.h.
References m_send_acks.
Referenced by CheckForPacket(), DecompressPacket(), and SendRawPacketNoLock().
|
privatedelete |
References GDBRemoteCommunication().
|
protected |
Definition at line 221 of file GDBRemoteCommunication.cpp.
References lldb_private::GetLog(), StringExtractorGDBRemote::GetResponseType(), StringExtractor::GetStringRef(), LLDB_LOG, lldb_private::process_gdb_remote::Packets, Success, and WaitForPacketNoLock().
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(), lldb_private::process_gdb_remote::GDBRemoteClientBase::ReadPacketWithOutputSupport(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendContinuePacketAndWaitForResponse(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendPacketAndWaitForResponseNoLock(), and lldb_private::process_gdb_remote::GDBRemoteClientBase::ShouldStop().
| size_t GDBRemoteCommunication::SendAck | ( | ) |
Definition at line 83 of file GDBRemoteCommunication.cpp.
References lldb::eConnectionStatusSuccess, lldb_private::GDBRemotePacket::ePacketTypeSend, lldb_private::GetLog(), LLDB_LOGF, m_history, m_name, lldb_private::process_gdb_remote::Packets, and lldb_private::Communication::WriteAll().
Referenced by CheckForPacket(), DecompressPacket(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::HandshakeWithServer().
| size_t GDBRemoteCommunication::SendNack | ( | ) |
Definition at line 94 of file GDBRemoteCommunication.cpp.
References lldb::eConnectionStatusSuccess, lldb_private::GDBRemotePacket::ePacketTypeSend, lldb_private::GetLog(), LLDB_LOGF, m_history, m_name, lldb_private::process_gdb_remote::Packets, and lldb_private::Communication::WriteAll().
Referenced by CheckForPacket(), and DecompressPacket().
|
protected |
Definition at line 118 of file GDBRemoteCommunication.cpp.
References CalculcateChecksum(), lldb::eByteOrderBig, lldb_private::StreamString::GetString(), lldb_private::Stream::PutChar(), lldb_private::Stream::PutHex8(), SendRawPacketNoLock(), Success, and lldb_private::Stream::Write().
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendONotification(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendWResponse().
|
protected |
Definition at line 106 of file GDBRemoteCommunication.cpp.
References CalculcateChecksum(), lldb::eByteOrderBig, lldb_private::StreamString::GetString(), lldb_private::Stream::PutChar(), lldb_private::Stream::PutHex8(), SendRawPacketNoLock(), and lldb_private::Stream::Write().
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle__M(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_g(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jAcceleratorPluginBreakpointHit(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jAcceleratorPluginGetDynamicLoaderLibraryInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jAcceleratorPluginInitialize(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jAddressSpacesInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jLLDBSettings(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jLLDBTraceGetBinaryData(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_jModulesInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jMultiBreakpoint(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jThreadExtendedInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jThreadsInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_memory_read(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_p(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qC(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qC(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qEcho(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qFileLoadAddress(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qGetWorkingDir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qGetWorkingDir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qGroupName(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qHostInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qLaunchGDBServer(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qLaunchSuccess(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qMemoryRegionInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qMemTags(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qModuleInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qPathComplete(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_chmod(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_mkdir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_shell(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qProcessInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qProcessInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qProcessInfoPID(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qQueryGDBServer(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qRegisterInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qSaveCore(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QSaveRegisterState(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qSpeedTest(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qsProcessInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qsThreadInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qUserName(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qWatchpointSupportInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qXfer(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_stop_reason(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vCont_actions(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Close(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Exists(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_FStat(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_MD5(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Mode(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Open(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_pRead(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_pWrite(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Size(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_symlink(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_unlink(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::HandleNotificationAck(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::SendErrorResponse(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::SendErrorResponse(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::SendOKResponse(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendONotification(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendPacketAndReceiveResponseWithOutputSupport(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendPacketAndWaitForResponseNoLock(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendStructuredDataPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::SendUnimplementedResponse(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendWResponse(), and WaitForPacketNoLock().
|
protected |
Definition at line 141 of file GDBRemoteCommunication.cpp.
References lldb::eConnectionStatusSuccess, lldb_private::GDBRemotePacket::ePacketTypeSend, ErrorSendFailed, GetAck(), lldb_private::GetLog(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetPacketTestDelay(), GetSendAcks(), lldb_private::StreamString::GetString(), lldb_private::Communication::IsConnected(), LLDB_LOGF, m_history, m_name, lldb_private::process_gdb_remote::Packets, lldb_private::Stream::Printf(), lldb_private::Log::PutString(), Success, and lldb_private::Communication::WriteAll().
Referenced by SendNotificationPacketNoLock(), and SendPacketNoLock().
|
inline |
Definition at line 141 of file GDBRemoteCommunication.h.
References m_packet_timeout.
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetHostInfo().
|
static |
Definition at line 901 of file GDBRemoteCommunication.cpp.
References lldb_private::Args::AppendArgument(), lldb_private::Args::AppendArguments(), lldb_private::ProcessLaunchInfo::AppendCloseFileAction(), lldb_private::ProcessLaunchInfo::AppendDuplicateFileAction(), lldb_private::ProcessLaunchInfo::AppendSuppressFileAction(), lldb_private::PipePosix::CanRead(), lldb_private::PipePosix::CanWrite(), lldb_private::PipePosix::Close(), lldb_private::PipePosix::CloseWriteFileDescriptor(), lldb_private::PipePosix::CreateNew(), lldb_private::PipePosix::CreateWithUniqueName(), lldb_private::PipePosix::Delete(), lldb_private::ProcessInfo::Dump(), error(), lldb_private::Status::Fail(), lldb_private::Status::FromError(), lldb_private::Args::GetArgumentCount(), lldb_private::ProcessInfo::GetArguments(), lldb_private::StreamString::GetData(), lldb_private::Host::GetEnvironment(), lldb_private::ProcessInfo::GetEnvironment(), lldb_private::ProcessLaunchInfo::GetLaunchInSeparateProcessGroup(), lldb_private::GetLog(), lldb_private::PipePosix::GetWritePipe(), lldb_private::SharedSocket::kInvalidFD, lldb_private::Host::LaunchProcess(), LLDB_LOG, LLDB_LOGF, lldb_private::PipePosix::OpenAsReader(), lldb_private::process_gdb_remote::Process, lldb_private::PipePosix::Read(), and lldb_private::Status.
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::LaunchGDBServer().
|
protected |
Sync the remote GDB server and make sure we get a response that corresponds to what we send.
Sends a "qEcho" packet and makes sure it gets the exact packet echoed back. If the qEcho packet isn't supported, we send a qC packet and make sure we get a valid thread ID back. We use the "qC" packet since its response if very unique: is responds with "QC%x" where x is the thread ID of the current thread. This makes the response unique enough from other packet responses to ensure we are back on track.
This packet is needed after we time out sending a packet so we can ensure that we are getting the response for the packet we are sending. There are no sequence IDs in the GDB remote protocol (there used to be, but they are not supported anymore) so if you timeout sending packet "abc", you might then send packet "cde" and get the response for the previous "abc" packet. Many responses are "OK" or "" (unsupported) or "EXX" (error) so many responses for packets can look like responses for other packets. So if we timeout, we need to ensure that we can get back on track. If we can't get back on track, we must disconnect.
Definition at line 239 of file GDBRemoteCommunication.cpp.
References CheckForPacketIgnoreNotifications(), StringExtractor::Clear(), lldb_private::Communication::ConnectionStatusAsString(), lldb_private::Communication::Disconnect(), lldb::eConnectionStatusEndOfFile, lldb::eConnectionStatusError, lldb::eConnectionStatusInterrupted, lldb::eConnectionStatusLostConnection, lldb::eConnectionStatusNoConnection, lldb::eConnectionStatusSuccess, lldb::eConnectionStatusTimedOut, lldb_private::eLazyBoolYes, error(), ErrorDisconnected, ErrorReplyFailed, ErrorReplyTimeout, lldb_private::RegularExpression::Execute(), lldb_private::GetLog(), StringExtractor::GetStringRef(), Invalid, lldb_private::Communication::IsConnected(), LLDB_LOG_VERBOSE, m_echo_number, m_supports_qEcho, Notify, lldb_private::process_gdb_remote::Packets, lldb_private::Communication::Read(), lldb_private::RegularExpression, SendPacketNoLock(), Standard, Success, and WaitForPacketNoLock().
Referenced by GetAck(), ReadPacket(), and WaitForPacketNoLock().
|
protected |
Definition at line 171 of file GDBRemoteCommunication.h.
Referenced by CheckForPacket(), and DecompressPacket().
|
protected |
Definition at line 178 of file GDBRemoteCommunication.h.
Referenced by CheckForPacket().
|
protected |
Definition at line 179 of file GDBRemoteCommunication.h.
Referenced by CompressionIsEnabled(), DecompressPacket(), GDBRemoteCommunication(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::MaybeEnableCompression().
|
protected |
Definition at line 163 of file GDBRemoteCommunication.h.
Referenced by GDBRemoteCommunication(), and WaitForPacketNoLock().
|
protected |
m_bytes.size() when m_hash_search_start was recorded, so CheckForPacket can assert that nothing else changed m_bytes.
Definition at line 177 of file GDBRemoteCommunication.h.
Referenced by CheckForPacket().
|
protected |
Where CheckForPacket resumes its search for the '#' that ends the first packet in m_bytes.
Nonzero only while that packet is incomplete.
Definition at line 174 of file GDBRemoteCommunication.h.
Referenced by CheckForPacket().
|
protected |
Definition at line 165 of file GDBRemoteCommunication.h.
Referenced by CheckForPacket(), DumpHistory(), GDBRemoteCommunication(), SendAck(), SendNack(), and SendRawPacketNoLock().
|
protected |
Definition at line 167 of file GDBRemoteCommunication.h.
Referenced by GDBRemoteCommunication().
|
private |
The communication channel name included in packet logs.
Definition at line 212 of file GDBRemoteCommunication.h.
Referenced by CheckForPacket(), GDBRemoteCommunication(), SendAck(), SendNack(), and SendRawPacketNoLock().
|
protected |
Definition at line 162 of file GDBRemoteCommunication.h.
Referenced by GDBRemoteCommunication(), GetPacketTimeout(), and SetPacketTimeout().
|
protected |
Definition at line 166 of file GDBRemoteCommunication.h.
Referenced by GDBRemoteCommunication(), GetSendAcks(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QStartNoAckMode(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::QueryNoAckModeSupported().
|
protected |