File indexing completed on 2026-05-10 08:42:57
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_UTILITY_GDBREMOTE_H
0010 #define LLDB_UTILITY_GDBREMOTE_H
0011
0012 #include "lldb/Utility/FileSpec.h"
0013 #include "lldb/Utility/StreamString.h"
0014 #include "lldb/lldb-enumerations.h"
0015 #include "lldb/lldb-public.h"
0016 #include "llvm/Support/raw_ostream.h"
0017
0018 #include <cstddef>
0019 #include <cstdint>
0020 #include <string>
0021 #include <vector>
0022
0023 namespace lldb_private {
0024
0025 class StreamGDBRemote : public StreamString {
0026 public:
0027 StreamGDBRemote();
0028
0029 StreamGDBRemote(uint32_t flags, uint32_t addr_size,
0030 lldb::ByteOrder byte_order);
0031
0032 ~StreamGDBRemote() override;
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045 int PutEscapedBytes(const void *s, size_t src_len);
0046 };
0047
0048
0049
0050 struct GDBRemotePacket {
0051
0052 enum Type { ePacketTypeInvalid = 0, ePacketTypeSend, ePacketTypeRecv };
0053
0054 GDBRemotePacket() = default;
0055
0056 void Clear() {
0057 packet.data.clear();
0058 type = ePacketTypeInvalid;
0059 bytes_transmitted = 0;
0060 packet_idx = 0;
0061 tid = LLDB_INVALID_THREAD_ID;
0062 }
0063
0064 struct BinaryData {
0065 std::string data;
0066 };
0067
0068 void Dump(Stream &strm) const;
0069
0070 BinaryData packet;
0071 Type type = ePacketTypeInvalid;
0072 uint32_t bytes_transmitted = 0;
0073 uint32_t packet_idx = 0;
0074 lldb::tid_t tid = LLDB_INVALID_THREAD_ID;
0075
0076 private:
0077 llvm::StringRef GetTypeStr() const;
0078 };
0079
0080 }
0081
0082 #endif