Second attempt at getting the PyCallable changes in trunk

Thanks to Daniel Malea for helping test this patch for Linux happiness!

llvm-svn: 185965
This commit is contained in:
Enrico Granata
2013-07-09 20:14:26 +00:00
parent 61a56d7a3a
commit eff81a471a
11 changed files with 1080 additions and 1427 deletions

View File

@@ -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();