https://github.com/Nerixyz created 
https://github.com/llvm/llvm-project/pull/166953

Since PDB doesn't have template information, we need to get the element type 
from somewhere else. I'm using the type of `_Myval` in a list node, which holds 
the element type.

>From 5974efa652e624c2f174e5e68cb9ebf363d8e0e5 Mon Sep 17 00:00:00 2001
From: Nerixyz <[email protected]>
Date: Thu, 6 Nov 2025 20:47:04 +0100
Subject: [PATCH] [LLDB] Run MSVC STL (forward-)list test with PDB

---
 .../Plugins/Language/CPlusPlus/GenericList.cpp       | 12 ++++++++++++
 .../TestDataFormatterGenericForwardList.py           |  2 ++
 .../generic/list/TestDataFormatterGenericList.py     |  2 ++
 .../list/loop/TestDataFormatterGenericListLoop.py    |  1 +
 4 files changed, 17 insertions(+)

diff --git a/lldb/source/Plugins/Language/CPlusPlus/GenericList.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/GenericList.cpp
index 5289027fbd8af..101b8b67a92f9 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/GenericList.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/GenericList.cpp
@@ -530,6 +530,12 @@ lldb::ChildCacheState MsvcStlForwardListFrontEnd::Update() 
{
           m_backend.GetChildAtNamePath({"_Mypair", "_Myval2", "_Myhead"}))
     m_head = head_sp.get();
 
+  if (!m_element_type && m_head) {
+    auto val_sp = m_head->GetChildMemberWithName("_Myval");
+    if (val_sp)
+      m_element_type = val_sp->GetCompilerType();
+  }
+
   return ChildCacheState::eRefetch;
 }
 
@@ -606,6 +612,12 @@ lldb::ChildCacheState MsvcStlListFrontEnd::Update() {
   m_head = first.get();
   m_tail = last.get();
 
+  if (!m_element_type && m_head) {
+    auto val_sp = m_head->GetChildMemberWithName("_Myval");
+    if (val_sp)
+      m_element_type = val_sp->GetCompilerType();
+  }
+
   return lldb::ChildCacheState::eRefetch;
 }
 
diff --git 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/forward_list/TestDataFormatterGenericForwardList.py
 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/forward_list/TestDataFormatterGenericForwardList.py
index 45695c43b42a9..1db0c489bc7f9 100644
--- 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/forward_list/TestDataFormatterGenericForwardList.py
+++ 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/forward_list/TestDataFormatterGenericForwardList.py
@@ -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")
diff --git 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
index c0207e6ab5911..fbd021190214b 100644
--- 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
+++ 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
@@ -10,6 +10,8 @@
 
 
 class GenericListDataFormatterTestCase(TestBase):
+    TEST_WITH_PDB_DEBUG_INFO = True
+
     def setUp(self):
         # Call super's setUp().
         TestBase.setUp(self)
diff --git 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/loop/TestDataFormatterGenericListLoop.py
 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/loop/TestDataFormatterGenericListLoop.py
index f6174dd786380..9c5daf760b31f 100644
--- 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/loop/TestDataFormatterGenericListLoop.py
+++ 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/loop/TestDataFormatterGenericListLoop.py
@@ -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):

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to