[Lldb-commits] [PATCH] D66398: 2/2: Fix `TestDataFormatterStdList` regression

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Aug 18 13:22:17 PDT 2019


jankratochvil created this revision.
jankratochvil added reviewers: JDevlieghere, labath, jingham, clayborg.
jankratochvil added a project: LLDB.
Herald added a reviewer: jdoerfert.
jankratochvil added a parent revision: D66392: 1/2: D66174 `RegularExpression` follow-up/cleanup.

Since D66174 <https://reviews.llvm.org/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 `RegularExpression`s to be matched in their alphabetical order:

  ^std::(__cxx11::)?list<.+>(( )?&)?$
  ^std::__[[:alnum:]]+::list<.+>(( )?&)?$

But since D66174 <https://reviews.llvm.org/D66174> they are sometimes matched in reverse order. A simple ugly workaround is to just sort it for ite
ration <https://people.redhat.com/jkratoch/lldb-formatters-sorted.patch>. The overlapping matches one can see by another debug patch on top of it <https://people.redhat.com/jkratoch/lldb-regex-duplicate.patch>.
In fact it was only some luck it worked before as there is internally `std::map<lldb::RegularExpressionSP, FormatterImpl>` (`FormattersContainer`).
So I have changed the key `RegularExpressionSP` -> `RegularExpression` and moved it everywhere as rvalue where possible (so that I am not accused of a performance regression; except for 2 cases needing real copy-ctor).


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66398

Files:
  lldb/include/lldb/Breakpoint/BreakpointResolverName.h
  lldb/include/lldb/DataFormatters/FormattersContainer.h
  lldb/include/lldb/DataFormatters/TypeCategory.h
  lldb/include/lldb/Target/Target.h
  lldb/source/API/SBTarget.cpp
  lldb/source/API/SBTypeCategory.cpp
  lldb/source/Breakpoint/BreakpointResolverName.cpp
  lldb/source/Commands/CommandObjectBreakpoint.cpp
  lldb/source/Commands/CommandObjectType.cpp
  lldb/source/DataFormatters/FormatManager.cpp
  lldb/source/DataFormatters/FormattersHelpers.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Target/Target.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66398.215795.patch
Type: text/x-patch
Size: 30496 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190818/317f7ad9/attachment-0001.bin>


More information about the lldb-commits mailing list