[DWARF parser] Add basic support for DWZ DWARF multifile extensions.
authorAlexey Samsonov <vonosmas@gmail.com>
Tue, 19 May 2015 20:29:28 +0000 (20:29 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Tue, 19 May 2015 20:29:28 +0000 (20:29 +0000)
commit4ca606f22fe311dc20828242d3961cbafa040343
tree62a6d0c30133d1db957290d1a13f1944f9e159f4
parent4d88c3ebad365105a7fd769b4f89e8a53470744a
[DWARF parser] Add basic support for DWZ DWARF multifile extensions.

This change implements basic support for DWARF alternate sections
proposal: http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open

LLVM tools now understand new forms: DW_FORM_GNU_ref_alt and
DW_FORM_GNU_strp_alt, which are used as references to .debug_info and
.debug_str sections respectively, stored in a separate file, and
possibly shared between different executables / shared objects.

llvm-dwarfdump and llvm-symbolizer don't yet know how to access this
alternate debug file (usually pointed by .gnu_debugaltlink section),
but they can at lease properly parse and dump regular files, which
refer to it.

This change should fix crashes of llvm-dwarfdump and llvm-symbolizer on
files produced by running "dwz" tool. Such files are already installed
on some modern Linux distributions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237721 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/DebugInfo/DWARF/DWARFFormValue.h
include/llvm/Support/Dwarf.h
lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp
lib/DebugInfo/DWARF/DWARFFormValue.cpp
lib/Support/Dwarf.cpp
test/DebugInfo/Inputs/dwarfdump-test-dwz.elf-x86-64 [new file with mode: 0755]
test/DebugInfo/Inputs/dwarfdump-test.cc
test/DebugInfo/Inputs/dwarfdump-test.elf-x86-64.dwz [new file with mode: 0644]
test/DebugInfo/dwarfdump-dwz.test [new file with mode: 0644]