teak-llvm/llvm/test/tools/llvm-dwarfdump/X86/debug_aranges-error.s
Igor Kudrin dcff3961c2 [DWARF] Return Error from DWARFDebugArangeSet::extract().
This helps to detect and report parsing errors better.
The patch follows the ideas of LLDB's patches D59370 and D59381.

It adds tests for valid and some invalid cases. More checks and
tests to come. Note that the patch fixes validation of the Length
field because the value does not include the field itself.

The existing users are updated to show the error messages.

Differential Revision: https://reviews.llvm.org/D71875
2020-01-23 12:41:05 +07:00

22 lines
949 B
ArmAsm

# RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o %t.o
# RUN: llvm-dwarfdump -debug-aranges %t.o 2>&1 | FileCheck %s
# RUN: llvm-dwarfdump -lookup 10 %t.o 2>&1 | FileCheck %s
## This checks that llvm-dwarfdump shows parsing errors in .debug_aranges.
## For more error cases see unittests/DebugInfo/DWARF/DWARFDebugArangeSetTest.cpp.
# CHECK: the length of address range table at offset 0x0 exceeds section size
.section .debug_aranges,"",@progbits
.long .Lend - .Lversion + 1 # The length exceeds the section boundaries
.Lversion:
.short 2 # Version
.long 0 # Debug Info Offset
.byte 4 # Address Size
.byte 0 # Segment Selector Size
.space 4 # Padding
.Ltuples:
.long 0, 1 # Address and length
.long 0, 0 # Termination tuple
.Lend: