14#include "llvm/Support/ErrorExtras.h"
21SyntheticChildrenFrontEnd *
82 return llvm::createStringError(
83 "failed to determine start/end of vector data");
85 uint64_t start_val =
m_start->GetValueAsUnsigned(0);
86 uint64_t finish_val =
m_finish->GetValueAsUnsigned(0);
89 if (start_val == 0 && finish_val == 0)
93 return llvm::createStringError(
"invalid value for start of vector");
96 return llvm::createStringError(
"invalid value for end of vector");
98 if (start_val > finish_val)
99 return llvm::createStringError(
100 "start of vector data begins after end pointer");
102 size_t num_children = (finish_val - start_val);
104 return llvm::createStringError(
"size not multiple of element size");
116 offset = offset +
m_start->GetValueAsUnsigned(0);
118 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
132 m_start = data_sp->GetChildMemberWithName(
"_Myfirst").get();
133 m_finish = data_sp->GetChildMemberWithName(
"_Mylast").get();
138 llvm::Expected<uint64_t> size_or_err =
m_element_type.GetByteSize(
nullptr);
151 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
154 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
156 return *optional_idx;
202 size_t bytes_read = process_sp->ReadScalarIntegerFromMemory(
204 if (err.
Fail() || bytes_read == 0 || !scalar.
IsValid())
208 bool bit_set = scalar.
GetAPSInt()[bit_index];
209 std::optional<uint64_t> size =
210 llvm::expectedToOptional(
m_bool_type.GetByteSize(
nullptr));
214 if (bit_set && buffer_sp && buffer_sp->GetBytes()) {
216 *(buffer_sp->GetBytes()) = 1;
219 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
223 process_sp->GetAddressByteSize()),
241 auto exe_ctx_ref = valobj_sp->GetExecutionContextRef();
243 ValueObjectSP size_sp = valobj_sp->GetChildMemberWithName(
"_Mysize");
246 uint64_t count = size_sp->GetValueAsUnsigned(0);
251 {
"_Myvec",
"_Mypair",
"_Myval2",
"_Myfirst"}));
256 CompilerType begin_ty = begin_sp->GetCompilerType().GetPointeeType();
259 llvm::Expected<uint64_t> element_bit_size_or_err =
261 if (!element_bit_size_or_err) {
263 element_bit_size_or_err.takeError(),
264 "failed to get vector<bool> element bit size: {0}");
268 uint64_t base_data_address = begin_sp->GetValueAsUnsigned(0);
269 if (!base_data_address)
279llvm::Expected<size_t>
283 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
286 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
288 uint32_t idx = *optional_idx;
290 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
300 valobj_sp = valobj_sp->GetNonSyntheticValue();
308 if (valobj_sp->GetChildMemberWithName(
"_Mypair") !=
nullptr)
311 if (valobj_sp->GetChildMemberWithName(
"_Myvec") !=
nullptr)
#define LLDB_LOG_ERRORV(log, error,...)
#define LLDB_LOG_ERROR(log, error,...)
Generic representation of a type in a programming language.
llvm::Expected< uint64_t > GetBitSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bits.
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.
llvm::APSInt GetAPSInt() const
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 CreateChildValueObjectFromAddress(llvm::StringRef name, uint64_t address, const ExecutionContext &exe_ctx, CompilerType type, bool do_deref=true)
SyntheticChildrenFrontEnd(ValueObject &backend)
lldb::ValueObjectSP CreateChildValueObjectFromData(llvm::StringRef name, const DataExtractor &data, const ExecutionContext &exe_ctx, CompilerType type)
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