diff options
author | Spyridoula Gravani <sgravani@apple.com> | 2017-07-13 23:25:24 +0000 |
---|---|---|
committer | Spyridoula Gravani <sgravani@apple.com> | 2017-07-13 23:25:24 +0000 |
commit | 890eedc4e44e9e363db98e2bba863ff9335450d6 (patch) | |
tree | 59ffe0c7687713e65dac0d16df63606e733d489d /llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | |
parent | 3b4317cbc243bcc75141bb10e1e7814caeac40c2 (diff) | |
download | bcm5719-llvm-890eedc4e44e9e363db98e2bba863ff9335450d6.tar.gz bcm5719-llvm-890eedc4e44e9e363db98e2bba863ff9335450d6.zip |
[DWARF] Introduce verification for the unit header chain in .debug_info section to llvm-dwarfdump.
This patch adds verification checks for the unit header chain in the .debug_info section.
Specifically, for each unit in the .debug_info section, the verifier checks that:
The unit length is valid (i.e. the unit can actually fit in the .debug_info section)
The dwarf version of the unit is valid
The address size is valid (4 or 8)
The unit type (if the unit is in dwarf5) is valid
The debug_abbrev_offset is valid
llvm-svn: 307975
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFContext.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp index 495e09fbae3..96114758e18 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -414,6 +414,8 @@ DWARFDie DWARFContext::getDIEForOffset(uint32_t Offset) { bool DWARFContext::verify(raw_ostream &OS, DIDumpType DumpType) { bool Success = true; DWARFVerifier verifier(OS, *this); + if (!verifier.handleDebugInfoUnitHeaderChain()) + Success = false; if (DumpType == DIDT_All || DumpType == DIDT_Info) { if (!verifier.handleDebugInfo()) Success = false; |