llvm-project/lldb/source/Interpreter
Todd Fiala 9bb71b73d9 Suppress python readline module under Linux to fix a seg fault.
Bug fix for pr18841:
http://llvm.org/bugs/show_bug.cgi?id=18841

This change creates a stub Python readline.so module that does almost
nothing. Its whole purpose is to prevent Python from loading the real
module, something it does during the embedded Python interpreter's
initialization sequence (and way before lldb ever requests it within
embedded_interpreter.py).

On Ubuntu 12.04 and 13.10 x86_64, and in the Python 2.7.6 tree, the
stock Python readline module links against the GNU readline library.
This appears to be the case on all Pythons except where __APPLE__ is
defined. LLDB now requires linking against the libedit library.
Something about having both libedit.so and libreadline.so linked into
the same process space is causing the Python readline.so to trigger a
NULL memory access. I have put in a separate patch to python.org.

This suppression of embedded interpreter readline support can be
removed if at least any one of the following happens:

1. The stock python distribution accepts a patch similar to what I
submitted to Python 2.7.6's Modules/readline.c file.

2. The stock python distribution implements Modules/readline.c in
terms of libedit's readline compatibility mode (i.e. essentially
compiles it the way __APPLE__ compiles that module) under Linux.

3. a clean-room implementation of the python readline module is
implemented against libedit (either readline compatibility mode or
native libedit). This could be implemented within the readline.cpp
file that this change introduces. It cannot be a fork of python's
readline.c module due to llvm licensing.

The net effect of this change on Linux is that the embedded python's
readline support will not exist.

llvm-svn: 202243
2014-02-26 07:39:20 +00:00
..
Args.cpp This patch does a couple of things. 2013-11-07 00:11:47 +00:00
CMakeLists.txt Convert to UNIX line endings. 2013-09-25 10:37:32 +00:00
CommandHistory.cpp <rdar://problem/14134716> 2013-06-17 22:51:50 +00:00
CommandInterpreter.cpp Don't print out "script" results twice. 2014-02-05 21:46:20 +00:00
CommandObject.cpp Now that the command interpreter runs in a separate thread in Xcode, we need to lock the target API lock instead of trying to lock it. 2014-02-07 22:31:20 +00:00
CommandObjectRegexCommand.cpp <rdar://problem/13384801> 2013-04-03 21:37:16 +00:00
CommandObjectScript.cpp *ahem* Enrico. 2013-02-20 23:51:13 +00:00
CommandObjectScript.h Fix a few more clang (3.2) warnings on Linux: 2012-12-07 22:21:08 +00:00
CommandReturnObject.cpp Second attempt at getting the PyCallable changes in trunk 2013-07-09 20:14:26 +00:00
Makefile Fixed Makefile-based install to place python packages in the LLDB install tree. 2013-12-06 23:16:23 +00:00
OptionGroupArchitecture.cpp Add OptionParser.h 2013-09-05 16:42:23 +00:00
OptionGroupBoolean.cpp Add OptionParser.h 2013-09-05 16:42:23 +00:00
OptionGroupFile.cpp Add OptionParser.h 2013-09-05 16:42:23 +00:00
OptionGroupFormat.cpp <rdar://problem/15192088> 2013-10-11 22:09:26 +00:00
OptionGroupOutputFile.cpp Add OptionParser.h 2013-09-05 16:42:23 +00:00
OptionGroupPlatform.cpp Add OptionParser.h 2013-09-05 16:42:23 +00:00
OptionGroupString.cpp Add OptionParser.h 2013-09-05 16:42:23 +00:00
OptionGroupUInt64.cpp Add OptionParser.h 2013-09-05 16:42:23 +00:00
OptionGroupUUID.cpp Add OptionParser.h 2013-09-05 16:42:23 +00:00
OptionGroupValueObjectDisplay.cpp <rdar://problem/14393032> 2013-09-30 19:11:51 +00:00
OptionGroupVariable.cpp Add OptionParser.h 2013-09-05 16:42:23 +00:00
OptionGroupWatchpoint.cpp Add OptionParser.h 2013-09-05 16:42:23 +00:00
OptionValue.cpp <rdar://problem/11757916> 2012-08-29 21:13:06 +00:00
OptionValueArch.cpp <rdar://problem/12978143> 2013-01-28 23:47:25 +00:00
OptionValueArgs.cpp Reimplemented the code that backed the "settings" in lldb. There were many issues with the previous implementation: 2012-08-22 17:17:09 +00:00
OptionValueArray.cpp Resolve printf formatting warnings on Linux: 2012-11-29 21:49:15 +00:00
OptionValueBoolean.cpp <rdar://problem/12022079> 2012-08-23 00:22:02 +00:00
OptionValueDictionary.cpp <rdar://problem/12978143> 2013-01-28 23:47:25 +00:00
OptionValueEnumeration.cpp Resolve printf formatting warnings on Linux: 2012-11-29 21:49:15 +00:00
OptionValueFileSpec.cpp Change OptionValueFileSpec::SetValueFromCString to strip off whitespace, 2013-09-13 02:33:15 +00:00
OptionValueFileSpecLIst.cpp Sort out a number of mismatched integer types in order to cut down the number of compiler warnings. 2013-06-19 19:04:53 +00:00
OptionValueFormat.cpp <rdar://problem/12978143> 2013-01-28 23:47:25 +00:00
OptionValuePathMappings.cpp Sort out a number of mismatched integer types in order to cut down the number of compiler warnings. 2013-06-19 19:04:53 +00:00
OptionValueProperties.cpp OptionValueProperties::DeepCopy (): return empty value to avoid compilation error on MSVC (even if assert). 2013-09-05 16:57:48 +00:00
OptionValueRegex.cpp Reimplemented the code that backed the "settings" in lldb. There were many issues with the previous implementation: 2012-08-22 17:17:09 +00:00
OptionValueSInt64.cpp Resolve printf formatting warnings on Linux: 2012-11-29 21:49:15 +00:00
OptionValueString.cpp Now that "settings set" will strip leading and trailing spaces, we need a way to be able to specify string values that contain spaces. So now settings setting <property> <value>" can have a <value> that is quoted: 2013-03-06 02:19:38 +00:00
OptionValueUInt64.cpp Resolve printf formatting warnings on Linux: 2012-11-29 21:49:15 +00:00
OptionValueUUID.cpp Remove the UUID::GetAsCString() method which required a buffer to save the 2013-05-03 23:56:12 +00:00
Options.cpp Don't crash when trying to auto complete 'breakpoint set -n "_' 2014-01-29 18:25:07 +00:00
Property.cpp Fix Linux build warnings due to redefinition of macros: 2012-12-05 00:20:57 +00:00
PythonDataObjects.cpp <rdar://problem/15906684> 2014-02-19 01:45:22 +00:00
ScriptInterpreter.cpp Fixed the MacOSX non "Debug" builds so that "lldb-platform" doesn't fail to link. 2013-10-17 00:27:14 +00:00
ScriptInterpreterNone.cpp Merging the iohandler branch back into main. 2014-01-27 23:43:24 +00:00
ScriptInterpreterPython.cpp Fixed the command line LLDB so that "CTRL+C" will interrupt a running process again. 2014-02-24 22:50:57 +00:00
embedded_interpreter.py Suppress python readline module under Linux to fix a seg fault. 2014-02-26 07:39:20 +00:00