This is an archive of the discontinued LLVM Phabricator instance.

Truncate long lines/names if needed in lldb gui
ClosedPublic

Authored by llunak on Aug 3 2020, 4:52 AM.

Details

Summary

Without this, sources with long lines or variable names may overwrite panel frames, or even overrun to the following line. There's currently no way to scroll left/right in the views, so that should be added to handle these cases.
This commit includes fixing constness of some Window functions, and also makes PutCStringTruncated() consistent with the added printf-like variant to take the padding as the first argument (can't add it after the format to the printf-like function).

Diff Detail

Repository
rLLDB LLDB

Event Timeline

llunak requested review of this revision.Aug 3 2020, 4:52 AM
llunak created this revision.
llunak updated this revision to Diff 282607.Aug 3 2020, 6:41 AM

Handle properly also the "<<< Thread 1: breakpoint 1.1" marker.

clayborg added inline comments.Aug 4 2020, 4:17 PM
lldb/source/Core/IOHandlerCursesGUI.cpp
438–450

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());
}
llunak updated this revision to Diff 283155.Aug 5 2020, 1:14 AM

Use SteamString.

clayborg accepted this revision.Aug 5 2020, 3:48 PM
This revision is now accepted and ready to land.Aug 5 2020, 3:48 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2020, 11:41 PM