From 6d98f56c581f16b246c08bdb54fa5801f713c493 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 25 Apr 2012 00:58:03 +0000 Subject: Maked LLDB into a package so we can import things without poluting the global namespace. Enrico will follow this up with fixing the data formatter test cases that are failing. llvm-svn: 155514 --- lldb/source/Interpreter/ScriptInterpreterPython.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index 39c111704fe..3c1139f8ce2 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -296,13 +296,14 @@ ScriptInterpreterPython::ScriptInterpreterPython (CommandInterpreter &interprete int old_count = Debugger::TestDebuggerRefCount(); - run_string.Printf ("run_one_line (%s, 'import copy, os, re, sys, uuid, lldb, gnu_libstdcpp, libcxx, objc, Logger')", m_dictionary_name.c_str()); + run_string.Printf ("run_one_line (%s, 'import copy, os, re, sys, uuid, lldb')", m_dictionary_name.c_str()); PyRun_SimpleString (run_string.GetData()); // WARNING: temporary code that loads Cocoa formatters - this should be done on a per-platform basis rather than loading the whole set // and letting the individual formatter classes exploit APIs to check whether they can/cannot do their task run_string.Clear(); - run_string.Printf ("run_one_line (%s, 'import CFString, CFArray, CFDictionary, NSData, NSMachPort, NSSet, NSNotification, NSException, CFBag, CFBinaryHeap, NSURL, NSBundle, NSNumber, NSDate, NSIndexSet, Selector, Class, CFBitVector')", m_dictionary_name.c_str()); + //run_string.Printf ("run_one_line (%s, 'from lldb.formatters import *; from lldb.formatters.objc import *; from lldb.formatters.cpp import *')", m_dictionary_name.c_str()); + run_string.Printf ("run_one_line (%s, 'from lldb.formatters import *')", m_dictionary_name.c_str()); PyRun_SimpleString (run_string.GetData()); int new_count = Debugger::TestDebuggerRefCount(); @@ -1961,13 +1962,7 @@ ScriptInterpreterPython::InitializePrivate () } } - PyRun_SimpleString ("sys.dont_write_bytecode = 1"); - - PyRun_SimpleString ("import embedded_interpreter"); - - PyRun_SimpleString ("from embedded_interpreter import run_python_interpreter"); - PyRun_SimpleString ("from embedded_interpreter import run_one_line"); - PyRun_SimpleString ("from termios import *"); + PyRun_SimpleString ("sys.dont_write_bytecode = 1; import lldb.embedded_interpreter; from lldb.embedded_interpreter import run_python_interpreter; from lldb.embedded_interpreter import run_one_line; from termios import *"); stdin_tty_state.Restore(); } -- cgit v1.2.3