Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,16 @@ lldb::ValueObjectSP
LibStdcppSharedPtrSyntheticFrontEnd::GetChildAtIndex(size_t idx) {
if (idx == 0)
return m_ptr_obj->GetSP();
if (idx == 1)
return m_obj_obj->GetSP();

if (idx == 1) {
if (m_ptr_obj && !m_obj_obj) {
Status error;
ValueObjectSP obj_obj = m_ptr_obj->Dereference(error);
if (error.Success())
m_obj_obj = obj_obj->Clone(ConstString("object")).get();
}
if (m_obj_obj)
return m_obj_obj->GetSP();
}
return lldb::ValueObjectSP();
}

Expand All @@ -397,14 +404,7 @@ bool LibStdcppSharedPtrSyntheticFrontEnd::Update() {
return false;

m_ptr_obj = ptr_obj_sp->Clone(ConstString("pointer")).get();

if (m_ptr_obj) {
Status error;
ValueObjectSP obj_obj = m_ptr_obj->Dereference(error);
if (error.Success()) {
m_obj_obj = obj_obj->Clone(ConstString("object")).get();
}
}
m_obj_obj = nullptr;

return false;
}
Expand Down
22 changes: 12 additions & 10 deletions lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,7 @@ bool LibStdcppUniquePtrSyntheticFrontEnd::Update() {
if (del_obj)
m_del_obj = del_obj->Clone(ConstString("deleter")).get();
}

if (m_ptr_obj) {
Status error;
ValueObjectSP obj_obj = m_ptr_obj->Dereference(error);
if (error.Success()) {
m_obj_obj = obj_obj->Clone(ConstString("object")).get();
}
}
m_obj_obj = nullptr;

return false;
}
Expand All @@ -128,8 +121,17 @@ LibStdcppUniquePtrSyntheticFrontEnd::GetChildAtIndex(size_t idx) {
return m_ptr_obj->GetSP();
if (idx == 1 && m_del_obj)
return m_del_obj->GetSP();
if (idx == 2 && m_obj_obj)
return m_obj_obj->GetSP();
if (idx == 2) {
if (m_ptr_obj && !m_obj_obj) {
Status error;
ValueObjectSP obj_obj = m_ptr_obj->Dereference(error);
if (error.Success()) {
m_obj_obj = obj_obj->Clone(ConstString("object")).get();
}
}
if (m_obj_obj)
return m_obj_obj->GetSP();
}
return lldb::ValueObjectSP();
}

Expand Down