[Lldb-commits] [lldb] [LLDB] Add type summaries for MSVC STL strings (PR #143177)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Tue Jul 1 08:57:16 PDT 2025
================
@@ -1372,6 +1373,37 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
"${var.__y_} ${var.__m_} ${var.__wdl_}")));
}
+static void RegisterStdStringSummaryProvider(
+ const lldb::TypeCategoryImplSP &category_sp, llvm::StringRef string_ty,
+ llvm::StringRef char_ty, lldb::TypeSummaryImplSP summary_sp) {
+ auto makeSpecifier = [](llvm::StringRef name) {
+ return std::make_shared<lldb_private::TypeNameSpecifierImpl>(
+ name, eFormatterMatchExact);
+ };
+
+ category_sp->AddTypeSummary(makeSpecifier(string_ty), summary_sp);
+
+ // std::basic_string<char>
+ category_sp->AddTypeSummary(
+ makeSpecifier(llvm::formatv("std::basic_string<{}>", char_ty).str()),
+ summary_sp);
+ // std::basic_string<char,std::char_traits<char>,std::allocator<char> >
+ category_sp->AddTypeSummary(
+ makeSpecifier(llvm::formatv("std::basic_string<{0},std::char_traits<{0}>,"
+ "std::allocator<{0}> >",
+ char_ty)
+ .str()),
+ summary_sp);
----------------
Michael137 wrote:
I see. 13 years is a long enough support window for whatever it was used for and given it's untested I'm almost inclined to remove it tbh. But we can do it in a separate PR.
https://github.com/llvm/llvm-project/pull/143177
More information about the lldb-commits
mailing list