diff options
author | Caroline Tice <ctice@apple.com> | 2011-01-14 00:29:16 +0000 |
---|---|---|
committer | Caroline Tice <ctice@apple.com> | 2011-01-14 00:29:16 +0000 |
commit | 2f88aadff1276ea99569657b8424776167ec5a34 (patch) | |
tree | 698f290fb0c66494fd953537ff1aa2e3ddd54602 /lldb/source/Interpreter/CommandObjectScript.cpp | |
parent | 0c34cb429ed90af168b1c2a8384401feb2e0085f (diff) | |
download | bcm5719-llvm-2f88aadff1276ea99569657b8424776167ec5a34.tar.gz bcm5719-llvm-2f88aadff1276ea99569657b8424776167ec5a34.zip |
Split up the Python script interpreter code to allow multiple script interpreter objects to
exist within the same process (one script interpreter object per debugger object). The
python script interpreter objects are all using the same global Python script interpreter;
they use separate dictionaries to keep their data separate, and mutex's to prevent any object
attempting to use the global Python interpreter when another object is already using it.
llvm-svn: 123415
Diffstat (limited to 'lldb/source/Interpreter/CommandObjectScript.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandObjectScript.cpp | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/lldb/source/Interpreter/CommandObjectScript.cpp b/lldb/source/Interpreter/CommandObjectScript.cpp index 8d9f3362473..70a4eadda2f 100644 --- a/lldb/source/Interpreter/CommandObjectScript.cpp +++ b/lldb/source/Interpreter/CommandObjectScript.cpp @@ -17,8 +17,7 @@ #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Interpreter/ScriptInterpreter.h" -#include "lldb/Interpreter/ScriptInterpreterPython.h" -#include "lldb/Interpreter/ScriptInterpreterNone.h" +#include "lldb/Interpreter/CommandInterpreter.h" using namespace lldb; using namespace lldb_private; @@ -32,8 +31,7 @@ CommandObjectScript::CommandObjectScript (CommandInterpreter &interpreter, Scrip "script", "Pass an expression to the script interpreter for evaluation and return the results. Drop into the interactive interpreter if no expression is given.", "script [<script-expression-for-evaluation>]"), - m_script_lang (script_lang), - m_interpreter_ap () + m_script_lang (script_lang) { } @@ -48,7 +46,7 @@ CommandObjectScript::ExecuteRawCommandString CommandReturnObject &result ) { - ScriptInterpreter *script_interpreter = GetInterpreter (); + ScriptInterpreter *script_interpreter = m_interpreter.GetScriptInterpreter (); if (script_interpreter == NULL) { @@ -88,22 +86,3 @@ CommandObjectScript::Execute return false; } - -ScriptInterpreter * -CommandObjectScript::GetInterpreter () -{ - if (m_interpreter_ap.get() == NULL) - { - switch (m_script_lang) - { - case eScriptLanguagePython: - m_interpreter_ap.reset (new ScriptInterpreterPython (m_interpreter)); - break; - - case eScriptLanguageNone: - m_interpreter_ap.reset (new ScriptInterpreterNone (m_interpreter)); - break; - } - } - return m_interpreter_ap.get(); -} |