DWARF: Fix a regression in location list dumping
authorPavel Labath <pavel@labath.sk>
Wed, 4 Sep 2019 10:09:12 +0000 (10:09 +0000)
committerPavel Labath <pavel@labath.sk>
Wed, 4 Sep 2019 10:09:12 +0000 (10:09 +0000)
commit88b4e28a679a5aaa14ef41a1901d3d24ddd8946b
tree24dd2a1e89404c948de702d2710aacddccb19081
parentaae9972a36870789f82208ffe4d24508c9a0efbb
DWARF: Fix a regression in location list dumping

Summary:
While fixing the handling of some error cases, r370363 introduced new
problems -- assertion failures due to unchecked errors (my excuse is that a very
early version of that patch used Optional<T> instead of Expected).

This patch adds proper handling of parsing errors encountered when
dumping location lists from inside DWARF DIEs, and adds a bunch of
additional tests.

I reorder the arguments of the location list dumping functions to make
them consistent, and also be able to dump the two kinds of location
lists generically.

Reviewers: JDevlieghere, dblaikie, probinson

Subscribers: aprantl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67102

llvm-svn: 370868
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
llvm/test/DebugInfo/X86/dwarfdump-debug-loc-error-cases2.s [new file with mode: 0644]
llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases2.s [new file with mode: 0644]