9#ifndef LLDB_UTILITY_GDBREMOTE_H
10#define LLDB_UTILITY_GDBREMOTE_H
16#include "llvm/Support/JSON.h"
17#include "llvm/Support/raw_ostream.h"
50 template <
class T>
int PutAsJSON(
const T &obj,
bool hex_ascii) {
51 std::string json_string;
52 llvm::raw_string_ostream os(json_string);
53 os << llvm::json::Value(
toJSON(obj));
61 llvm::json::Array json_array;
62 for (
const auto &obj : array)
63 json_array.push_back(
toJSON(obj));
64 std::string json_string;
65 llvm::raw_string_ostream os(json_string);
66 os << llvm::json::Value(std::move(json_array));
~StreamGDBRemote() override
int PutAsJSON(const T &obj, bool hex_ascii)
int PutEscapedBytes(const void *s, size_t src_len)
Output a block of data to the stream performing GDB-remote escaping.
int PutAsJSONArray(const std::vector< T > &array, bool hex_ascii)
StreamString(bool colors=false)
A stream class that can stream formatted output to a file.
size_t PutStringAsRawHex8(llvm::StringRef s)
#define LLDB_INVALID_THREAD_ID
A class that represents a running process on the host machine.
llvm::json::Value toJSON(const AcceleratorActions &data)
ByteOrder
Byte ordering definitions.
void Dump(Stream &strm) const
uint32_t bytes_transmitted
llvm::StringRef GetTypeStr() const
GDBRemotePacket()=default