From a07a75180c01a3f262b02f69ee5722080da74b84 Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Wed, 3 Aug 2022 16:45:48 -0700 Subject: [lldb/crashlog] Surface error using SBCommandReturnObject argument This patch allows the crashlog script to surface its errors to lldb by using the provided SBCommandReturnObject argument. rdar://95048193 Differential Revision: https://reviews.llvm.org/D129614 Signed-off-by: Med Ismail Bennani --- .../ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 6558993..4bfec20 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -2888,9 +2888,10 @@ bool ScriptInterpreterPythonImpl::RunScriptBasedCommand( if (!ret_val) error.SetErrorString("unable to execute script function"); - else - error.Clear(); + else if (cmd_retobj.GetStatus() == eReturnStatusFailed) + return false; + error.Clear(); return ret_val; } @@ -2932,9 +2933,10 @@ bool ScriptInterpreterPythonImpl::RunScriptBasedCommand( if (!ret_val) error.SetErrorString("unable to execute script function"); - else - error.Clear(); + else if (cmd_retobj.GetStatus() == eReturnStatusFailed) + return false; + error.Clear(); return ret_val; } -- cgit v1.1