61 return this->
operator bool();
63SBData::operator bool()
const {
66 return m_opaque_sp.get() !=
nullptr;
122 error.SetErrorString(
"no value to read from");
124 uint32_t old_offset = offset;
126 if (offset == old_offset)
127 error.SetErrorString(
"unable to read data");
137 error.SetErrorString(
"no value to read from");
139 uint32_t old_offset = offset;
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");
154 uint32_t old_offset = offset;
156 if (offset == old_offset)
157 error.SetErrorString(
"unable to read data");
167 error.SetErrorString(
"no value to read from");
169 uint32_t old_offset = offset;
171 if (offset == old_offset)
172 error.SetErrorString(
"unable to read data");
182 error.SetErrorString(
"no value to read from");
184 uint32_t old_offset = offset;
186 if (offset == old_offset)
187 error.SetErrorString(
"unable to read data");
197 error.SetErrorString(
"no value to read from");
199 uint32_t old_offset = offset;
201 if (offset == old_offset)
202 error.SetErrorString(
"unable to read data");
212 error.SetErrorString(
"no value to read from");
214 uint32_t old_offset = offset;
216 if (offset == old_offset)
217 error.SetErrorString(
"unable to read data");
227 error.SetErrorString(
"no value to read from");
229 uint32_t old_offset = offset;
231 if (offset == old_offset)
232 error.SetErrorString(
"unable to read data");
242 error.SetErrorString(
"no value to read from");
244 uint32_t old_offset = offset;
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");
259 uint32_t old_offset = offset;
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");
274 uint32_t old_offset = offset;
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");
289 uint32_t old_offset = offset;
290 value = (int64_t)
m_opaque_sp->GetMaxS64(&offset, 8);
291 if (offset == old_offset)
292 error.SetErrorString(
"unable to read data");
301 error.SetErrorString(
"no value to read from");
307 if (offset == old_offset || value ==
nullptr) {
308 error.SetErrorString(
"unable to read data");
331 void *buf,
size_t size) {
336 error.SetErrorString(
"no value to read from");
338 uint32_t old_offset = offset;
340 if ((offset == old_offset) || (ok ==
nullptr))
341 error.SetErrorString(
"unable to read data");
343 return ok ? size : 0;
351 m_opaque_sp = std::make_shared<DataExtractor>(buf, size, endian, addr_size);
367 m_opaque_sp = std::make_shared<DataExtractor>(buf, size, endian, addr_size);
385 uint32_t addr_byte_size,
389 if (!data || !data[0])
392 uint32_t data_len = strlen(data);
404 uint32_t addr_byte_size,
409 if (!array || array_len == 0)
412 size_t data_len = array_len *
sizeof(uint64_t);
424 uint32_t addr_byte_size,
429 if (!array || array_len == 0)
432 size_t data_len = array_len *
sizeof(uint32_t);
444 uint32_t addr_byte_size,
449 if (!array || array_len == 0)
452 size_t data_len = array_len *
sizeof(int64_t);
464 uint32_t addr_byte_size,
469 if (!array || array_len == 0)
472 size_t data_len = array_len *
sizeof(int32_t);
484 uint32_t addr_byte_size,
489 if (!array || array_len == 0)
492 size_t data_len = array_len *
sizeof(double);
510 size_t data_len = strlen(data);
527 if (!array || array_len == 0) {
531 size_t data_len = array_len *
sizeof(uint64_t);
548 if (!array || array_len == 0) {
552 size_t data_len = array_len *
sizeof(uint32_t);
568 if (!array || array_len == 0) {
572 size_t data_len = array_len *
sizeof(int64_t);
588 if (!array || array_len == 0) {
592 size_t data_len = array_len *
sizeof(int32_t);
608 if (!array || array_len == 0) {
612 size_t data_len = array_len *
sizeof(double);
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 uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
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.
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::shared_ptr< lldb_private::DataExtractor > DataExtractorSP