message: [swift] Small string formatting support
diff: @@ -242,6 +242,43 @@ bool lldb_private::formatters::swift::StringGuts_SummaryProvider(
  if (objectAddr == LLDB_INVALID_ADDRESS)
  return false;
  + uint64_t topNibbleMask = 0xF000000000000000;
  + uint64_t smallUTF8TopNibble = 0xE000000000000000;
  +
  + // Small UTF-8 string
  + if ((objectAddr & topNibbleMask) == smallUTF8TopNibble) {
  + // Small UTF-8 strings store their contents directly in register. The
  + // high nibble of the most significant byte of the first word denotes
  + // that the string is small, the low nibble holds the count. The least-
  + // significant byte of the second word is the first UTF-8 code unit.
  + //
  + // {object, otherBits} =
  + // { isSmallUTF8Nibble << 60 | count << 56 | c_14 << 48 | ... | c_8,
  + // c_7 << 56 | c_6 << 48 | ... | c_0
  + // }
  + //
  + //
  + uint64_t countMask = 0x0F00000000000000;
  + uint64_t count = (objectAddr & countMask) >> 56U;
  + assert(count <= 15 && "malformed small string");
  + uint64_t buffer[2] = {otherBits->GetValueAsUnsigned(0), objectAddr};
  +
  + DataExtractor data(buffer, count, process->GetByteOrder(),
  + process->GetAddressByteSize());
  +
  + StringPrinter::ReadBufferAndDumpToStreamOptions options;
  + options.SetData(data)
  + .SetEscapeNonPrintables(true)
  + .SetPrefixToken(0)
  + .SetQuote('"')
  + .SetStream(&stream)
  + .SetSourceSize(count)
  + .SetBinaryZeroIsTerminator(false)
  + .SetLanguage(lldb::eLanguageTypeSwift);
  + return StringPrinter::ReadBufferAndDumpToStream<
  + StringPrinter::StringElementType::UTF8>(options);
  + }
  +
  bool isValue = objectAddr & (1ULL << 63);
  bool isCocoaOrSmall = objectAddr & (1ULL << 62);
  bool isOpaque = objectAddr & (1ULL << 61);
  