ScriptInterpreterPython cleanup
Instead of #ifdef-ing the contents of all files in the plugin for all non-python builds, just disable the plugin at the cmake level. Also, remove spurious extra linking of the Python plugin in liblldb. This plugin is already included as a part of LLDB_ALL_PLUGINS variable. llvm-svn: 335236
This commit is contained in:
@@ -7,12 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifdef LLDB_DISABLE_PYTHON
|
||||
|
||||
// Python is disabled in this build
|
||||
|
||||
#else
|
||||
|
||||
// LLDB Python header must be included first
|
||||
#include "lldb-python.h"
|
||||
|
||||
@@ -3191,30 +3185,18 @@ void ScriptInterpreterPython::AddToSysPath(AddLocation location,
|
||||
PyRun_SimpleString(statement.c_str());
|
||||
}
|
||||
|
||||
// void
|
||||
// ScriptInterpreterPython::Terminate ()
|
||||
//{
|
||||
// // We are intentionally NOT calling Py_Finalize here (this would be the
|
||||
// logical place to call it). Calling
|
||||
// // Py_Finalize here causes test suite runs to seg fault: The test suite
|
||||
// runs in Python. It registers
|
||||
// // SBDebugger::Terminate to be called 'at_exit'. When the test suite
|
||||
// Python harness finishes up, it calls
|
||||
// // Py_Finalize, which calls all the 'at_exit' registered functions.
|
||||
// SBDebugger::Terminate calls Debugger::Terminate,
|
||||
// // which calls lldb::Terminate, which calls ScriptInterpreter::Terminate,
|
||||
// which calls
|
||||
// // ScriptInterpreterPython::Terminate. So if we call Py_Finalize here, we
|
||||
// end up with Py_Finalize being called from
|
||||
// // within Py_Finalize, which results in a seg fault.
|
||||
// //
|
||||
// // Since this function only gets called when lldb is shutting down and
|
||||
// going away anyway, the fact that we don't
|
||||
// // actually call Py_Finalize should not cause any problems (everything
|
||||
// should shut down/go away anyway when the
|
||||
// // process exits).
|
||||
// //
|
||||
//// Py_Finalize ();
|
||||
//}
|
||||
|
||||
#endif // #ifdef LLDB_DISABLE_PYTHON
|
||||
// We are intentionally NOT calling Py_Finalize here (this would be the logical
|
||||
// place to call it). Calling Py_Finalize here causes test suite runs to seg
|
||||
// fault: The test suite runs in Python. It registers SBDebugger::Terminate to
|
||||
// be called 'at_exit'. When the test suite Python harness finishes up, it
|
||||
// calls Py_Finalize, which calls all the 'at_exit' registered functions.
|
||||
// SBDebugger::Terminate calls Debugger::Terminate, which calls lldb::Terminate,
|
||||
// which calls ScriptInterpreter::Terminate, which calls
|
||||
// ScriptInterpreterPython::Terminate. So if we call Py_Finalize here, we end
|
||||
// up with Py_Finalize being called from within Py_Finalize, which results in a
|
||||
// seg fault. Since this function only gets called when lldb is shutting down
|
||||
// and going away anyway, the fact that we don't actually call Py_Finalize
|
||||
// should not cause any problems (everything should shut down/go away anyway
|
||||
// when the process exits).
|
||||
//
|
||||
// void ScriptInterpreterPython::Terminate() { Py_Finalize (); }
|
||||
|
||||
Reference in New Issue
Block a user