29SBData::SBData(
const lldb::DataExtractorSP &data_sp) : m_opaque_sp(data_sp) {}
61 return this->
operator bool();
63SBData::operator bool()
const {
66 return m_opaque_sp.get() !=
nullptr;
122 error.SetErrorString(
"no value to read from");
126 if (offset == old_offset)
127 error.SetErrorString(
"unable to read data");
137 error.SetErrorString(
"no value to read from");
141 if (offset == old_offset)
142 error.SetErrorString(
"unable to read data");
150 long double value = 0;
152 error.SetErrorString(
"no value to read from");
156 if (offset == old_offset)
157 error.SetErrorString(
"unable to read data");
167 error.SetErrorString(
"no value to read from");
171 if (offset == old_offset)
172 error.SetErrorString(
"unable to read data");
182 error.SetErrorString(
"no value to read from");
186 if (offset == old_offset)
187 error.SetErrorString(
"unable to read data");
197 error.SetErrorString(
"no value to read from");
201 if (offset == old_offset)
202 error.SetErrorString(
"unable to read data");
212 error.SetErrorString(
"no value to read from");
216 if (offset == old_offset)
217 error.SetErrorString(
"unable to read data");
227 error.SetErrorString(
"no value to read from");
231 if (offset == old_offset)
232 error.SetErrorString(
"unable to read data");
242 error.SetErrorString(
"no value to read from");
245 value = (int8_t)
m_opaque_sp->GetMaxS64(&offset, 1);
246 if (offset == old_offset)
247 error.SetErrorString(
"unable to read data");
257 error.SetErrorString(
"no value to read from");
260 value = (int16_t)
m_opaque_sp->GetMaxS64(&offset, 2);
261 if (offset == old_offset)
262 error.SetErrorString(
"unable to read data");
272 error.SetErrorString(
"no value to read from");
275 value = (int32_t)
m_opaque_sp->GetMaxS64(&offset, 4);
276 if (offset == old_offset)
277 error.SetErrorString(
"unable to read data");
287 error.SetErrorString(
"no value to read from");
290 value = (int64_t)
m_opaque_sp->GetMaxS64(&offset, 8);
291 if (offset == old_offset)
292 error.SetErrorString(
"unable to read data");
300 const char *value =
nullptr;
302 error.SetErrorString(
"no value to read from");
306 if (offset == old_offset || (value ==
nullptr))
307 error.SetErrorString(
"unable to read data");
328 void *buf,
size_t size) {
333 error.SetErrorString(
"no value to read from");
337 if ((offset == old_offset) || (ok ==
nullptr))
338 error.SetErrorString(
"unable to read data");
340 return ok ? size : 0;
348 m_opaque_sp = std::make_shared<DataExtractor>(buf, size, endian, addr_size);
361 lldb::DataBufferSP buffer_sp = std::make_shared<DataBufferHeap>(buf, size);
364 m_opaque_sp = std::make_shared<DataExtractor>(buf, size, endian, addr_size);
386 if (!data || !data[0])
392 lldb::DataExtractorSP data_sp(
406 if (!array || array_len == 0)
409 size_t data_len = array_len *
sizeof(uint64_t);
411 lldb::DataBufferSP buffer_sp(
new DataBufferHeap(array, data_len));
412 lldb::DataExtractorSP data_sp(
426 if (!array || array_len == 0)
429 size_t data_len = array_len *
sizeof(
uint32_t);
431 lldb::DataBufferSP buffer_sp(
new DataBufferHeap(array, data_len));
432 lldb::DataExtractorSP data_sp(
446 if (!array || array_len == 0)
449 size_t data_len = array_len *
sizeof(int64_t);
451 lldb::DataBufferSP buffer_sp(
new DataBufferHeap(array, data_len));
452 lldb::DataExtractorSP data_sp(
466 if (!array || array_len == 0)
469 size_t data_len = array_len *
sizeof(int32_t);
471 lldb::DataBufferSP buffer_sp(
new DataBufferHeap(array, data_len));
472 lldb::DataExtractorSP data_sp(
486 if (!array || array_len == 0)
489 size_t data_len = array_len *
sizeof(double);
491 lldb::DataBufferSP buffer_sp(
new DataBufferHeap(array, data_len));
492 lldb::DataExtractorSP data_sp(
507 size_t data_len = strlen(data);
524 if (!array || array_len == 0) {
528 size_t data_len = array_len *
sizeof(uint64_t);
530 lldb::DataBufferSP buffer_sp(
new DataBufferHeap(array, data_len));
545 if (!array || array_len == 0) {
549 size_t data_len = array_len *
sizeof(
uint32_t);
551 lldb::DataBufferSP buffer_sp(
new DataBufferHeap(array, data_len));
565 if (!array || array_len == 0) {
569 size_t data_len = array_len *
sizeof(int64_t);
571 lldb::DataBufferSP buffer_sp(
new DataBufferHeap(array, data_len));
585 if (!array || array_len == 0) {
589 size_t data_len = array_len *
sizeof(int32_t);
591 lldb::DataBufferSP buffer_sp(
new DataBufferHeap(array, data_len));
605 if (!array || array_len == 0) {
609 size_t data_len = array_len *
sizeof(double);
611 lldb::DataBufferSP buffer_sp(
new DataBufferHeap(array, data_len));
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_INSTRUMENT_VA(...)
void SetDataWithOwnership(lldb::SBError &error, const void *buf, size_t size, lldb::ByteOrder endian, uint8_t addr_size)
lldb_private::DataExtractor * get() const
lldb::ByteOrder GetByteOrder()
void SetByteOrder(lldb::ByteOrder endian)
uint8_t GetUnsignedInt8(lldb::SBError &error, lldb::offset_t offset)
uint64_t GetUnsignedInt64(lldb::SBError &error, lldb::offset_t offset)
uint8_t GetAddressByteSize()
double GetDouble(lldb::SBError &error, lldb::offset_t offset)
bool SetDataFromSInt64Array(int64_t *array, size_t array_len)
size_t ReadRawData(lldb::SBError &error, lldb::offset_t offset, void *buf, size_t size)
static lldb::SBData CreateDataFromSInt64Array(lldb::ByteOrder endian, uint32_t addr_byte_size, int64_t *array, size_t array_len)
int8_t GetSignedInt8(lldb::SBError &error, lldb::offset_t offset)
bool Append(const SBData &rhs)
bool GetDescription(lldb::SBStream &description, lldb::addr_t base_addr=LLDB_INVALID_ADDRESS)
int16_t GetSignedInt16(lldb::SBError &error, lldb::offset_t offset)
lldb_private::DataExtractor * operator->() const
lldb::addr_t GetAddress(lldb::SBError &error, lldb::offset_t offset)
bool SetDataFromUInt32Array(uint32_t *array, size_t array_len)
void SetAddressByteSize(uint8_t addr_byte_size)
const char * GetString(lldb::SBError &error, lldb::offset_t offset)
uint32_t GetUnsignedInt32(lldb::SBError &error, lldb::offset_t offset)
static lldb::SBData CreateDataFromCString(lldb::ByteOrder endian, uint32_t addr_byte_size, const char *data)
static lldb::SBData CreateDataFromUInt32Array(lldb::ByteOrder endian, uint32_t addr_byte_size, uint32_t *array, size_t array_len)
bool SetDataFromCString(const char *data)
int32_t GetSignedInt32(lldb::SBError &error, lldb::offset_t offset)
void SetOpaque(const lldb::DataExtractorSP &data_sp)
static lldb::SBData CreateDataFromDoubleArray(lldb::ByteOrder endian, uint32_t addr_byte_size, double *array, size_t array_len)
bool SetDataFromUInt64Array(uint64_t *array, size_t array_len)
lldb::DataExtractorSP & operator*()
static lldb::SBData CreateDataFromUInt64Array(lldb::ByteOrder endian, uint32_t addr_byte_size, uint64_t *array, size_t array_len)
bool SetDataFromDoubleArray(double *array, size_t array_len)
uint16_t GetUnsignedInt16(lldb::SBError &error, lldb::offset_t offset)
long double GetLongDouble(lldb::SBError &error, lldb::offset_t offset)
float GetFloat(lldb::SBError &error, lldb::offset_t offset)
const SBData & operator=(const SBData &rhs)
static lldb::SBData CreateDataFromSInt32Array(lldb::ByteOrder endian, uint32_t addr_byte_size, int32_t *array, size_t array_len)
int64_t GetSignedInt64(lldb::SBError &error, lldb::offset_t offset)
bool SetDataFromSInt32Array(int32_t *array, size_t array_len)
void SetData(lldb::SBError &error, const void *buf, size_t size, lldb::ByteOrder endian, uint8_t addr_size)
lldb::DataExtractorSP m_opaque_sp
lldb_private::Stream & ref()
A subclass of DataBuffer that stores a data buffer on the heap.
A stream class that can stream formatted output to a file.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
A class that represents a running process on the host machine.
lldb::offset_t DumpDataExtractor(const DataExtractor &DE, Stream *s, lldb::offset_t offset, lldb::Format item_format, size_t item_byte_size, size_t item_count, size_t num_per_line, uint64_t base_addr, uint32_t item_bit_size, uint32_t item_bit_offset, ExecutionContextScope *exe_scope=nullptr, bool show_memory_tags=false)
Dumps item_count objects into the stream s.
ByteOrder
Byte ordering definitions.