diff options
| author | Enrico Granata <egranata@apple.com> | 2013-06-25 23:43:28 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2013-06-25 23:43:28 +0000 |
| commit | b4675a4e12d7120b1b81c41b63b9da55265810a1 (patch) | |
| tree | 0bdb2f0597a77974186bfe6cee577b0481cee42b /lldb/source/Interpreter/ScriptInterpreterPython.cpp | |
| parent | cc077ad634f14f54f8bb3ac7b6e7c1290f6c701e (diff) | |
| download | bcm5719-llvm-b4675a4e12d7120b1b81c41b63b9da55265810a1.tar.gz bcm5719-llvm-b4675a4e12d7120b1b81c41b63b9da55265810a1.zip | |
<rdar://problem/14266411>
The semi-unofficial way of returning a status from a Python command was to return a string (e.g. return "no such variable was found") that LLDB would pick as a clue of an error having happened
This checkin changes that:
- SBCommandReturnObject now exports a SetError() call, which can take an SBError or a plain C-string
- script commands now drop any return value and expect the SBCommandReturnObject ("return object") to be filled in appropriately - if you do nothing, a success will be assumed
If your commands were relying on returning a value and having LLDB pick that up as an error, please change your commands to SetError() through the return object or expect changes in behavior
llvm-svn: 184893
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
| -rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index e42ca6807ee..4e41d150842 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -115,7 +115,6 @@ 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); extern "C" bool @@ -2970,7 +2969,7 @@ ScriptInterpreterPython::RunScriptBasedCommand(const char* impl_function, return false; } - bool ret_val; + bool ret_val = false; std::string err_msg; @@ -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(); |

