[Lldb-commits] [lldb] [lldb] optionally match the `__debug` namespace for libstdc++ containers. (PR #140727)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Tue May 20 06:20:15 PDT 2025
================
@@ -1449,104 +1449,110 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
stl_deref_flags.SetFrontEndWantsDereference();
cpp_category_sp->AddTypeSynthetic(
- "^std::vector<.+>(( )?&)?$", eFormatterMatchRegex,
- SyntheticChildrenSP(new ScriptedSyntheticChildren(
+ "^std::(__debug::)?vector<.+>(( )?&)?$", eFormatterMatchRegex,
+ std::make_shared<ScriptedSyntheticChildren>(
stl_synth_flags,
- "lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider")));
+ "lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider"));
cpp_category_sp->AddTypeSynthetic(
- "^std::map<.+> >(( )?&)?$", eFormatterMatchRegex,
- SyntheticChildrenSP(new ScriptedSyntheticChildren(
+ "^std::(__debug::)?map<.+> >(( )?&)?$", eFormatterMatchRegex,
+ std::make_shared<ScriptedSyntheticChildren>(
stl_synth_flags,
- "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider")));
+ "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"));
cpp_category_sp->AddTypeSynthetic(
- "^std::deque<.+>(( )?&)?$", eFormatterMatchRegex,
- SyntheticChildrenSP(new ScriptedSyntheticChildren(
+ "^std::(__debug)?deque<.+>(( )?&)?$", eFormatterMatchRegex,
+ std::make_shared<ScriptedSyntheticChildren>(
stl_deref_flags,
- "lldb.formatters.cpp.gnu_libstdcpp.StdDequeSynthProvider")));
+ "lldb.formatters.cpp.gnu_libstdcpp.StdDequeSynthProvider"));
cpp_category_sp->AddTypeSynthetic(
- "^std::set<.+> >(( )?&)?$", eFormatterMatchRegex,
- SyntheticChildrenSP(new ScriptedSyntheticChildren(
+ "^std::(__debug::)?set<.+> >(( )?&)?$", eFormatterMatchRegex,
+ std::make_shared<ScriptedSyntheticChildren>(
stl_deref_flags,
- "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider")));
+ "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"));
cpp_category_sp->AddTypeSynthetic(
- "^std::multimap<.+> >(( )?&)?$", eFormatterMatchRegex,
- SyntheticChildrenSP(new ScriptedSyntheticChildren(
+ "^std::(__debug::)?multimap<.+> >(( )?&)?$", eFormatterMatchRegex,
+ std::make_shared<ScriptedSyntheticChildren>(
stl_deref_flags,
- "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider")));
+ "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"));
cpp_category_sp->AddTypeSynthetic(
- "^std::multiset<.+> >(( )?&)?$", eFormatterMatchRegex,
- SyntheticChildrenSP(new ScriptedSyntheticChildren(
+ "^std::(__debug::)?multiset<.+> >(( )?&)?$", eFormatterMatchRegex,
+ std::make_shared<ScriptedSyntheticChildren>(
stl_deref_flags,
- "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider")));
+ "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"));
cpp_category_sp->AddTypeSynthetic(
- "^std::unordered_(multi)?(map|set)<.+> >$", eFormatterMatchRegex,
- SyntheticChildrenSP(new ScriptedSyntheticChildren(
+ "^std::(__debug::)?unordered_(multi)?(map|set)<.+> >$",
+ eFormatterMatchRegex,
+ std::make_shared<ScriptedSyntheticChildren>(
stl_deref_flags,
- "lldb.formatters.cpp.gnu_libstdcpp.StdUnorderedMapSynthProvider")));
+ "lldb.formatters.cpp.gnu_libstdcpp.StdUnorderedMapSynthProvider"));
cpp_category_sp->AddTypeSynthetic(
- "^std::(__cxx11::)?list<.+>(( )?&)?$", eFormatterMatchRegex,
- SyntheticChildrenSP(new ScriptedSyntheticChildren(
+ "^std::((__debug::)?|(__cxx11::)?)list<.+>(( )?&)?$",
+ eFormatterMatchRegex,
+ std::make_shared<ScriptedSyntheticChildren>(
stl_deref_flags,
- "lldb.formatters.cpp.gnu_libstdcpp.StdListSynthProvider")));
+ "lldb.formatters.cpp.gnu_libstdcpp.StdListSynthProvider"));
cpp_category_sp->AddTypeSynthetic(
- "^std::(__cxx11::)?forward_list<.+>(( )?&)?$", eFormatterMatchRegex,
- SyntheticChildrenSP(new ScriptedSyntheticChildren(
+ "^std::((__debug::)?|(__cxx11::)?)forward_list<.+>(( )?&)?$",
+ eFormatterMatchRegex,
+ std::make_shared<ScriptedSyntheticChildren>(
stl_synth_flags,
- "lldb.formatters.cpp.gnu_libstdcpp.StdForwardListSynthProvider")));
+ "lldb.formatters.cpp.gnu_libstdcpp.StdForwardListSynthProvider"));
cpp_category_sp->AddTypeSynthetic(
"^std::variant<.+>$", eFormatterMatchRegex,
- SyntheticChildrenSP(new ScriptedSyntheticChildren(
+ std::make_shared<ScriptedSyntheticChildren>(
stl_synth_flags,
- "lldb.formatters.cpp.gnu_libstdcpp.VariantSynthProvider")));
+ "lldb.formatters.cpp.gnu_libstdcpp.VariantSynthProvider"));
stl_summary_flags.SetDontShowChildren(false);
stl_summary_flags.SetSkipPointers(false);
- cpp_category_sp->AddTypeSummary("^std::bitset<.+>(( )?&)?$",
- eFormatterMatchRegex,
- TypeSummaryImplSP(new StringSummaryFormat(
- stl_summary_flags, "size=${svar%#}")));
- cpp_category_sp->AddTypeSummary("^std::vector<.+>(( )?&)?$",
+ cpp_category_sp->AddTypeSummary("^std::(__debug::)?bitset<.+>(( )?&)?$",
eFormatterMatchRegex,
- TypeSummaryImplSP(new StringSummaryFormat(
- stl_summary_flags, "size=${svar%#}")));
- cpp_category_sp->AddTypeSummary("^std::map<.+> >(( )?&)?$",
+ std::make_shared<StringSummaryFormat>(
+ stl_summary_flags, "size=${svar%#}"));
+ cpp_category_sp->AddTypeSummary("^std::(__debug::)?vector<.+>(( )?&)?$",
eFormatterMatchRegex,
- TypeSummaryImplSP(new StringSummaryFormat(
- stl_summary_flags, "size=${svar%#}")));
- cpp_category_sp->AddTypeSummary("^std::set<.+> >(( )?&)?$",
+ std::make_shared<StringSummaryFormat>(
+ stl_summary_flags, "size=${svar%#}"));
+ cpp_category_sp->AddTypeSummary("^std::(__debug::)?map<.+> >(( )?&)?$",
eFormatterMatchRegex,
- TypeSummaryImplSP(new StringSummaryFormat(
- stl_summary_flags, "size=${svar%#}")));
- cpp_category_sp->AddTypeSummary("^std::deque<.+>(( )?&)?$",
+ std::make_shared<StringSummaryFormat>(
+ stl_summary_flags, "size=${svar%#}"));
+ cpp_category_sp->AddTypeSummary("^std::(__debug::)?set<.+> >(( )?&)?$",
eFormatterMatchRegex,
- TypeSummaryImplSP(new StringSummaryFormat(
- stl_summary_flags, "size=${svar%#}")));
- cpp_category_sp->AddTypeSummary("^std::multimap<.+> >(( )?&)?$",
+ std::make_shared<StringSummaryFormat>(
+ stl_summary_flags, "size=${svar%#}"));
+ cpp_category_sp->AddTypeSummary("^std::(__debug::)?deque<.+>(( )?&)?$",
eFormatterMatchRegex,
- TypeSummaryImplSP(new StringSummaryFormat(
- stl_summary_flags, "size=${svar%#}")));
- cpp_category_sp->AddTypeSummary("^std::multiset<.+> >(( )?&)?$",
+ std::make_shared<StringSummaryFormat>(
+ stl_summary_flags, "size=${svar%#}"));
+ cpp_category_sp->AddTypeSummary("^std::(__debug::)?multimap<.+> >(( )?&)?$",
eFormatterMatchRegex,
- TypeSummaryImplSP(new StringSummaryFormat(
- stl_summary_flags, "size=${svar%#}")));
- cpp_category_sp->AddTypeSummary("^std::unordered_(multi)?(map|set)<.+> >$",
+ std::make_shared<StringSummaryFormat>(
+ stl_summary_flags, "size=${svar%#}"));
+ cpp_category_sp->AddTypeSummary("^std::(__debug::)?multiset<.+> >(( )?&)?$",
eFormatterMatchRegex,
- TypeSummaryImplSP(new StringSummaryFormat(
- stl_summary_flags, "size=${svar%#}")));
- cpp_category_sp->AddTypeSummary("^std::(__cxx11::)?list<.+>(( )?&)?$",
- eFormatterMatchRegex,
- TypeSummaryImplSP(new StringSummaryFormat(
- stl_summary_flags, "size=${svar%#}")));
+ std::make_shared<StringSummaryFormat>(
+ stl_summary_flags, "size=${svar%#}"));
+ cpp_category_sp->AddTypeSummary(
+ "^std::(__debug::)?unordered_(multi)?(map|set)<.+> >$",
+ eFormatterMatchRegex,
+ std::make_shared<StringSummaryFormat>(stl_summary_flags,
+ "size=${svar%#}"));
cpp_category_sp->AddTypeSummary(
- "^std::(__cxx11::)?forward_list<.+>(( )?&)?$", eFormatterMatchRegex,
- TypeSummaryImplSP(new ScriptSummaryFormat(
+ "^std::((__debug::)?|(__cxx11::)?)list<.+>(( )?&)?$",
+ eFormatterMatchRegex,
+ std::make_shared<StringSummaryFormat>(stl_summary_flags,
+ "size=${svar%#}"));
+ cpp_category_sp->AddTypeSummary(
+ "^std::((__debug::)?|(__cxx11::)?)forward_list<.+>(( )?&)?$",
+ eFormatterMatchRegex,
+ std::make_shared<ScriptSummaryFormat>(
stl_summary_flags,
- "lldb.formatters.cpp.gnu_libstdcpp.ForwardListSummaryProvider")));
+ "lldb.formatters.cpp.gnu_libstdcpp.ForwardListSummaryProvider"));
cpp_category_sp->AddTypeSummary(
"^std::variant<.+>$", eFormatterMatchRegex,
----------------
Michael137 wrote:
Why not adjust the std::variant regex?
https://github.com/llvm/llvm-project/pull/140727
More information about the lldb-commits
mailing list