[Lldb-commits] [PATCH] D85123: Truncate long lines/names if needed in lldb gui

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 4 16:17:23 PDT 2020


clayborg added inline comments.


================
Comment at: lldb/source/Core/IOHandlerCursesGUI.cpp:438-450
+    va_list args;
+    va_start(args, format);
+    int size = vsnprintf(nullptr, 0, format, args);
+    va_end(args);
+    if (size <= 0)
+      return;
+    ++size; // for \0
----------------
Use StreamString?:
```
#include "lldb/Utility/StreamString.h"
void PrintfTruncated(int right_pad, const char *format, ...)
      __attribute__((format(printf, 3, 4))) {
  va_list args;
  va_start(args, format);
  StreamString strm;
  strm.PrintfVarArg(format, args);
  va_end(args);
  PutCStringTruncated(right_pad, strm.GetData());
}
```


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D85123



More information about the lldb-commits mailing list