Skip to content

Commit 709ca11

Browse files
committed
fix(string): make spaces in matcher optional
1 parent dbc63f1 commit 709ca11

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,31 +1335,25 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
13351335
static void RegisterStdStringSummaryProvider(
13361336
const lldb::TypeCategoryImplSP &category_sp, llvm::StringRef string_ty,
13371337
llvm::StringRef char_ty, lldb::TypeSummaryImplSP summary_sp) {
1338-
auto makeSpecifier = [](llvm::StringRef name) {
1339-
return std::make_shared<lldb_private::TypeNameSpecifierImpl>(
1340-
name, eFormatterMatchExact);
1341-
};
1342-
1343-
category_sp->AddTypeSummary(makeSpecifier(string_ty), summary_sp);
1344-
1345-
// std::basic_string<char>
13461338
category_sp->AddTypeSummary(
1347-
makeSpecifier(llvm::formatv("std::basic_string<{}>", char_ty).str()),
1339+
std::make_shared<lldb_private::TypeNameSpecifierImpl>(
1340+
string_ty, eFormatterMatchExact),
13481341
summary_sp);
1349-
// std::basic_string<char,std::char_traits<char>,std::allocator<char> >
1342+
1343+
// std::basic_string<char>
13501344
category_sp->AddTypeSummary(
1351-
makeSpecifier(llvm::formatv("std::basic_string<{0},std::char_traits<{0}>,"
1352-
"std::allocator<{0}> >",
1353-
char_ty)
1354-
.str()),
1345+
std::make_shared<lldb_private::TypeNameSpecifierImpl>(
1346+
llvm::formatv("std::basic_string<{}>", char_ty).str(),
1347+
eFormatterMatchExact),
13551348
summary_sp);
1356-
// std::basic_string<char, std::char_traits<char>, std::allocator<char> >
1349+
// std::basic_string<char, std::char_traits<char>, std::allocator<char>>
13571350
category_sp->AddTypeSummary(
1358-
makeSpecifier(
1359-
llvm::formatv("std::basic_string<{0}, std::char_traits<{0}>, "
1360-
"std::allocator<{0}> >",
1351+
std::make_shared<lldb_private::TypeNameSpecifierImpl>(
1352+
llvm::formatv("std::basic_string<{0}, ?std::char_traits<{0}>, "
1353+
"?std::allocator<{0}> ?>",
13611354
char_ty)
1362-
.str()),
1355+
.str(),
1356+
eFormatterMatchRegex),
13631357
summary_sp);
13641358
}
13651359

0 commit comments

Comments
 (0)