[Lldb-commits] [lldb] 9b12f8f - [LLDB] Run MSVC STL smart pointer tests with PDB (#166946)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 9 09:06:30 PST 2025
Author: nerix
Date: 2025-12-09T18:06:26+01:00
New Revision: 9b12f8fcaeb4e9f8a03de6e982e94e525a9a4dc6
URL: https://github.com/llvm/llvm-project/commit/9b12f8fcaeb4e9f8a03de6e982e94e525a9a4dc6
DIFF: https://github.com/llvm/llvm-project/commit/9b12f8fcaeb4e9f8a03de6e982e94e525a9a4dc6.diff
LOG: [LLDB] Run MSVC STL smart pointer tests with PDB (#166946)
Runs the `std::shared/unique_ptr` tests with PDB with two changes:
- PDB uses the "full" name, so `std::string` is `std::basic_string<char,
std::char_traits<char>, std::allocator<char>>`
- The type of the pointer inside the shared/unique_ptr isn't the
`element_type` typedef
Added:
Modified:
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/shared_ptr/TestDataFormatterStdSharedPtr.py
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unique_ptr/TestDataFormatterStdUniquePtr.py
Removed:
################################################################################
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/shared_ptr/TestDataFormatterStdSharedPtr.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/shared_ptr/TestDataFormatterStdSharedPtr.py
index d71fbf8d5f81a..fa03fc14dfb83 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/shared_ptr/TestDataFormatterStdSharedPtr.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/shared_ptr/TestDataFormatterStdSharedPtr.py
@@ -9,6 +9,8 @@
class TestCase(TestBase):
+ TEST_WITH_PDB_DEBUG_INFO = True
+
def do_test(self):
"""Test `frame variable` output for `std::shared_ptr` types."""
(_, process, _, bkpt) = lldbutil.run_to_source_breakpoint(
@@ -62,7 +64,7 @@ def do_test(self):
valobj = self.expect_var_path("sp_user", type="std::shared_ptr<User>")
self.assertRegex(
valobj.summary,
- "element_type @ 0x0*[1-9a-f][0-9a-f]+( strong=1)? weak=0",
+ f"{'User' if self.getDebugInfo() == 'pdb' else 'element_type'} @ 0x0*[1-9a-f][0-9a-f]+( strong=1)? weak=0",
)
self.assertNotEqual(valobj.child[0].unsigned, 0)
@@ -77,7 +79,15 @@ def do_test(self):
self.assertEqual(str(valobj), '(User) *pointer = (id = 30, name = "steph")')
self.expect_var_path("sp_user->id", type="int", value="30")
- self.expect_var_path("sp_user->name", type="std::string", summary='"steph"')
+ self.expect_var_path(
+ "sp_user->name",
+ type=(
+ "std::basic_string<char, std::char_traits<char>, std::allocator<char>>"
+ if self.getDebugInfo() == "pdb"
+ else "std::string"
+ ),
+ summary='"steph"',
+ )
valobj = self.expect_var_path(
"si", type="std::shared_ptr<int>", summary="47 strong=2 weak=0"
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unique_ptr/TestDataFormatterStdUniquePtr.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unique_ptr/TestDataFormatterStdUniquePtr.py
index 0b68b1b532bb0..1516db698798d 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unique_ptr/TestDataFormatterStdUniquePtr.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unique_ptr/TestDataFormatterStdUniquePtr.py
@@ -9,6 +9,8 @@
class TestCase(TestBase):
+ TEST_WITH_PDB_DEBUG_INFO = True
+
def do_test(self):
"""Test `frame variable` output for `std::unique_ptr` types."""
@@ -84,7 +86,15 @@ def do_test(self):
self.assertNotEqual(valobj.child[0].unsigned, 0)
self.expect_var_path("up_user->id", type="int", value="30")
- self.expect_var_path("up_user->name", type="std::string", summary='"steph"')
+ self.expect_var_path(
+ "up_user->name",
+ type=(
+ "std::basic_string<char, std::char_traits<char>, std::allocator<char>>"
+ if self.getDebugInfo() == "pdb"
+ else "std::string"
+ ),
+ summary='"steph"',
+ )
self.runCmd("settings set target.experimental.use-DIL true")
self.expect_var_path("ptr_node->value", value="1")
More information about the lldb-commits
mailing list