diff options
author | Enrico Granata <egranata@apple.com> | 2013-01-11 03:01:25 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2013-01-11 03:01:25 +0000 |
commit | 2500e767a0926b57079acbf15185502c56108344 (patch) | |
tree | 84e2679fb7536ce20d1aef6b1f12dfcaf6b4d526 /lldb/source/Core/CXXFormatterFunctions.cpp | |
parent | 2abe564806e09c05995b448d17c4eae59434a330 (diff) | |
download | bcm5719-llvm-2500e767a0926b57079acbf15185502c56108344.tar.gz bcm5719-llvm-2500e767a0926b57079acbf15185502c56108344.zip |
Making the Unicode formatters visually nicer by using the same prefix characters as the compiler expects in C++ code
Also, marking the Unicode data formatters test cases as dataformatter related for the benefit for the --category flag in dotest.py
llvm-svn: 172167
Diffstat (limited to 'lldb/source/Core/CXXFormatterFunctions.cpp')
-rw-r--r-- | lldb/source/Core/CXXFormatterFunctions.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lldb/source/Core/CXXFormatterFunctions.cpp b/lldb/source/Core/CXXFormatterFunctions.cpp index 18083ab56e8..cd4e227b86d 100644 --- a/lldb/source/Core/CXXFormatterFunctions.cpp +++ b/lldb/source/Core/CXXFormatterFunctions.cpp @@ -144,7 +144,7 @@ static bool ReadUTFBufferAndDumpToStream (uint64_t location, const ProcessSP& process_sp, Stream& stream, - bool want_at = true, + char prefix_token = '@', bool want_quotes = true) { if (location == 0 || location == LLDB_INVALID_ADDRESS) @@ -175,8 +175,8 @@ ReadUTFBufferAndDumpToStream (uint64_t location, } else { - if (want_at) - stream.Printf("@"); + if (prefix_token != 0) + stream.Printf("%c",prefix_token); if (want_quotes) stream.Printf("\""); } @@ -248,7 +248,7 @@ lldb_private::formatters::Char16StringSummaryProvider (ValueObject& valobj, Stre if (!ReadUTFBufferAndDumpToStream<UTF16, ConvertUTF16toUTF8>(valobj_addr, process_sp, stream, - false, // no @ sign for C++ + 'u', true)) // but use quotes { stream.Printf("Summary Unavailable"); @@ -273,7 +273,7 @@ lldb_private::formatters::Char32StringSummaryProvider (ValueObject& valobj, Stre if (!ReadUTFBufferAndDumpToStream<UTF32, ConvertUTF32toUTF8>(valobj_addr, process_sp, stream, - false, // no @ sign for C++ + 'U', true)) // but use quotes { stream.Printf("Summary Unavailable"); @@ -309,21 +309,21 @@ lldb_private::formatters::WCharStringSummaryProvider (ValueObject& valobj, Strea return ReadUTFBufferAndDumpToStream<UTF8, nullptr>(valobj_addr, process_sp, stream, - false, // no @ sign for C++ + 'L', true); // but use quotes case 16: // utf 16 return ReadUTFBufferAndDumpToStream<UTF16, ConvertUTF16toUTF8>(valobj_addr, process_sp, stream, - false, // no @ sign for C++ + 'L', true); // but use quotes case 32: // utf 32 return ReadUTFBufferAndDumpToStream<UTF32, ConvertUTF32toUTF8>(valobj_addr, process_sp, stream, - false, // no @ sign for C++ + 'L', true); // but use quotes default: stream.Printf("size for wchar_t is not valid"); @@ -738,7 +738,7 @@ lldb_private::formatters::NSStringSummaryProvider (ValueObject& valobj, Stream& if (error.Fail()) return false; if (has_explicit_length and is_unicode) - return ReadUTFBufferAndDumpToStream<UTF16,ConvertUTF16toUTF8> (location, process_sp, stream); + return ReadUTFBufferAndDumpToStream<UTF16,ConvertUTF16toUTF8> (location, process_sp, stream, '@'); else { location++; @@ -781,12 +781,12 @@ lldb_private::formatters::NSStringSummaryProvider (ValueObject& valobj, Stream& if (error.Fail()) return false; } - return ReadUTFBufferAndDumpToStream<UTF16,ConvertUTF16toUTF8> (location, process_sp, stream); + return ReadUTFBufferAndDumpToStream<UTF16,ConvertUTF16toUTF8> (location, process_sp, stream, '@'); } else if (is_special) { uint64_t location = valobj_addr + (ptr_size == 8 ? 12 : 8); - return ReadUTFBufferAndDumpToStream<UTF16,ConvertUTF16toUTF8> (location, process_sp, stream); + return ReadUTFBufferAndDumpToStream<UTF16,ConvertUTF16toUTF8> (location, process_sp, stream, '@'); } else if (is_inline) { |