16#include "llvm/Support/ErrorExtras.h"
87 return llvm::createStringError(
88 "failed to determine start/end of vector data");
90 uint64_t start_val =
m_start->GetValueAsUnsigned(0);
91 uint64_t finish_val =
m_finish->GetValueAsUnsigned(0);
94 if (start_val == 0 && finish_val == 0)
98 return llvm::createStringError(
"invalid value for start of vector");
101 return llvm::createStringError(
"invalid value for end of vector");
103 if (start_val > finish_val)
104 return llvm::createStringError(
105 "start of vector data begins after end pointer");
107 size_t num_children = (finish_val - start_val);
109 return llvm::createStringError(
"size not multiple of element size");
121 offset = offset +
m_start->GetValueAsUnsigned(0);
123 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
130 auto [cap_sp, is_compressed_pair] =
135 if (is_compressed_pair)
150 llvm::Expected<uint64_t> size_or_err =
m_element_type.GetByteSize(
nullptr);
166llvm::Expected<size_t>
170 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
173 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
175 return *optional_idx;
206 size_t byte_idx = (idx >> 3);
207 size_t bit_index = (idx & 7);
215 size_t bytes_read = process_sp->ReadMemory(byte_location, &
byte, 1, err);
216 if (err.
Fail() || bytes_read == 0)
218 mask = 1 << bit_index;
219 bool bit_set = ((
byte & mask) != 0);
220 std::optional<uint64_t> size =
221 llvm::expectedToOptional(
m_bool_type.GetByteSize(
nullptr));
225 if (bit_set && buffer_sp && buffer_sp->GetBytes()) {
227 *(buffer_sp->GetBytes()) = 1;
230 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
234 process_sp->GetAddressByteSize()),
248 ValueObjectSP size_sp(valobj_sp->GetChildMemberWithName(
"__size_"));
251 m_count = size_sp->GetValueAsUnsigned(0);
254 ValueObjectSP begin_sp(valobj_sp->GetChildMemberWithName(
"__begin_"));
267llvm::Expected<size_t>
271 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
274 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
276 uint32_t idx = *optional_idx;
278 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
static ValueObjectSP GetDataPointer(ValueObject &root)
#define LLDB_LOG_ERRORV(log, error,...)
Generic representation of a type in a programming language.
CompilerType GetTypeTemplateArgument(size_t idx, bool expand_pack=false) const
size_t GetNumTemplateArguments(bool expand_pack=false) const
Return the number of template arguments the type has.
ConstString GetTypeName(bool BaseOnly=false) const
A uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
const char * AsCString(const char *value_if_empty) const
Get the string value as a C string.
A subclass of DataBuffer that stores a data buffer on the heap.
Execution context objects refer to objects in the execution of the program that is being debugged.
bool Fail() const
Test for error condition.
llvm::StringRef GetString() const
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
uint32_t CalculateNumChildrenIgnoringErrors(uint32_t max=UINT32_MAX)
lldb::ValueObjectSP CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data, const ExecutionContext &exe_ctx, CompilerType type)
SyntheticChildrenFrontEnd(ValueObject &backend)
lldb::ValueObjectSP CreateValueObjectFromAddress(llvm::StringRef name, uint64_t address, const ExecutionContext &exe_ctx, CompilerType type, bool do_deref=true)
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
ChildCacheState
Specifies if children need to be re-computed after a call to SyntheticChildrenFrontEnd::Update.
@ eRefetch
Children need to be recomputed dynamically.
@ eReuse
Children did not change and don't need to be recomputed; re-use what we computed the last time we cal...
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP