44 explicit LibstdcppMapIteratorSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
48 lldb::ValueObjectSP GetChildAtIndex(
size_t idx)
override;
50 bool Update()
override;
52 bool MightHaveChildren()
override;
54 size_t GetIndexOfChildWithName(
ConstString name)
override;
60 lldb::ValueObjectSP m_pair_sp;
65 explicit LibStdcppSharedPtrSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
69 lldb::ValueObjectSP GetChildAtIndex(
size_t idx)
override;
71 bool Update()
override;
73 bool MightHaveChildren()
override;
75 size_t GetIndexOfChildWithName(
ConstString name)
override;
80 LibstdcppMapIteratorSyntheticFrontEnd::LibstdcppMapIteratorSyntheticFrontEnd(
81 lldb::ValueObjectSP valobj_sp)
88 bool LibstdcppMapIteratorSyntheticFrontEnd::Update() {
89 ValueObjectSP valobj_sp = m_backend.GetSP();
93 TargetSP target_sp(valobj_sp->GetTargetSP());
98 bool is_64bit = (target_sp->GetArchitecture().GetAddressByteSize() == 8);
102 m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
104 ValueObjectSP _M_node_sp(
105 valobj_sp->GetChildMemberWithName(
ConstString(
"_M_node"),
true));
109 m_pair_address = _M_node_sp->GetValueAsUnsigned(0);
110 if (m_pair_address == 0)
113 m_pair_address += (is_64bit ? 32 : 16);
116 if (my_type.GetNumTemplateArguments() >= 1) {
120 m_pair_type = pair_type;
132 LibstdcppMapIteratorSyntheticFrontEnd::GetChildAtIndex(
size_t idx) {
133 if (m_pair_address != 0 && m_pair_type) {
135 m_pair_sp = CreateValueObjectFromAddress(
"pair", m_pair_address,
136 m_exe_ctx_ref, m_pair_type);
138 return m_pair_sp->GetChildAtIndex(idx,
true);
140 return lldb::ValueObjectSP();
143 bool LibstdcppMapIteratorSyntheticFrontEnd::MightHaveChildren() {
return true; }
145 size_t LibstdcppMapIteratorSyntheticFrontEnd::GetIndexOfChildWithName(
149 if (name ==
"second")
157 return (valobj_sp ?
new LibstdcppMapIteratorSyntheticFrontEnd(valobj_sp)
181 llvm::ArrayRef<ConstString> item_names)
183 m_item_names(item_names), m_item_sp() {
198 ValueObjectSP item_ptr =
202 if (item_ptr->GetValueAsUnsigned(0) == 0)
208 item_ptr->GetCompilerType().GetPointeeType());
220 return lldb::ValueObjectSP();
234 const bool scalar_is_load_addr =
true;
248 process_sp->ReadPointerFromMemory(addr_of_string,
error);
249 if (
error.Fail() || addr_of_data == 0 ||
257 lldb::addr_t size_of_data = process_sp->ReadPointerFromMemory(
258 addr_of_string + process_sp->GetAddressByteSize(),
error);
266 stream.
Printf(
"Summary Unavailable");
283 const bool scalar_is_load_addr =
true;
297 if (!wchar_compiler_type)
301 std::optional<uint64_t> size = wchar_compiler_type.
GetBitSize(
nullptr);
309 process_sp->ReadPointerFromMemory(addr_of_string,
error);
310 if (
error.Fail() || addr_of_data == 0 ||
318 lldb::addr_t size_of_data = process_sp->ReadPointerFromMemory(
319 addr_of_string + process_sp->GetAddressByteSize(),
error);
326 switch (wchar_size) {
337 stream.
Printf(
"size for wchar_t is not valid");
352 LibStdcppSharedPtrSyntheticFrontEnd::LibStdcppSharedPtrSyntheticFrontEnd(
353 lldb::ValueObjectSP valobj_sp)
362 LibStdcppSharedPtrSyntheticFrontEnd::GetChildAtIndex(
size_t idx) {
363 ValueObjectSP valobj_sp = m_backend.GetSP();
365 return lldb::ValueObjectSP();
368 return valobj_sp->GetChildMemberWithName(
ConstString(
"_M_ptr"),
true);
370 return lldb::ValueObjectSP();
373 bool LibStdcppSharedPtrSyntheticFrontEnd::Update() {
return false; }
375 bool LibStdcppSharedPtrSyntheticFrontEnd::MightHaveChildren() {
return true; }
377 size_t LibStdcppSharedPtrSyntheticFrontEnd::GetIndexOfChildWithName(
379 if (name ==
"_M_ptr")
387 return (valobj_sp ?
new LibStdcppSharedPtrSyntheticFrontEnd(valobj_sp)
397 ValueObjectSP ptr_sp(
398 valobj_sp->GetChildMemberWithName(
ConstString(
"_M_ptr"),
true));
402 ValueObjectSP usecount_sp(valobj_sp->GetChildAtNamePath(
403 {ConstString(
"_M_refcount"), ConstString(
"_M_pi"),
404 ConstString(
"_M_use_count")}));
408 if (ptr_sp->GetValueAsUnsigned(0) == 0 ||
409 usecount_sp->GetValueAsUnsigned(0) == 0) {
415 ValueObjectSP pointee_sp = ptr_sp->Dereference(
error);
416 if (pointee_sp &&
error.Success()) {
417 if (pointee_sp->DumpPrintableRepresentation(
426 stream.
Printf(
"ptr = 0x%" PRIx64, ptr_sp->GetValueAsUnsigned(0));