42 explicit LibstdcppMapIteratorSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
46 lldb::ValueObjectSP GetChildAtIndex(
size_t idx)
override;
48 bool Update()
override;
50 bool MightHaveChildren()
override;
52 size_t GetIndexOfChildWithName(
ConstString name)
override;
58 lldb::ValueObjectSP m_pair_sp;
63 explicit LibStdcppSharedPtrSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
67 lldb::ValueObjectSP GetChildAtIndex(
size_t idx)
override;
69 bool Update()
override;
71 bool MightHaveChildren()
override;
73 size_t GetIndexOfChildWithName(
ConstString name)
override;
78 LibstdcppMapIteratorSyntheticFrontEnd::LibstdcppMapIteratorSyntheticFrontEnd(
79 lldb::ValueObjectSP valobj_sp)
86 bool LibstdcppMapIteratorSyntheticFrontEnd::Update() {
87 ValueObjectSP valobj_sp = m_backend.GetSP();
91 TargetSP target_sp(valobj_sp->GetTargetSP());
96 bool is_64bit = (target_sp->GetArchitecture().GetAddressByteSize() == 8);
100 m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
102 ValueObjectSP _M_node_sp(
103 valobj_sp->GetChildMemberWithName(
ConstString(
"_M_node"),
true));
107 m_pair_address = _M_node_sp->GetValueAsUnsigned(0);
108 if (m_pair_address == 0)
111 m_pair_address += (is_64bit ? 32 : 16);
114 if (my_type.GetNumTemplateArguments() >= 1) {
118 m_pair_type = pair_type;
130 LibstdcppMapIteratorSyntheticFrontEnd::GetChildAtIndex(
size_t idx) {
131 if (m_pair_address != 0 && m_pair_type) {
133 m_pair_sp = CreateValueObjectFromAddress(
"pair", m_pair_address,
134 m_exe_ctx_ref, m_pair_type);
136 return m_pair_sp->GetChildAtIndex(idx,
true);
138 return lldb::ValueObjectSP();
141 bool LibstdcppMapIteratorSyntheticFrontEnd::MightHaveChildren() {
return true; }
143 size_t LibstdcppMapIteratorSyntheticFrontEnd::GetIndexOfChildWithName(
147 if (name ==
"second")
155 return (valobj_sp ?
new LibstdcppMapIteratorSyntheticFrontEnd(valobj_sp)
184 m_item_name(item_name), m_item_sp() {
199 ValueObjectSP item_ptr(valobj_sp->GetChildMemberWithName(
m_item_name,
true));
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 llvm::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));