Skip to content

Commit 119861a

Browse files
committed
fix(list): fallback to type of value if templates are unavailable
1 parent 709ca11 commit 119861a

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,17 @@ ValueObjectSP MsvcStlForwardListFrontEnd::GetChildAtIndex(uint32_t idx) {
526526
lldb::ChildCacheState MsvcStlForwardListFrontEnd::Update() {
527527
AbstractListFrontEnd::Update();
528528

529-
if (auto head_sp =
530-
m_backend.GetChildAtNamePath({"_Mypair", "_Myval2", "_Myhead"}))
531-
m_head = head_sp.get();
529+
auto head_sp =
530+
m_backend.GetChildAtNamePath({"_Mypair", "_Myval2", "_Myhead"});
531+
if (!head_sp)
532+
return ChildCacheState::eRefetch;
533+
534+
m_head = head_sp.get();
535+
if (!m_element_type) {
536+
auto val_sp = head_sp->GetChildMemberWithName("_Myval");
537+
if (val_sp)
538+
m_element_type = val_sp->GetCompilerType();
539+
}
532540

533541
return ChildCacheState::eRefetch;
534542
}
@@ -606,6 +614,12 @@ lldb::ChildCacheState MsvcStlListFrontEnd::Update() {
606614
m_head = first.get();
607615
m_tail = last.get();
608616

617+
if (!m_element_type) {
618+
auto val_sp = m_head->GetChildMemberWithName("_Myval");
619+
if (val_sp)
620+
m_element_type = val_sp->GetCompilerType();
621+
}
622+
609623
return lldb::ChildCacheState::eRefetch;
610624
}
611625

0 commit comments

Comments
 (0)