Add more error checking to llvm-objdump and MachODump

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 13:31:47 PST 2015


On 15 December 2015 at 13:34, Lang Hames <lhames at gmail.com> wrote:
> I think we're essentially in agreement. I wasn't trying to say that error
> handling will be trivial, just that if Pete and Kevin are prepared to do the
> hard work (which I know they are, since they both want this feature) we
> should push forward on it.

I am OK with that. IMHO it will be a really odd feature for objdump,
but if there desire and willingness to code it, that is fine. But it
must be done properly. In particular in the context of this patch it
must add tests for errors it touches. It must also add tests showing
that we recover from the error and continue to find followup errors.

> On a side note - you've mentioned a couple of times the danger of dropping
> errors, which is one of my concerns with std::error_code. Have we considered
> actually coding in a check for this? I.e. an error type (or diagnostics
> class) that will fatal_error in the destructor if errors are not explicitly
> handled or dismissed?

I did play with that idea a bit, but since every use case I am
interested in works with fatal errors I did not try to implement it.

Cheers,
Rafael


More information about the llvm-commits mailing list