9#ifndef LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECOMMUNICATION_H
10#define LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECOMMUNICATION_H
14#include <condition_variable>
22#include "lldb/Host/Config.h"
35namespace process_gdb_remote {
74 "size of GDBRemoteFStatData is not 64");
77#define HANDLE_ERRNO(name, value) GDB_##name = value,
78#include "Plugins/Process/gdb-remote/GDBRemoteErrno.def"
82class ProcessGDBRemote;
108 std::chrono::seconds timeout);
145 return old_packet_timeout;
171 static std::string
ExpandRLE(std::string);
189 std::deque<std::string>& queue,
190 llvm::StringRef payload);
192 bool skip_ack =
false);
199 bool sync_on_timeout);
230#if defined(HAVE_LIBCOMPRESSION)
232 void *m_decompression_scratch =
nullptr;
245struct format_provider<
246 lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult> {
248 GDBRemoteCommunication::PacketResult &state,
249 raw_ostream &Stream, StringRef Style);
A command line argument class.
An abstract communications class.
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
std::chrono::seconds SetPacketTimeout(std::chrono::seconds packet_timeout)
GDBRemoteCommunication(const GDBRemoteCommunication &)=delete
static llvm::Error ConnectLocally(GDBRemoteCommunication &client, GDBRemoteCommunication &server)
PacketResult ReadPacket(StringExtractorGDBRemote &response, Timeout< std::micro > timeout, bool sync_on_timeout)
char CalculcateChecksum(llvm::StringRef payload)
lldb::thread_result_t ListenThread()
~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
PacketResult SendPacketNoLock(llvm::StringRef payload)
HostThread m_listen_thread
Status StartListenThread(const char *hostname="127.0.0.1", uint16_t port=0)
const GDBRemoteCommunication & operator=(const GDBRemoteCommunication &)=delete
std::promise< uint16_t > m_port_promise
FileSpec GetDebugserverPath(Platform *platform)
Status StartDebugserverProcess(const char *url, Platform *platform, ProcessLaunchInfo &launch_info, uint16_t *port, const Args *inferior_args, shared_fd_t pass_comm_fd)
void SetPacketRecorder(repro::PacketRecorder *recorder)
static std::string ExpandRLE(std::string)
Expand GDB run-length encoding.
std::chrono::seconds GetPacketTimeout() const
std::chrono::seconds m_packet_timeout
PacketType CheckForPacket(const uint8_t *src, size_t src_len, StringExtractorGDBRemote &packet)
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