]> granicus.if.org Git - llvm/commit
DebugInfo/DWARF: Provide some (pretty half-hearted) error handling access when parsin...
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 9 Aug 2019 01:14:33 +0000 (01:14 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 9 Aug 2019 01:14:33 +0000 (01:14 +0000)
commitd7cbb69576f4bc5db35efeb1a529c67aa43de3a1
treedcb66f0c8e1bf59779e1c4c7e43cb038650b1b17
parent33c8afb1c37b159e51ad0ee496e0da61183fc056
DebugInfo/DWARF: Provide some (pretty half-hearted) error handling access when parsing units

This isn't the most robust error handling API, but does allow clients to
opt-in to getting Errors they can handle. I suspect the long-term
solution would be to move away from the lazy unit parsing and have an
explicit step that parses the unit and then allows access to the other
APIs that require a parsed unit.

llvm-dwarfdump could be expanded to use this (or newer/better API) to
demonstrate the benefit of it - but for now lld will use this in a
follow-up cl which ensures lld can exit non-zero on errors like this (&
provide more descriptive diagnostics including which object file the
error came from).

(error access to later errors when parsing nested DIEs would be good too
- but, again, exposing that without it being a hassle for every consumer
may be tricky)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368377 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/DebugInfo/DWARF/DWARFUnit.h
lib/DebugInfo/DWARF/DWARFUnit.cpp
test/DebugInfo/X86/dwarfdump-str-offsets-invalid.s