[all-commits] [llvm/llvm-project] e05b03: [lldb] Set return status to failed when adding a c...
David Spickett via All-commits
all-commits at lists.llvm.org
Tue Jun 8 01:41:31 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e05b03cf4f45ac5ee63c59a3464e7d484884645c
https://github.com/llvm/llvm-project/commit/e05b03cf4f45ac5ee63c59a3464e7d484884645c
Author: David Spickett <david.spickett at linaro.org>
Date: 2021-06-08 (Tue, 08 Jun 2021)
Changed paths:
M lldb/source/Interpreter/CommandReturnObject.cpp
M lldb/test/API/commands/register/register/register_command/TestRegisters.py
A lldb/test/Shell/Commands/command-backtrace-parser-1.test
A lldb/test/Shell/Commands/command-backtrace-parser-2.test
R lldb/test/Shell/Commands/command-backtrace.test
Log Message:
-----------
[lldb] Set return status to failed when adding a command error
There is a common pattern:
result.AppendError(...);
result.SetStatus(eReturnStatusFailed);
I found that some commands don't actually "fail" but only
print "error: ..." because the second line got missed.
This can cause you to miss a failed command when you're
using the Python interface during testing.
(and produce some confusing script results)
I did not find any place where you would want to add
an error without setting the return status, so just
set eReturnStatusFailed whenever you add an error to
a command result.
This change does not remove any of the now redundant
SetStatus. This should allow us to see if there are any
tests that have commands unexpectedly fail with this change.
(the test suite passes for me but I don't have access to all
the systems we cover so there could be some corner cases)
Some tests that failed on x86 and AArch64 have been modified
to work with the new behaviour.
Differential Revision: https://reviews.llvm.org/D103701
More information about the All-commits
mailing list