14#include "llvm/Support/ErrorExtras.h"
20 return valobj_sp->GetChildMemberWithName(
"_Ptr") !=
nullptr;
31 ValueObjectSP ptr_sp(valobj_sp->GetChildMemberWithName(
"_Ptr"));
32 ValueObjectSP ctrl_sp(valobj_sp->GetChildMemberWithName(
"_Rep"));
33 if (!ctrl_sp || !ptr_sp)
39 uint64_t ctrl_addr = ctrl_sp->GetValueAsUnsigned(0, &success);
41 if (!success || ctrl_addr == 0)
45 if (
auto uses_sp = ctrl_sp->GetChildMemberWithName(
"_Uses")) {
47 uses = uses_sp->GetValueAsUnsigned(0, &success);
51 stream.
Printf(
" strong=%" PRIu64, uses);
55 if (
auto weak_count_sp = ctrl_sp->GetChildMemberWithName(
"_Weaks")) {
57 uint64_t count = weak_count_sp->GetValueAsUnsigned(0, &success);
61 stream.
Printf(
" weak=%" PRIu64, count - (uses != 0));
151 ValueObjectSP ptr_obj_sp = valobj_sp->GetChildMemberWithName(
"_Ptr");
164llvm::Expected<size_t>
167 if (name ==
"pointer")
170 if (name ==
"object" || name ==
"$$dereference$$")
173 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
187 return valobj_sp->GetChildMemberWithName(
"_Mypair") !=
nullptr;
198 ValueObjectSP ptr_sp(valobj_sp->GetChildAtNamePath({
"_Mypair",
"_Myval2"}));
250 ValueObjectSP pair_sp = valobj_sp->GetChildMemberWithName(
"_Mypair");
254 if (
auto value_ptr_sp = pair_sp->GetChildMemberWithName(
"_Myval2"))
258 if (
auto deleter_sp = pair_sp->GetChildMemberWithName(
"_Myval1"))
264llvm::Expected<size_t>
267 if (name ==
"pointer")
269 if (name ==
"deleter")
271 if (name ==
"obj" || name ==
"object" || name ==
"$$dereference$$")
273 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
A uniqued constant string class.
bool Success() const
Test for success condition.
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
SyntheticChildrenFrontEnd(ValueObject &backend)
virtual lldb::ValueObjectSP GetNonSyntheticValue()
A class that represents a running process on the host machine.
ChildCacheState
Specifies if children need to be re-computed after a call to SyntheticChildrenFrontEnd::Update.
@ eRefetch
Children need to be recomputed dynamically.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP