[lldb/StringPrinter] Support strings with invalid utf8 sub-sequences
authorVedant Kumar <vsk@apple.com>
Wed, 3 Jun 2020 18:52:29 +0000 (11:52 -0700)
committerVedant Kumar <vsk@apple.com>
Wed, 3 Jun 2020 19:24:23 +0000 (12:24 -0700)
commit4699a7e23010b7c0df49b64f8bea63919825a787
tree40317cf2fb67dacf62cf6c6b877fc1dc2f35292c
parent7822b8a817d85827110f3047f4ec63f6825743a4
[lldb/StringPrinter] Support strings with invalid utf8 sub-sequences

Support printing strings which contain invalid utf8 sub-sequences, e.g.
strings like "hello world \xfe", instead of bailing out with "Summary
Unavailable".

I took the opportunity here to delete some hand-rolled utf8 -> utf32
conversion code and replace it with calls into llvm's Support library.

rdar://61554346
lldb/source/DataFormatters/StringPrinter.cpp
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/main.cpp
lldb/unittests/DataFormatter/StringPrinterTests.cpp