[lldb] Fix unordered-map data formatter for const types (#156033)

The test was failing because the const qualifier is not removed when checking if the type is an `unordered_map`
This commit is contained in:
Ebuka Ezike 2025-09-15 15:19:55 +01:00 committed by GitHub
parent 53a4e4a77b
commit f1a02c681f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -113,10 +113,11 @@ 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()
.GetCanonicalType()
.GetTypeName())) {
CompilerType backend_type = m_backend.GetCompilerType();
if (backend_type.IsPointerOrReferenceType())
backend_type = backend_type.GetPointeeType();
if (isUnorderedMap(backend_type.GetCanonicalType().GetTypeName())) {
std::string name;
CompilerType field_type =
element_type.GetFieldAtIndex(0, name, nullptr, nullptr, nullptr);