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"
34namespace process_gdb_remote {
73 "size of GDBRemoteFStatData is not 64");
76#define HANDLE_ERRNO(name, value) GDB_##name = value,
77#include "Plugins/Process/gdb-remote/GDBRemoteErrno.def"
81class ProcessGDBRemote;
107 std::chrono::seconds timeout);
144 return old_packet_timeout;
167 static std::string
ExpandRLE(std::string);
185 std::deque<std::string>& queue,
186 llvm::StringRef payload);
188 bool skip_ack =
false);
195 bool sync_on_timeout);
226#if defined(HAVE_LIBCOMPRESSION)
228 void *m_decompression_scratch =
nullptr;
241struct format_provider<
242 lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult> {
244 GDBRemoteCommunication::PacketResult &state,
245 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)
Status StartDebugserverProcess(const char *url, Platform *platform, ProcessLaunchInfo &launch_info, uint16_t *port, const Args *inferior_args, int pass_comm_fd)
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
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