[Lldb-commits] [PATCH] D66654: Prevent D66398 `TestDataFormatterStdList`-like regressions in the future

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 23 08:00:44 PDT 2019


jankratochvil created this revision.
jankratochvil added reviewers: labath, JDevlieghere, granata.enrico.
jankratochvil added a project: LLDB.
Herald added a subscriber: lldb-commits.

The sanity checking part <https://reviews.llvm.org/D66398?id=216585#inline-597273> is improved here to use some better error channel than original `llvm::errs()`.
With this patch (and without its `TestDataFormatterAdv.py` fix) one gets:

  runCmd: frame variable int_array
  output: (int [5]) int_array = <Two regexes ("int \[[0-9]+\]" and "int \[[0-9]\]") ambiguously match the same string "int [5]".>

I understand one could pass some better abstracted error-reporting interface instead of `ValueObject` itself but that would require some more code (interface definition, inheritance etc.).
With this alternative patch <https://people.redhat.com/jkratoch/regexlistambiguouscheck-module.patch> one gets:

  runCmd: frame variable int_array
  output: (int [5]) int_array = ([0] = -1, [1] = 2, [2] = 3, [3] = 4, [4] = 5)
   = no formatter applied
  and on console:
  error: a.out Two regexes ("int \[[0-9]+\]" and "int \[[0-9]\]") ambiguously match the same string "int [5]".

But I think the alternative patch is worse than this one - for example maybe the variable does not come from a file/module (can it really happen?) and then there would be no way to print the error.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66654

Files:
  lldb/include/lldb/Core/ValueObject.h
  lldb/include/lldb/DataFormatters/FormattersContainer.h
  lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
  lldb/source/DataFormatters/TypeCategory.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66654.216847.patch
Type: text/x-patch
Size: 12064 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190823/9cd9ab3a/attachment.bin>


More information about the lldb-commits mailing list