Introduce the notion of an escape helper. Different languages have different notion of what to print in a string and how to escape non-printable things. The escape helper is where this notion is provided to LLDB
This is NFC, other than a code re-org
llvm-svn: 247200
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
index 7d71568..5928293 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
@@ -570,7 +570,7 @@
// std::wstring::size() is measured in 'characters', not bytes
auto wchar_t_size = valobj.GetTargetSP()->GetScratchClangASTContext()->GetBasicType(lldb::eBasicTypeWChar).GetByteSize(nullptr);
- ReadBufferAndDumpToStreamOptions options(valobj);
+ StringPrinter::ReadBufferAndDumpToStreamOptions options(valobj);
options.SetData(extractor);
options.SetStream(&stream);
options.SetPrefixToken('L');
@@ -581,15 +581,15 @@
switch (wchar_t_size)
{
case 1:
- StringPrinter::ReadBufferAndDumpToStream<lldb_private::formatters::StringElementType::UTF8>(options);
+ StringPrinter::ReadBufferAndDumpToStream<lldb_private::formatters::StringPrinter::StringElementType::UTF8>(options);
break;
case 2:
- lldb_private::formatters::StringPrinter::ReadBufferAndDumpToStream<lldb_private::formatters::StringElementType::UTF16>(options);
+ lldb_private::formatters::StringPrinter::ReadBufferAndDumpToStream<lldb_private::formatters::StringPrinter::StringElementType::UTF16>(options);
break;
case 4:
- lldb_private::formatters::StringPrinter::ReadBufferAndDumpToStream<lldb_private::formatters::StringElementType::UTF32>(options);
+ lldb_private::formatters::StringPrinter::ReadBufferAndDumpToStream<lldb_private::formatters::StringPrinter::StringElementType::UTF32>(options);
break;
default:
@@ -623,14 +623,14 @@
size = std::min<decltype(size)>(size, valobj.GetTargetSP()->GetMaximumSizeOfStringSummary());
location_sp->GetPointeeData(extractor, 0, size);
- ReadBufferAndDumpToStreamOptions options(valobj);
+ StringPrinter::ReadBufferAndDumpToStreamOptions options(valobj);
options.SetData(extractor);
options.SetStream(&stream);
options.SetPrefixToken(0);
options.SetQuote('"');
options.SetSourceSize(size);
options.SetBinaryZeroIsTerminator(false);
- StringPrinter::ReadBufferAndDumpToStream<lldb_private::formatters::StringElementType::ASCII>(options);
+ StringPrinter::ReadBufferAndDumpToStream<StringPrinter::StringElementType::ASCII>(options);
return true;
}