[PATCH] D62462: [llvm-objdump] Add warning messages if disassembly + source for problematic inputs
Mike Pozulp via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 21 22:01:46 PDT 2019
mmpozulp added a comment.
@jhenderson, can you think of an input that would cause `Symbolizer->symbolizeCode(*Obj, Address)` to return an `Error`?
I went a few calls deep underneath `Symbolizer->symbolizeCode(*Obj, Address)` and it looks like `LLVMSymbolizer` and `DWARFContext` return a default-constructed `DILineInfo` when they fail to parse the debug info. Can we cause a failure that returns an `Error` instead? If so we can check whether the `Error` is actually an `ErrorInfo` subclass which is how custom errors are created according to error handling Detailed Description <https://llvm.org/doxygen/classllvm_1_1Error.html#details>. A better implementation of `SourcePrinter::printSourceLine()` might call `handleErrors()` instead of `consumeError()`. Grepping the code for `handleErrors` and `handleAllErrors` provides some example uses. First I need some inputs to cause errors so I can see whether any `ErrorInfo` subclasses are returned and if they have useful context which we can incorporate into our warning. This is my first time wading into LLVM's error handling so please let me know if you have any reading suggestions. In addition to the doxygen docs for Error.h I also found a section on error handling in the programmer's manual <http://llvm.org/docs/ProgrammersManual.html#error-handling>.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62462/new/
https://reviews.llvm.org/D62462
More information about the llvm-commits
mailing list