diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-31 17:51:25 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-31 17:51:25 +0000 | 
| commit | 6492be7d57b91310e3f3b6fddb0dd747c4311b44 (patch) | |
| tree | 4466b107e3de777c9d922ec5dd2c20ed0346d70d /contrib/llvm/tools/lldb/source/DataFormatters/StringPrinter.cpp | |
| parent | c85947bf324728dd1b26c2a7454535ba2134185c (diff) | |
| parent | f73363f1dd94996356cefbf24388f561891acf0b (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/tools/lldb/source/DataFormatters/StringPrinter.cpp')
| -rw-r--r-- | contrib/llvm/tools/lldb/source/DataFormatters/StringPrinter.cpp | 26 | 
1 files changed, 12 insertions, 14 deletions
diff --git a/contrib/llvm/tools/lldb/source/DataFormatters/StringPrinter.cpp b/contrib/llvm/tools/lldb/source/DataFormatters/StringPrinter.cpp index 84143a541087..89d7a95069ca 100644 --- a/contrib/llvm/tools/lldb/source/DataFormatters/StringPrinter.cpp +++ b/contrib/llvm/tools/lldb/source/DataFormatters/StringPrinter.cpp @@ -26,9 +26,8 @@ using namespace lldb;  using namespace lldb_private;  using namespace lldb_private::formatters; -// we define this for all values of type but only implement it for those we care -// about -// that's good because we get linker errors for any unsupported type +// we define this for all values of type but only implement it for those we +// care about that's good because we get linker errors for any unsupported type  template <lldb_private::formatters::StringPrinter::StringElementType type>  static StringPrinter::StringPrinterBufferPointer<>  GetPrintableImpl(uint8_t *buffer, uint8_t *buffer_end, uint8_t *&next); @@ -163,8 +162,8 @@ GetPrintableImpl<StringPrinter::StringElementType::UTF8>(uint8_t *buffer,          (unsigned char)*(buffer + 2), (unsigned char)*(buffer + 3));      break;    default: -    // this is probably some bogus non-character thing -    // just print it as-is and hope to sync up again soon +    // this is probably some bogus non-character thing just print it as-is and +    // hope to sync up again soon      retval = {buffer, 1};      next = buffer + 1;      return retval; @@ -223,9 +222,9 @@ GetPrintableImpl<StringPrinter::StringElementType::UTF8>(uint8_t *buffer,    return retval;  } -// Given a sequence of bytes, this function returns: -// a sequence of bytes to actually print out + a length -// the following unscanned position of the buffer is in next +// Given a sequence of bytes, this function returns: a sequence of bytes to +// actually print out + a length the following unscanned position of the buffer +// is in next  static StringPrinter::StringPrinterBufferPointer<>  GetPrintable(StringPrinter::StringElementType type, uint8_t *buffer,               uint8_t *buffer_end, uint8_t *&next) { @@ -321,8 +320,7 @@ static bool DumpUTFBufferToStream(            (llvm::UTF8 *)utf8_data_buffer_sp->GetBytes();      } else {        // just copy the pointers - the cast is necessary to make the compiler -      // happy -      // but this should only happen if we are reading UTF8 data +      // happy but this should only happen if we are reading UTF8 data        utf8_data_ptr = const_cast<llvm::UTF8 *>(            reinterpret_cast<const llvm::UTF8 *>(data_ptr));        utf8_data_end_ptr = const_cast<llvm::UTF8 *>( @@ -344,8 +342,8 @@ static bool DumpUTFBufferToStream(      }      // since we tend to accept partial data (and even partially malformed data) -    // we might end up with no NULL terminator before the end_ptr -    // hence we need to take a slower route and ensure we stay within boundaries +    // we might end up with no NULL terminator before the end_ptr hence we need +    // to take a slower route and ensure we stay within boundaries      for (; utf8_data_ptr < utf8_data_end_ptr;) {        if (zero_is_terminator && !*utf8_data_ptr)          break; @@ -472,8 +470,8 @@ bool StringPrinter::ReadStringAndDumpToStream<    }    // since we tend to accept partial data (and even partially malformed data) -  // we might end up with no NULL terminator before the end_ptr -  // hence we need to take a slower route and ensure we stay within boundaries +  // we might end up with no NULL terminator before the end_ptr hence we need +  // to take a slower route and ensure we stay within boundaries    for (uint8_t *data = buffer_sp->GetBytes(); *data && (data < data_end);) {      if (escape_non_printables) {        uint8_t *next_data = nullptr;  | 
