Skip to content

Commit c0dfa98

Browse files
committed
fixup! make libstdc++ dereferenced pointer name consistent with libc++
1 parent d862339 commit c0dfa98

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ class LibStdcppUniquePtrSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
4242
// objects are only destroyed when every shared pointer to any of them
4343
// is destroyed, so we must not store a shared pointer to any ValueObject
4444
// derived from our backend ValueObject (since we're in the same cluster).
45-
ValueObject* m_ptr_obj = nullptr;
46-
ValueObject* m_obj_obj = nullptr;
45+
ValueObject *m_ptr_obj = nullptr;
4746
ValueObject* m_del_obj = nullptr;
4847

4948
ValueObjectSP GetTuple();
@@ -107,7 +106,6 @@ lldb::ChildCacheState LibStdcppUniquePtrSyntheticFrontEnd::Update() {
107106
if (del_obj)
108107
m_del_obj = del_obj->Clone(ConstString("deleter")).get();
109108
}
110-
m_obj_obj = nullptr;
111109

112110
return lldb::ChildCacheState::eRefetch;
113111
}
@@ -119,15 +117,13 @@ LibStdcppUniquePtrSyntheticFrontEnd::GetChildAtIndex(uint32_t idx) {
119117
if (idx == 1 && m_del_obj)
120118
return m_del_obj->GetSP();
121119
if (idx == 2) {
122-
if (m_ptr_obj && !m_obj_obj) {
123-
Status error;
124-
ValueObjectSP obj_obj = m_ptr_obj->Dereference(error);
125-
if (error.Success()) {
126-
m_obj_obj = obj_obj->Clone(ConstString("object")).get();
120+
if (m_ptr_obj) {
121+
Status status;
122+
auto value_sp = m_ptr_obj->Dereference(status);
123+
if (status.Success()) {
124+
return value_sp;
127125
}
128126
}
129-
if (m_obj_obj)
130-
return m_obj_obj->GetSP();
131127
}
132128
return lldb::ValueObjectSP();
133129
}

0 commit comments

Comments
 (0)