[Lldb-commits] [PATCH] D71233: Do not cache hardcoded formats in FormatManager

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 9 16:48:12 PST 2019


aprantl created this revision.
aprantl added reviewers: jingham, davide.
aprantl added a parent revision: D71231: Replace redundant code in FormatManager and FormatCache with templates (NFC).

The cache in FormatCache uses only a type name as key. The hardcoded formats, synthetic children, etc inspect an entire ValueObject to    determine their eligibility, which isn't modelled in the cache. This leads to bugs such as the one in this patch (where two similarly named types in different files have different hardcoded summary providers). The problem is exaggerated in the Swift language plugin due to the language's dynamic nature.

rdar://problem/57756763


https://reviews.llvm.org/D71233

Files:
  lldb/include/lldb/DataFormatters/FormatManager.h
  lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-caching/Makefile
  lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-caching/TestDataFormatterCaching.py
  lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-caching/a.c
  lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-caching/b.c
  lldb/source/DataFormatters/FormatManager.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71233.232962.patch
Type: text/x-patch
Size: 5902 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191210/e1e9feaf/attachment-0001.bin>


More information about the lldb-commits mailing list