From b4675a4e12d7120b1b81c41b63b9da55265810a1 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Tue, 25 Jun 2013 23:43:28 +0000 Subject: 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 --- lldb/source/Commands/CommandObjectCommands.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lldb/source/Commands/CommandObjectCommands.cpp') diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 2230836..bbea085 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -1330,7 +1330,9 @@ protected: // Don't change the status if the command already set it... if (result.GetStatus() == eReturnStatusInvalid) { - if (result.GetOutputData() == NULL || result.GetOutputData()[0] == '\0') + if (result.GetErrorData() && result.GetErrorData()[0]) + result.SetStatus(eReturnStatusFailed); + else if (result.GetOutputData() == NULL || result.GetOutputData()[0] == '\0') result.SetStatus(eReturnStatusSuccessFinishNoResult); else result.SetStatus(eReturnStatusSuccessFinishResult); -- cgit v1.1