[Lldb-commits] [PATCH] D77843: [lldb/DataFormatters] Delete GetStringPrinterEscapingHelper

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 13 14:41:33 PDT 2020


shafik added inline comments.


================
Comment at: lldb/source/DataFormatters/StringPrinter.cpp:50
+  StringPrinterBufferPointer(StringPrinterBufferPointer &&rhs)
+      : m_data(rhs.m_data), m_size(rhs.m_size), m_deleter(rhs.m_deleter) {
+    rhs.m_data = nullptr;
----------------
`m_deleter(std::move(rhs.m_deleter))`


================
Comment at: lldb/source/DataFormatters/StringPrinter.cpp:69
+    m_size = rhs.m_size;
+    m_deleter = rhs.m_deleter;
+    rhs.m_data = nullptr;
----------------
`std::move(rhs.m_deleter)`


================
Comment at: lldb/source/DataFormatters/StringPrinter.cpp:173
+  unsigned escaped_len;
+  const unsigned max_buffer_size = 7;
+  uint8_t *data = new uint8_t[max_buffer_size];
----------------
`constexpr`


================
Comment at: lldb/source/DataFormatters/StringPrinter.cpp:259
+  case StringPrinter::EscapeStyle::Swift:
+    // Prints up to 14 characters, then a \0 terminator.
+    escaped_len = sprintf((char *)data, "\\u{%x}", (unsigned)codepoint);
----------------
Maybe I am missing something but I don't think the `sprintf` below can go up to 14 chars.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77843/new/

https://reviews.llvm.org/D77843





More information about the lldb-commits mailing list