9#ifndef LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECOMMUNICATION_H
10#define LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECOMMUNICATION_H
14#include "lldb/Host/Config.h"
66 "size of GDBRemoteFStatData is not 64");
69#define HANDLE_ERRNO(name, value) GDB_##name = value,
70#include "Plugins/Process/gdb-remote/GDBRemoteErrno.def"
74class ProcessGDBRemote;
100 std::chrono::seconds timeout);
144 return old_packet_timeout;
154 const Args *inferior_args);
159 static std::optional<std::string>
ExpandRLE(std::string);
183 std::deque<std::string>& queue,
184 llvm::StringRef payload);
186 bool skip_ack =
false);
193 bool sync_on_timeout);
214#if HAVE_LIBCOMPRESSION
216 void *m_decompression_scratch =
nullptr;
229struct format_provider<
230 lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult> {
232 GDBRemoteCommunication::PacketResult &state,
233 raw_ostream &Stream, StringRef Style);
A command line argument class.
Communication()
Construct the Communication object.
A stream class that can stream formatted output to a file.
The history keeps a circular buffer of GDB remote packets.
std::chrono::seconds m_saved_timeout
GDBRemoteCommunication & m_gdb_comm
ScopedTimeout(GDBRemoteCommunication &gdb_comm, std::chrono::seconds timeout)
const std::string m_name
The communication channel name included in packet logs.
std::chrono::seconds SetPacketTimeout(std::chrono::seconds packet_timeout)
GDBRemoteCommunication(const GDBRemoteCommunication &)=delete
PacketResult ReadPacket(StringExtractorGDBRemote &response, Timeout< std::micro > timeout, bool sync_on_timeout)
GDBRemoteCommunication(llvm::StringRef name)
Construct a GDB-remote communication channel named name.
char CalculcateChecksum(llvm::StringRef payload)
~GDBRemoteCommunication() override
PacketResult SendNotificationPacketNoLock(llvm::StringRef notify_type, std::deque< std::string > &queue, llvm::StringRef payload)
std::recursive_mutex m_bytes_mutex
PacketResult WaitForPacketNoLock(StringExtractorGDBRemote &response, Timeout< std::micro > timeout, bool sync_on_timeout)
void DumpHistory(Stream &strm)
bool CompressionIsEnabled()
LazyBool m_supports_qEcho
PacketResult SendRawPacketNoLock(llvm::StringRef payload, bool skip_ack=false)
CompressionType m_compression_type
static Status StartDebugserverProcess(std::variant< llvm::StringRef, shared_fd_t > comm, ProcessLaunchInfo &launch_info, const Args *inferior_args)
PacketResult SendPacketNoLock(llvm::StringRef payload)
PacketType CheckForPacketIgnoreNotifications(const uint8_t *src, size_t src_len, StringExtractorGDBRemote &packet)
const GDBRemoteCommunication & operator=(const GDBRemoteCommunication &)=delete
static std::optional< std::string > ExpandRLE(std::string)
Expand GDB run-length encoding.
std::chrono::seconds GetPacketTimeout() const
size_t m_hash_search_bytes_size
m_bytes.size() when m_hash_search_start was recorded, so CheckForPacket can assert that nothing else ...
std::chrono::seconds m_packet_timeout
PacketType CheckForPacket(const uint8_t *src, size_t src_len, StringExtractorGDBRemote &packet)
size_t m_hash_search_start
Where CheckForPacket resumes its search for the '#' that ends the first packet in m_bytes.
GDBRemoteCommunicationHistory m_history
A class that represents a running process on the host machine.
llvm::support::ubig32_t gdb_st_ctime
llvm::support::ubig32_t gdb_st_dev
llvm::support::ubig64_t gdb_st_blksize
llvm::support::ubig64_t gdb_st_blocks
llvm::support::ubig32_t gdb_st_ino
llvm::support::ubig32_t gdb_st_gid
llvm::support::ubig32_t gdb_st_mtime
llvm::support::ubig32_t gdb_st_atime
llvm::support::ubig32_t gdb_st_uid
llvm::support::ubig32_t gdb_st_nlink
llvm::support::ubig32_t gdb_st_rdev
llvm::support::ubig64_t gdb_st_size
llvm::support::ubig32_t gdb_st_mode