diff options
author | Enrico Granata <egranata@apple.com> | 2014-02-19 01:45:22 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2014-02-19 01:45:22 +0000 |
commit | bdab3dee8fe7a22808972e5a7957b8fd57b751a5 (patch) | |
tree | 8c7824baa72ff1ec5596adab5df4ca3414d55c66 /lldb/source/Interpreter/ScriptInterpreterPython.cpp | |
parent | b9ea63c551f667af119cce25e1b5a59b8bbe8091 (diff) | |
download | bcm5719-llvm-bdab3dee8fe7a22808972e5a7957b8fd57b751a5.tar.gz bcm5719-llvm-bdab3dee8fe7a22808972e5a7957b8fd57b751a5.zip |
<rdar://problem/15906684>
The way in which we were determining whether a python module had already been imported in the current session stopped working due to the IOHandler changes
As a result, importing in a new debug session a module which had been imported in a previous session did not work
This commit restores that functionality by checking for the module's presence in the session dictionary (which should be more correct anyway)
llvm-svn: 201623
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index 624a662e26b..f0c32b45b49 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -2278,7 +2278,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 +2287,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); |