Skip to content

Commit b17d6c5

Browse files
committedAug 22, 2019
[lldb] Fix TestDataFormatterStdList regression
Since D66174 I see failures of TestDataFormatterStdList in about 50% of runs on Fedora 30 x86_64 libstdc++. I have found out that LLDB internally expects these RegularExpressions to be matched in their alphabetical order: ^std::(__cxx11::)?list<.+>(( )?&)?$ ^std::__[[:alnum:]]+::list<.+>(( )?&)?$ But since D66174 they are sometimes matched in reverse order. In fact it was only some luck it worked before as there is internally std::map<lldb::RegularExpressionSP, FormatterImpl> (FormattersContainer). Differential Revision: https://reviews.llvm.org/D66398 llvm-svn: 369655
1 parent 70576ca commit b17d6c5

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed
 

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

+13-7
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,11 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
486486
cpp_category_sp,
487487
lldb_private::formatters::LibcxxStdListSyntheticFrontEndCreator,
488488
"libc++ std::list synthetic children",
489-
ConstString("^std::__[[:alnum:]]+::list<.+>(( )?&)?$"), stl_deref_flags,
490-
true);
489+
// A POSIX variant of: "^std::__(?!cxx11:)[[:alnum:]]+::list<.+>(( )?&)?$"
490+
// so that it does not clash with: "^std::(__cxx11::)?list<.+>(( )?&)?$"
491+
ConstString("^std::__([A-Zabd-z0-9]|cx?[A-Za-wyz0-9]|cxx1?[A-Za-z02-9]|"
492+
"cxx11[[:alnum:]])[[:alnum:]]*::list<.+>(( )?&)?$"),
493+
stl_deref_flags, true);
491494
AddCXXSynthetic(
492495
cpp_category_sp,
493496
lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator,
@@ -583,11 +586,14 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
583586
"libc++ std::list summary provider",
584587
ConstString("^std::__[[:alnum:]]+::forward_list<.+>(( )?&)?$"),
585588
stl_summary_flags, true);
586-
AddCXXSummary(cpp_category_sp,
587-
lldb_private::formatters::LibcxxContainerSummaryProvider,
588-
"libc++ std::list summary provider",
589-
ConstString("^std::__[[:alnum:]]+::list<.+>(( )?&)?$"),
590-
stl_summary_flags, true);
589+
AddCXXSummary(
590+
cpp_category_sp, lldb_private::formatters::LibcxxContainerSummaryProvider,
591+
"libc++ std::list summary provider",
592+
// A POSIX variant of: "^std::__(?!cxx11:)[[:alnum:]]+::list<.+>(( )?&)?$"
593+
// so that it does not clash with: "^std::(__cxx11::)?list<.+>(( )?&)?$"
594+
ConstString("^std::__([A-Zabd-z0-9]|cx?[A-Za-wyz0-9]|cxx1?[A-Za-z02-9]|"
595+
"cxx11[[:alnum:]])[[:alnum:]]*::list<.+>(( )?&)?$"),
596+
stl_summary_flags, true);
591597
AddCXXSummary(cpp_category_sp,
592598
lldb_private::formatters::LibcxxContainerSummaryProvider,
593599
"libc++ std::map summary provider",

0 commit comments

Comments
 (0)
Please sign in to comment.