1 # RUN: llvm-mc %S/Inputs/debug_rnglists_short_section.s -filetype obj -triple x86_64-pc-linux -o - | \
2 # RUN: llvm-dwarfdump --debug-rnglists - 2>&1 | FileCheck %s --check-prefix=SHORT
4 # SHORT-NOT: range list header
5 # SHORT: error: section is not large enough to contain a .debug_rnglists table length at offset 0
6 # SHORT-NOT: range list header
9 # RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o - | \
10 # RUN: llvm-dwarfdump --debug-rnglists - 2> %t.err | FileCheck %s --check-prefix=GOOD
11 # RUN: FileCheck %s --input-file %t.err
13 # GOOD: .debug_rnglists contents:
14 # GOOD-NEXT: range list header: length = 0x0000001e, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000001
15 # GOOD-NEXT: offsets: [
16 # GOOD-NEXT: 0x00000004
19 # GOOD-NEXT: [0x0000000000000010, 0x0000000000000020)
20 # GOOD-NEXT: <End of list>
21 # GOOD-NEXT: range list header: length = 0x0000001a, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
23 # GOOD-NEXT: [0x0000000000000030, 0x0000000000000040)
24 # GOOD-NEXT: <End of list>
25 # GOOD-NOT: range list header
28 # CHECK: error: .debug_rnglists table at offset 0x22 has too small length (0xb) to contain a complete header
29 # CHECK-NEXT: error: unrecognised .debug_rnglists table version 4 in table at offset 0x2d
30 # CHECK-NEXT: error: .debug_rnglists table at offset 0x39 has unsupported address size 2
31 # CHECK-NEXT: error: .debug_rnglists table at offset 0x45 has unsupported segment selector size 4
32 # CHECK-NEXT: error: .debug_rnglists table at offset 0x51 has more offset entries (12345678) than there is space for
33 # CHECK-NEXT: error: insufficient space remaining in table for DW_RLE_start_end encoding at offset 0x69
34 # CHECK-NEXT: error: read past end of table when reading DW_RLE_start_length encoding at offset 0x82
35 # CHECK-NEXT: error: unknown rnglists encoding 0x2a at offset 0x98
36 # CHECK-NEXT: error: no end of list marker detected at end of .debug_rnglists table starting at offset 0xaa
37 # CHECK-NEXT: error: section is not large enough to contain a .debug_rnglists table of length 0x1f at offset 0xe5
40 # RUN: llvm-mc %S/Inputs/debug_rnglists_DWARF64.s -filetype obj -triple x86_64-pc-linux -o - | \
41 # RUN: llvm-dwarfdump --debug-rnglists - 2>&1 | FileCheck %s --check-prefix=DWARF64
43 # DWARF64: DWARF64 is not supported in .debug_rnglists at offset 0x0
45 .section .debug_rnglists,"",@progbits
48 .long 30 # Table length
50 .byte 8 # Address size
51 .byte 0 # Segment selector size
52 .long 1 # Offset entry count
58 .byte 6 # DW_RLE_start_length
59 .quad 0x10, 0x20 # Encoding payload
60 .byte 0 # DW_RLE_end_of_list
62 # Table 2 (length too small for header)
63 .long 7 # Table length
65 .byte 8 # Address size
66 .byte 0 # Segment selector size
67 .byte 0, 0, 0 # Truncated offset entry count
69 # Table 3 (unknown version)
70 .long 8 # Table length
72 .byte 8 # Address size
73 .byte 0 # Segment selector size
74 .long 0 # Offset entry count
76 # Table 4 (unsupported address size)
77 .long 8 # Table length
79 .byte 2 # Address size
80 .byte 0 # Segment selector size
81 .long 0 # Offset entry count
83 # Table 5 (unsupported segment selector size)
84 .long 8 # Table length
86 .byte 8 # Address size
87 .byte 4 # Segment selector size
88 .long 0 # Offset entry count
90 # Table 6 (bad offset entry count)
91 .long 8 # Table length
93 .byte 8 # Address size
94 .byte 0 # Segment selector size
95 .long 12345678 # Offset entry count
97 # Table 7 (malformed DW_RLE_start_end)
98 .long 21 # Table length
100 .byte 8 # Address size
101 .byte 0 # Segment selector size
102 .long 0 # Offset entry count
105 .byte 6 # DW_RLE_start_end
106 .quad 1 # Start address
107 .long 4 # Truncated end address
109 # Table 8 (malformed DW_RLE_start_length)
110 .long 18 # Table length
112 .byte 8 # Address size
113 .byte 0 # Segment selector size
114 .long 0 # Offset entry count
117 .byte 7 # DW_RLE_start_length
118 .quad 1 # Start address
119 .byte 0xFF # Length - invalid ULEB, so will continue reading past the end
121 # Table 9 (unknown encoding)
122 .long 26 # Table length
124 .byte 8 # Address size
125 .byte 0 # Segment selector size
126 .long 0 # Offset entry count
129 .byte 42 # Unknown encoding
130 .quad 0x10, 0x20 # Encoding payload
131 .byte 0 # DW_RLE_end_of_list
133 # Table 10 (missing end of list marker)
134 .long 25 # Table length
136 .byte 8 # Address size
137 .byte 0 # Segment selector size
138 .long 0 # Offset entry count
141 .byte 6 # DW_RLE_start_length
142 .quad 0x10, 0x20 # Encoding payload
145 .long 26 # Table length
147 .byte 8 # Address size
148 .byte 0 # Segment selector size
149 .long 0 # Offset entry count
152 .byte 6 # DW_RLE_start_length
153 .quad 0x30, 0x40 # Encoding payload
154 .byte 0 # DW_RLE_end_of_list
156 # Table 12 (length too long)
157 .long 27 # Table length - 1 greater than actual contents
159 .byte 8 # Address size
160 .byte 0 # Segment selector size
161 .long 0 # Offset entry count
164 .byte 6 # DW_RLE_start_end
165 .quad 1, 2 # Start, end address
166 .byte 0 # DW_RLE_end_of_list