[all-commits] [llvm/llvm-project] 2f9cd6: [LLDB] Fix IOHandlerEditline::GetCurrentLines()

Walter Erquinigo via All-commits all-commits at lists.llvm.org
Fri Sep 1 17:52:15 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2f9cd6377f3d972ed8cf814225a02a353d6cc545
      https://github.com/llvm/llvm-project/commit/2f9cd6377f3d972ed8cf814225a02a353d6cc545
  Author: walter erquinigo <walter at modular.com>
  Date:   2023-09-01 (Fri, 01 Sep 2023)

  Changed paths:
    M lldb/include/lldb/Core/IOHandler.h
    M lldb/include/lldb/Host/Editline.h
    M lldb/source/Core/IOHandler.cpp
    M lldb/source/Expression/REPL.cpp

  Log Message:
  -----------
  [LLDB] Fix IOHandlerEditline::GetCurrentLines()

This method was working as expected if LLDB_ENABLE_LIBEDIT is false, however, if it was true, then the variable m_current_lines_ptr was always pointing to an empty list, because Editline only updates its contents once the full input has been completed (see https://github.com/llvm/llvm-project/blob/main/lldb/source/Host/common/Editline.cpp#L1576).

A simple fix is to invoke Editline::GetInputAsStringList() from GetCurrentLines(), which is already used in many places as the common way to get the full input list.




More information about the All-commits mailing list