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
18 changes: 18 additions & 0 deletions lldb/source/Plugins/Language/CPlusPlus/GenericList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,16 @@ class MsvcStlListFrontEnd : public AbstractListFrontEnd<StlType::MsvcStl> {
ValueObject *m_tail = nullptr;
};

/// Gets the (forward-)list element type from the head node instead of the
/// template arguments. This is needed with PDB as it doesn't have info about
/// the template arguments.
CompilerType GetMsvcStlElementTypeFromHead(ValueObject &head) {
auto val_sp = head.GetChildMemberWithName("_Myval");
if (val_sp)
return val_sp->GetCompilerType();
return CompilerType();
}

} // end anonymous namespace

template <StlType Stl>
Expand Down Expand Up @@ -530,6 +540,10 @@ lldb::ChildCacheState MsvcStlForwardListFrontEnd::Update() {
m_backend.GetChildAtNamePath({"_Mypair", "_Myval2", "_Myhead"}))
m_head = head_sp.get();

// With PDB, we can't get the element type from the template arguments
if (!m_element_type && m_head)
m_element_type = GetMsvcStlElementTypeFromHead(*m_head);

return ChildCacheState::eRefetch;
}

Expand Down Expand Up @@ -606,6 +620,10 @@ lldb::ChildCacheState MsvcStlListFrontEnd::Update() {
m_head = first.get();
m_tail = last.get();

// With PDB, we can't get the element type from the template arguments
if (!m_element_type && m_head)
m_element_type = GetMsvcStlElementTypeFromHead(*m_head);

return lldb::ChildCacheState::eRefetch;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@


class TestDataFormatterGenericForwardList(TestBase):
TEST_WITH_PDB_DEBUG_INFO = True

def setUp(self):
TestBase.setUp(self)
self.line = line_number("main.cpp", "// break here")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@


class GenericListDataFormatterTestCase(TestBase):
TEST_WITH_PDB_DEBUG_INFO = True

def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


class GenericListDataFormatterTestCase(TestBase):
TEST_WITH_PDB_DEBUG_INFO = True
NO_DEBUG_INFO_TESTCASE = True

def do_test_with_run_command(self):
Expand Down
Loading