aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2022-08-03 16:45:48 -0700
committerMed Ismail Bennani <medismail.bennani@gmail.com>2022-08-09 21:01:37 -0700
commita07a75180c01a3f262b02f69ee5722080da74b84 (patch)
tree817a59d560a8a16272b81873c25d099428b957ce /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parenta633c5e11b4443000aa199a2df41eda4e2c6851b (diff)
downloadllvm-a07a75180c01a3f262b02f69ee5722080da74b84.zip
llvm-a07a75180c01a3f262b02f69ee5722080da74b84.tar.gz
llvm-a07a75180c01a3f262b02f69ee5722080da74b84.tar.bz2
[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 <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp10
1 files changed, 6 insertions, 4 deletions
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;
}