[Lldb-commits] [PATCH] D79654: [lldb/Driver] Support terminal resizing

Frederic Riss via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri May 8 16:08:43 PDT 2020


friss created this revision.
friss added reviewers: labath, teemperor.
Herald added a project: LLDB.

The comment in the Editine.h header made it sound like editline was
just unable to handle terminal resizing. We were not ever telling
editline that the terminal had changed size, which might explain why
it wasn't working.

This patch threads a `TerminalSizeChanged()` callback through the
IOHandler and invokes it from the SIGWINCH handler in the driver. Our
`Editline` class already had a `TerminalSizeChanged()` method which
was invoked only when editline was configured.

This patch also changes `Editline` to not apply the changes right away
in `TerminalSizeChanged()`, but instead defer that to the next
character read. During my testing, it happened once that the signal
was received while our `ConnectionFileDescriptor::Read` was allocating
memory. As `el_resize` seems to allocate memory too, this crashed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79654

Files:
  lldb/include/lldb/Core/IOHandler.h
  lldb/include/lldb/Host/Editline.h
  lldb/source/Core/Debugger.cpp
  lldb/source/Core/IOHandler.cpp
  lldb/source/Host/common/Editline.cpp
  lldb/test/API/iohandler/resize/TestIOHandlerResize.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79654.262972.patch
Type: text/x-patch
Size: 7754 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200508/5f116345/attachment.bin>


More information about the lldb-commits mailing list