[Lldb-commits] [lldb] [lldb][test] Fix unordered-map test (PR #156033)
Ebuka Ezike via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 12 02:56:32 PDT 2025
https://github.com/da-viper updated https://github.com/llvm/llvm-project/pull/156033
>From 134d45f372d7ac528f14899b0041add13269774d Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <yerimyah1 at gmail.com>
Date: Fri, 29 Aug 2025 15:17:29 +0100
Subject: [PATCH] [lldb][test] Fix unordered-map test.
test was failing because there is an extra struct on the stored pair in map
---
.../Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp | 6 ++++--
.../TestDataFormatterStdUnorderedMap.py | 1 -
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
index f88a5319068a2..a10056fcd74d0 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
@@ -113,8 +113,10 @@ CompilerType lldb_private::formatters::LibcxxStdUnorderedMapSyntheticFrontEnd::
// wraps a std::pair. Peel away the internal wrapper type - whose structure is
// of no value to users, to expose the std::pair. This matches the structure
// returned by the std::map synthetic provider.
- if (isUnorderedMap(m_backend.GetCompilerType()
- .GetNonReferenceType()
+ CompilerType backend_type = m_backend.GetCompilerType();
+ if (backend_type.IsPointerOrReferenceType())
+ backend_type = backend_type.GetPointeeType();
+ if (isUnorderedMap(backend_type
.GetCanonicalType()
.GetTypeName())) {
std::string name;
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered_map-iterator/TestDataFormatterStdUnorderedMap.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered_map-iterator/TestDataFormatterStdUnorderedMap.py
index d2382373f4810..1e920faab6397 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered_map-iterator/TestDataFormatterStdUnorderedMap.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered_map-iterator/TestDataFormatterStdUnorderedMap.py
@@ -113,7 +113,6 @@ def do_test_ptr(self):
Test that pointers to std::unordered_map are formatted correctly.
"""
- self.build()
(self.target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
self, "Stop here", lldb.SBFileSpec("main.cpp", False)
)
More information about the lldb-commits
mailing list