[Lldb-commits] [lldb] [LLDB] Add formatters for MSVC STL std::(forward_)list (PR #148285)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 15 08:22:55 PDT 2025


================
@@ -1642,19 +1662,34 @@ static void LoadCommonStlFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
           },
           "MSVC STL/libstdc++ std::wstring summary provider"));
 
+  stl_summary_flags.SetDontShowChildren(false);
+  stl_summary_flags.SetSkipPointers(false);
+
   AddCXXSynthetic(cpp_category_sp, GenericSmartPointerSyntheticFrontEndCreator,
                   "std::shared_ptr synthetic children",
                   "^std::shared_ptr<.+>(( )?&)?$", stl_synth_flags, true);
   AddCXXSynthetic(cpp_category_sp, GenericSmartPointerSyntheticFrontEndCreator,
                   "std::weak_ptr synthetic children",
                   "^std::weak_ptr<.+>(( )?&)?$", stl_synth_flags, true);
+  AddCXXSynthetic(cpp_category_sp, GenericListSyntheticFrontEndCreator,
+                  "std::list synthetic children", "^std::list<.+>(( )?&)?$",
+                  stl_synth_flags, true);
+  AddCXXSynthetic(cpp_category_sp, GenericForwardListSyntheticFrontEndCreator,
+                  "std::forward_list synthetic children",
+                  "^std::forward_list<.+>(( )?&)?$", stl_synth_flags, true);
 
   AddCXXSummary(cpp_category_sp, GenericSmartPointerSummaryProvider,
                 "MSVC STL/libstdc++ std::shared_ptr summary provider",
                 "^std::shared_ptr<.+>(( )?&)?$", stl_summary_flags, true);
   AddCXXSummary(cpp_category_sp, GenericSmartPointerSummaryProvider,
                 "MSVC STL/libstdc++ std::weak_ptr summary provider",
                 "^std::weak_ptr<.+>(( )?&)?$", stl_summary_flags, true);
+  AddCXXSummary(cpp_category_sp, ContainerSizeSummaryProvider,
+                "MSVC STL/libstdc++ std::list summary provider",
+                "^std::list<.+>(( )?&)?$", stl_summary_flags, true);
+  AddCXXSummary(cpp_category_sp, ContainerSizeSummaryProvider,
+                "MSVC STL/libstdc++ std::forward_list summary provider",
+                "^std::forward_list<.+>(( )?&)?$", stl_summary_flags, true);
----------------
Michael137 wrote:

My suggestion was to keep as much of the libstdc++ formatter as-is so the diff is smaller. Yes, the capping mechanism is flawed, which is what Pavel pointed out above, but I don't think we should fix that as part of this PR. This is purely about introducing MSVC STL formatters.

Could you please split out https://github.com/llvm/llvm-project/commit/eb8301bdb83da0d3af0ede7b17ac038739e7b6de and use the libstdcpp summary provider for libstdc++ for now (since that's what we're already doing)

https://github.com/llvm/llvm-project/pull/148285


More information about the lldb-commits mailing list