Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ add_lldb_library(lldbPluginCPlusPlusLanguage PLUGIN
CxxStringTypes.cpp
Generic.cpp
GenericBitset.cpp
GenericList.cpp
GenericOptional.cpp
LibCxx.cpp
LibCxxAtomic.cpp
LibCxxInitializerList.cpp
LibCxxList.cpp
LibCxxMap.cpp
LibCxxQueue.cpp
LibCxxRangesRefView.cpp
Expand Down
57 changes: 46 additions & 11 deletions lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1440,14 +1440,12 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
stl_deref_flags,
"lldb.formatters.cpp.gnu_libstdcpp.StdUnorderedMapSynthProvider")));
cpp_category_sp->AddTypeSynthetic(
"^std::((__debug::)?|(__cxx11::)?)list<.+>(( )?&)?$",
eFormatterMatchRegex,
"^std::__(debug|cxx11)::list<.+>(( )?&)?$", eFormatterMatchRegex,
SyntheticChildrenSP(new ScriptedSyntheticChildren(
stl_deref_flags,
"lldb.formatters.cpp.gnu_libstdcpp.StdListSynthProvider")));
cpp_category_sp->AddTypeSynthetic(
"^std::((__debug::)?|(__cxx11::)?)forward_list<.+>(( )?&)?$",
eFormatterMatchRegex,
"^std::__(debug|cxx11)::forward_list<.+>(( )?&)?$", eFormatterMatchRegex,
SyntheticChildrenSP(new ScriptedSyntheticChildren(
stl_synth_flags,
"lldb.formatters.cpp.gnu_libstdcpp.StdForwardListSynthProvider")));
Expand Down Expand Up @@ -1501,15 +1499,13 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
"^std::(__debug::)?unordered_(multi)?(map|set)<.+> >$",
stl_summary_flags, true);

AddCXXSummary(cpp_category_sp,
lldb_private::formatters::ContainerSizeSummaryProvider,
"libstdc++ std::list summary provider",
"^std::((__debug::)?|(__cxx11::)?)list<.+>(( )?&)?$",
stl_summary_flags, true);
AddCXXSummary(
cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider,
"libstdc++ debug std::list summary provider",
"^std::__(debug|cxx11)::list<.+>(( )?&)?$", stl_summary_flags, true);

cpp_category_sp->AddTypeSummary(
"^std::((__debug::)?|(__cxx11::)?)forward_list<.+>(( )?&)?$",
eFormatterMatchRegex,
"^std::__(debug|cxx11)::forward_list<.+>(( )?&)?$", eFormatterMatchRegex,
TypeSummaryImplSP(new ScriptSummaryFormat(
stl_summary_flags,
"lldb.formatters.cpp.gnu_libstdcpp.ForwardListSummaryProvider")));
Expand Down Expand Up @@ -1627,6 +1623,31 @@ GenericVectorSyntheticFrontEndCreator(CXXSyntheticChildren *children,
"lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider", *valobj_sp);
}

static SyntheticChildrenFrontEnd *
GenericListSyntheticFrontEndCreator(CXXSyntheticChildren *children,
lldb::ValueObjectSP valobj_sp) {
if (!valobj_sp)
return nullptr;

if (IsMsvcStlList(*valobj_sp))
return MsvcStlListSyntheticFrontEndCreator(children, valobj_sp);
return new ScriptedSyntheticChildren::FrontEnd(
"lldb.formatters.cpp.gnu_libstdcpp.StdListSynthProvider", *valobj_sp);
}

static SyntheticChildrenFrontEnd *
GenericForwardListSyntheticFrontEndCreator(CXXSyntheticChildren *children,
lldb::ValueObjectSP valobj_sp) {
if (!valobj_sp)
return nullptr;

if (IsMsvcStlList(*valobj_sp))
return MsvcStlForwardListSyntheticFrontEndCreator(children, valobj_sp);
return new ScriptedSyntheticChildren::FrontEnd(
"lldb.formatters.cpp.gnu_libstdcpp.StdForwardListSynthProvider",
*valobj_sp);
}

/// Load formatters that are formatting types from more than one STL
static void LoadCommonStlFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
if (!cpp_category_sp)
Expand Down Expand Up @@ -1685,6 +1706,12 @@ static void LoadCommonStlFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
AddCXXSynthetic(cpp_category_sp, GenericTupleSyntheticFrontEndCreator,
"std::tuple synthetic children", "^std::tuple<.*>(( )?&)?$",
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",
Expand All @@ -1704,6 +1731,14 @@ static void LoadCommonStlFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
AddCXXSynthetic(cpp_category_sp, GenericVectorSyntheticFrontEndCreator,
"MSVC/libstdc++ std::vector synthetic provider",
"^std::vector<.+>(( )?&)?$", stl_synth_flags, true);
AddCXXSummary(cpp_category_sp, ContainerSizeSummaryProvider,
"MSVC STL/libstdc++ std::list summary provider",
"^std::list<.+>(( )?&)?$", stl_summary_flags, true);
cpp_category_sp->AddTypeSummary(
"^std::forward_list<.+>(( )?&)?$", eFormatterMatchRegex,
TypeSummaryImplSP(new ScriptSummaryFormat(
stl_summary_flags,
"lldb.formatters.cpp.gnu_libstdcpp.ForwardListSummaryProvider")));
}

static void LoadMsvcStlFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
Expand Down
Loading
Loading