[all-commits] [llvm/llvm-project] 186c84: Revert and patch "[Python] Remove readline module"

Michał Górny via All-commits all-commits at lists.llvm.org
Thu Nov 21 13:33:30 PST 2019


  Branch: refs/heads/release/9.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 186c848d84f1a4e7cd5b217ff3ae26083e2fdedf
      https://github.com/llvm/llvm-project/commit/186c848d84f1a4e7cd5b217ff3ae26083e2fdedf
  Author: serge-sans-paille <sguelton at redhat.com>
  Date:   2019-11-21 (Thu, 21 Nov 2019)

  Changed paths:
    M lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
    A lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp
    A lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.h
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp

  Log Message:
  -----------
  Revert and patch "[Python] Remove readline module"

Fix https://bugs.llvm.org/show_bug.cgi?id=43830 while avoiding polluting the
global Python namespace.

This both reverts r357277 to rebundle a version of Python's readline module
based on libedit.

However, this patch also provides two improvements over the previous
implementation:

1. use PyMem_RawMalloc instead of PyMem_Malloc, as expected by PyOS_Readline
   (prevents to segfault upon exit of interactive session)
2. patch the readline module upon embedded interpreter loading, instead of
   patching it globally, which should prevent any side effect on other
   modules/packages
3. only activate the patched module if libedit is actually linked in lldb

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

(cherry picked from commit 9357b5d08497326a1895cab6c1d712bf12a34519)


  Commit: 6d7bc6033d7d3e452eeb181156e6c1bc2b14b897
      https://github.com/llvm/llvm-project/commit/6d7bc6033d7d3e452eeb181156e6c1bc2b14b897
  Author: Michał Górny <mgorny at gentoo.org>
  Date:   2019-11-21 (Thu, 21 Nov 2019)

  Changed paths:
    M lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.h

  Log Message:
  -----------
  [lldb] [Python] Build readline override module only on Linux

Restrict building the readline override to Linux only.  It both does not
build on *BSD systems, and is largely irrelevant since they default to
using libedit over readline anyway.  This restores the behavior
of the old readline override that also was built only on Linux.

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

(cherry picked from commit df3ae1eb296d5193232649b5f282dfc4f01ba61f)


Compare: https://github.com/llvm/llvm-project/compare/d1f4d6a49343...6d7bc6033d7d


More information about the All-commits mailing list