[Lldb-commits] [lldb] [lldb] Unify implementation of CommandReturnObject::SetError(NFC) (PR #110707)

via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 1 15:44:53 PDT 2024


jimingham wrote:

> > I actually think it's fine to change this behavior, I don't think anyone would have expected SetError to AppendError...
> 
> If you feel strongly about this (I actually think you have a point), you could make `SetError` as deprecated and have it call a newly added `AppendError` API which makes more sense IMO.

I think both are useful, and indeed, we have both "SetError" and "AppendError" internally in CommandResultObject, and we use both.  I don't think we need to deprecate SetError, but we should make is set the error to what you pass in, and then add AppendError which will add to what's there.  If somebody out there was using SBCommandReturnObject::SetError to append to the error, then they just need to switch to the actually appropriate API now we've provided it.

https://github.com/llvm/llvm-project/pull/110707


More information about the lldb-commits mailing list