summaryrefslogtreecommitdiffstats
path: root/source/Interpreter/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-02-25 21:42:16 +0000
committeremaste <emaste@FreeBSD.org>2014-02-25 21:42:16 +0000
commit788502c6f6261e2d84ef85d1052b41a6c5be31b3 (patch)
treee0f754ea0922908b0f1be8f01c4efbdfc20462eb /source/Interpreter/ScriptInterpreterPython.cpp
parent6beac4fcf9e5327f07c0fefd527180124438096a (diff)
downloadFreeBSD-src-788502c6f6261e2d84ef85d1052b41a6c5be31b3.zip
FreeBSD-src-788502c6f6261e2d84ef85d1052b41a6c5be31b3.tar.gz
Import LLDB as of SVN r202189 (git 32871eb)
(A number of files not required for the FreeBSD build have been removed.) Sponsored by: DARPA, AFRL
Diffstat (limited to 'source/Interpreter/ScriptInterpreterPython.cpp')
-rw-r--r--source/Interpreter/ScriptInterpreterPython.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/source/Interpreter/ScriptInterpreterPython.cpp b/source/Interpreter/ScriptInterpreterPython.cpp
index 624a662..c1d28e8 100644
--- a/source/Interpreter/ScriptInterpreterPython.cpp
+++ b/source/Interpreter/ScriptInterpreterPython.cpp
@@ -781,7 +781,13 @@ public:
{
}
-
+
+ virtual void
+ Cancel ()
+ {
+
+ }
+
virtual void
Interrupt ()
{
@@ -2278,7 +2284,6 @@ ScriptInterpreterPython::LoadScriptingModule (const char* pathname,
command_stream.Clear();
command_stream.Printf("sys.modules.__contains__('%s')",basename.c_str());
bool does_contain = false;
- int refcount = 0;
// this call will succeed if the module was ever imported in any Debugger in the lifetime of the process
// in which this LLDB framework is living
bool was_imported_globally = (ExecuteOneLineWithReturn(command_stream.GetData(),
@@ -2288,10 +2293,7 @@ ScriptInterpreterPython::LoadScriptingModule (const char* pathname,
// this call will fail if the module was not imported in this Debugger before
command_stream.Clear();
command_stream.Printf("sys.getrefcount(%s)",basename.c_str());
- bool was_imported_locally = (ExecuteOneLineWithReturn(command_stream.GetData(),
- ScriptInterpreterPython::eScriptReturnTypeInt,
- &refcount,
- ScriptInterpreter::ExecuteScriptOptions().SetEnableIO(false).SetSetLLDBGlobals(false)) && refcount > 0);
+ bool was_imported_locally = !(GetSessionDictionary().GetItemForKey(basename.c_str()).IsNULLOrNone());
bool was_imported = (was_imported_globally || was_imported_locally);
@@ -2546,8 +2548,8 @@ ScriptInterpreterPython::InitializePrivate ()
Py_InitializeEx (0);
// Initialize SWIG after setting up python
- assert (g_swig_init_callback != NULL);
- g_swig_init_callback ();
+ if (g_swig_init_callback)
+ g_swig_init_callback ();
// Update the path python uses to search for modules to include the current directory.
OpenPOWER on IntegriCloud