From eff81a471acdf888e3cf5bc6550bd62b465d4e06 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Tue, 9 Jul 2013 20:14:26 +0000 Subject: Second attempt at getting the PyCallable changes in trunk Thanks to Daniel Malea for helping test this patch for Linux happiness! llvm-svn: 185965 --- lldb/source/Interpreter/ScriptInterpreterPython.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index e42ca6807ee..68414972608 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -115,8 +115,7 @@ LLDBSwigPythonCallCommand (const char *python_function_name, const char *session_dictionary_name, lldb::DebuggerSP& debugger, const char* args, - std::string& err_msg, - lldb_private::CommandReturnObject& cmd_retobj); + lldb_private::CommandReturnObject &cmd_retobj); extern "C" bool LLDBSwigPythonCallModuleInit (const char *python_module_name, @@ -2963,25 +2962,25 @@ ScriptInterpreterPython::RunScriptBasedCommand(const char* impl_function, } lldb::DebuggerSP debugger_sp = m_interpreter.GetDebugger().shared_from_this(); - + if (!debugger_sp.get()) { error.SetErrorString("invalid Debugger pointer"); return false; } - bool ret_val; + bool ret_val = false; std::string err_msg; - + { Locker py_lock(this, Locker::AcquireLock | Locker::InitSession, Locker::FreeLock | Locker::TearDownSession); - + SynchronicityHandler synch_handler(debugger_sp, synchronicity); - + // we need to save the thread state when we first start the command // because we might decide to interrupt it while some action is taking // place outside of Python (e.g. printing to screen, waiting for the network, ...) @@ -2995,12 +2994,11 @@ ScriptInterpreterPython::RunScriptBasedCommand(const char* impl_function, m_dictionary_name.c_str(), debugger_sp, args, - err_msg, cmd_retobj); } - + if (!ret_val) - error.SetErrorString(err_msg.c_str()); + error.SetErrorString("unable to execute script function"); else error.Clear(); -- cgit v1.2.3