llvm-project/lldb/source/DataFormatters
Vedant Kumar a37caebc2d [lldb/DataFormatters] Delete GetStringPrinterEscapingHelper
Summary:
Languages can have different ways of formatting special characters.
E.g. when debugging C++ code a string might look like "\b", but when
debugging Swift code the same string would look like "\u{8}".

To make this work, plugins override GetStringPrinterEscapingHelper.
However, because there's a large amount of subtly divergent work done in
each override, we end up with large amounts of duplicated code. And all
the memory smashers fixed in one copy of the logic (see D73860) don't
get fixed in the others.

IMO the GetStringPrinterEscapingHelper is overly general and hard to
use. I propose deleting it and replacing it with an EscapeStyle enum,
which can be set as needed by each plugin.

A fix for some swift-lldb memory smashers falls out fairly naturally
from this deletion (https://github.com/apple/llvm-project/pull/1046). As
the swift logic becomes really tiny, I propose moving it upstream as
part of this change. I've added unit tests to cover it.

rdar://61419673

Reviewers: JDevlieghere, davide

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D77843
2020-05-04 14:06:55 -07:00
..
CMakeLists.txt Remove TypeValidators (NFC in terms of the testsuite) 2019-12-11 09:27:12 -08:00
CXXFunctionPointer.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
DataVisualization.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
DumpValueObjectOptions.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
FormatCache.cpp [lldb][NFC] Always update m_cache_{hits/misses} in FormatCache 2020-03-24 20:16:43 +01:00
FormatClasses.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
FormatManager.cpp [lldb][NFC] Remove FormatterChoiceCriterion 2020-04-15 09:47:15 +02:00
FormattersHelpers.cpp [DataFormatters] Add formatter for libc++ std::unique_ptr 2020-03-23 11:48:20 -07:00
LanguageCategory.cpp [LLDB] Fix compilation with GCC 5 2020-02-06 10:16:32 +02:00
StringPrinter.cpp [lldb/DataFormatters] Delete GetStringPrinterEscapingHelper 2020-05-04 14:06:55 -07:00
TypeCategory.cpp [lldb] Fix gcc warnings in TypeCategory.cpp 2020-04-20 16:12:51 +02:00
TypeCategoryMap.cpp [lldb][NFC] Remove FormatterChoiceCriterion 2020-04-15 09:47:15 +02:00
TypeFormat.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
TypeSummary.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
TypeSynthetic.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
ValueObjectPrinter.cpp [lldb] Remove unused parameter from ValueObject::GetExpressionPath 2020-02-03 10:50:38 -08:00
VectorType.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00