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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123415 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/embedded_interpreter.py b/source/Interpreter/embedded_interpreter.py
index 5492833..0e57c1e 100644
--- a/source/Interpreter/embedded_interpreter.py
+++ b/source/Interpreter/embedded_interpreter.py
@@ -84,7 +84,20 @@
            if not more:
                break
 
+   def one_line (self, input):
+      line = self.process_input (input)
+      more = self.push(line)
+      if more:
+         self.write ("Input not a complete line.")
+         self.resetbuffer()
+         more = 0
+
 def run_python_interpreter (dict):
    # Pass in the dictionary, for continuity from one session to the next.
    repl = SimpleREPL('>>> ', dict)
    repl.interact()
+
+def run_one_line (dict, input_string):
+   repl = SimpleREPL ('', dict)
+   repl.one_line (input_string)
+