[all-commits] [llvm/llvm-project] d9166a: [lldb/Driver] Support terminal resizing

fredriss via All-commits all-commits at lists.llvm.org
Tue May 12 11:56:28 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d9166ad272847e246799afbb5e0c71874f83aa12
      https://github.com/llvm/llvm-project/commit/d9166ad272847e246799afbb5e0c71874f83aa12
  Author: Fred Riss <friss at apple.com>
  Date:   2020-05-12 (Tue, 12 May 2020)

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

  Log Message:
  -----------
  [lldb/Driver] Support terminal resizing

Summary:
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.

Reviewers: labath, teemperor

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D79654




More information about the All-commits mailing list