[DebugInfo] Make most debug line prologue errors non-fatal to parsing
authorJames Henderson <james.henderson@sony.com>
Tue, 28 Jan 2020 14:04:42 +0000 (14:04 +0000)
committerJames Henderson <james.henderson@sony.com>
Wed, 29 Jan 2020 10:23:41 +0000 (10:23 +0000)
commit7116e431c0ab4194907bbaf73482ac05d923787f
treed78216374857c90bd861572adf499b32845da451
parent7a6ebb5ba3cefef1865a2e0c5f9196101cbd2733
[DebugInfo] Make most debug line prologue errors non-fatal to parsing

Many of the debug line prologue errors are not inherently fatal. In most
cases, we can make reasonable assumptions and carry on. This patch does
exactly that. In the case of length problems, the approach of "assume
stated length is correct" is taken which means the offset might need
adjusting.

This is a relanding of b94191fe, fixing an LLD test and the LLDB build.

Reviewed by: dblaikie, labath

Differential Revision: https://reviews.llvm.org/D72158
lld/test/ELF/Inputs/undef-bad-debug.s
lld/test/ELF/undef.s
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
llvm/test/tools/llvm-dwarfdump/X86/Inputs/debug_line_malformed.s
llvm/test/tools/llvm-dwarfdump/X86/debug_line_invalid.test
llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp