|
3 | 3 |
|
4 | 4 | ## Show that a bad length stops parsing of the section.
|
5 | 5 | # RUN: llvm-mc -triple x86_64-pc-linux %S/Inputs/debug_line_reserved_length.s -filetype=obj -o %t-reserved.o
|
6 |
| -# RUN: llvm-dwarfdump -debug-line %t-reserved.o 2> %t-reserved.err \ |
7 |
| -# RUN: | FileCheck %s --check-prefixes=FIRST,FATAL |
8 |
| -# RUN: FileCheck %s --input-file=%t-reserved.err --check-prefix=RESERVED |
9 |
| -# RUN: llvm-dwarfdump -debug-line %t-reserved.o -verbose 2> %t-reserved-verbose.err \ |
10 |
| -# RUN: | FileCheck %s --check-prefixes=FIRST,FATAL |
11 |
| -# RUN: FileCheck %s --input-file=%t-reserved-verbose.err --check-prefix=RESERVED |
| 6 | +# RUN: llvm-dwarfdump -debug-line %t-reserved.o 2>&1 \ |
| 7 | +# RUN: | FileCheck %s --check-prefixes=FIRST,FATAL,RESERVED |
| 8 | +# RUN: llvm-dwarfdump -debug-line %t-reserved.o -verbose 2>&1 \ |
| 9 | +# RUN: | FileCheck %s --check-prefixes=FIRST,FATAL,RESERVED |
12 | 10 |
|
13 | 11 | ## We only produce warnings for malformed tables after the specified unit if
|
14 | 12 | ## parsing can continue.
|
15 |
| -# RUN: llvm-dwarfdump -debug-line=0 %t-reserved.o 2> %t-reserved-off-first.err \ |
16 |
| -# RUN: | FileCheck %s --check-prefixes=FIRST,NOLATER |
17 |
| -# RUN: FileCheck %s --input-file=%t-reserved-off-first.err --check-prefix=RESERVED |
| 13 | +# RUN: llvm-dwarfdump -debug-line=0 %t-reserved.o 2>&1 \ |
| 14 | +# RUN: | FileCheck %s --check-prefixes=FIRST,NOLATER,RESERVED |
18 | 15 |
|
19 | 16 | ## Stop looking for the specified unit, if a fatally-bad prologue is detected.
|
20 |
| -# RUN: llvm-dwarfdump -debug-line=0x4b %t-reserved.o 2> %t-reserved-off-last.err \ |
21 |
| -# RUN: | FileCheck %s --check-prefixes=NOFIRST,NOLATER |
22 |
| -# RUN: FileCheck %s --input-file=%t-reserved-off-last.err --check-prefix=RESERVED |
| 17 | +# RUN: llvm-dwarfdump -debug-line=0x4b %t-reserved.o 2>&1 \ |
| 18 | +# RUN: | FileCheck %s --check-prefixes=NOFIRST,NOLATER,RESERVED |
23 | 19 |
|
24 | 20 | ## Show that non-fatal errors do not prevent parsing the rest of the section.
|
25 | 21 | # RUN: llvm-mc -triple x86_64-pc-linux %S/Inputs/debug_line_malformed.s -filetype=obj -o %t-malformed.o
|
26 |
| -# RUN: llvm-dwarfdump -debug-line %t-malformed.o 2> %t-malformed.err \ |
27 |
| -# RUN: | FileCheck %s --check-prefixes=FIRST,NONFATAL,LAST --implicit-check-not='debug_line[{{.*}}]' |
28 |
| -# RUN: FileCheck %s --input-file=%t-malformed.err --check-prefixes=ALL,OTHER |
29 |
| -# RUN: llvm-dwarfdump -debug-line %t-malformed.o -verbose 2> %t-malformed-verbose.err \ |
30 |
| -# RUN: | FileCheck %s --check-prefixes=FIRST,NONFATAL,LAST --implicit-check-not='debug_line[{{.*}}]' |
31 |
| -# RUN: FileCheck %s --input-file=%t-malformed-verbose.err --check-prefixes=ALL,OTHER |
| 22 | +# RUN: llvm-dwarfdump -debug-line %t-malformed.o 2>&1 \ |
| 23 | +# RUN: | FileCheck %s --check-prefixes=FIRST,NONFATAL,LAST,ALL,OTHER --implicit-check-not='debug_line[{{.*}}]' |
| 24 | +# RUN: llvm-dwarfdump -debug-line %t-malformed.o -verbose 2>&1 \ |
| 25 | +# RUN: | FileCheck %s --check-prefixes=FIRST,NONFATAL,LAST,ALL,OTHER --implicit-check-not='debug_line[{{.*}}]' |
32 | 26 |
|
33 | 27 | ## We should still produce warnings for malformed tables after the specified unit.
|
34 |
| -# RUN: llvm-dwarfdump -debug-line=0 %t-malformed.o 2> %t-malformed-off-first.err \ |
35 |
| -# RUN: | FileCheck %s --check-prefixes=FIRST,NOLATER |
36 |
| -# RUN: FileCheck %s --input-file=%t-malformed-off-first.err --check-prefix=ALL |
| 28 | +# RUN: llvm-dwarfdump -debug-line=0 %t-malformed.o 2>&1 \ |
| 29 | +# RUN: | FileCheck %s --check-prefixes=FIRST,NOLATER,ALL |
37 | 30 |
|
38 | 31 | ## Don't stop looking for the later unit if non-fatal issues are found.
|
39 |
| -# RUN: llvm-dwarfdump -debug-line=0x3c9 %t-malformed.o 2> %t-malformed-off-last.err \ |
40 |
| -# RUN: | FileCheck %s --check-prefix=LAST --implicit-check-not='debug_line[{{.*}}]' |
41 |
| -# RUN: FileCheck %s --input-file=%t-malformed-off-last.err --check-prefix=ALL |
| 32 | +# RUN: llvm-dwarfdump -debug-line=0x3c9 %t-malformed.o 2>&1 \ |
| 33 | +# RUN: | FileCheck %s --check-prefixes=LAST,ALL --implicit-check-not='debug_line[{{.*}}]' |
42 | 34 |
|
43 | 35 | # FIRST: debug_line[0x00000000]
|
44 | 36 | # FIRST: 0x000000000badbeef {{.*}} end_sequence
|
|
49 | 41 |
|
50 | 42 | ## For fatal issues, the following table(s) should not be dumped:
|
51 | 43 | # FATAL: debug_line[0x00000048]
|
52 |
| -# FATAL-NEXT: Line table prologue |
53 |
| -# FATAL-NEXT: total_length: 0xfffffffe |
| 44 | +# RESERVED-NOT: prologue |
| 45 | +# RESERVED: warning: parsing line table prologue at offset 0x00000048 unsupported reserved unit length found of value 0xfffffffe |
| 46 | +# RESERVED-NOT: prologue |
54 | 47 | # FATAL-NOT: debug_line
|
55 | 48 |
|
56 | 49 | ## For non-fatal issues, the table data should be dumped:
|
57 | 50 |
|
58 | 51 | ## Version 0 table.
|
59 | 52 | # NONFATAL: debug_line[0x00000048]
|
| 53 | +# ALL: warning: parsing line table prologue at offset 0x00000048 found unsupported version 0 |
60 | 54 | # NONFATAL-NEXT: Line table prologue
|
61 |
| -# NONFATAL-NOT: Address |
| 55 | +# NONFATAL-NEXT: total_length: 0x00000002 |
| 56 | +# NONFATAL-NEXT: version: 0 |
| 57 | +# NONFATAL-NOT: prologue_length |
62 | 58 |
|
63 | 59 | ## Version 1 table.
|
64 | 60 | # NONFATAL: debug_line[0x0000004e]
|
| 61 | +# ALL-NEXT: warning: parsing line table prologue at offset 0x0000004e found unsupported version 1 |
65 | 62 | # NONFATAL-NEXT: Line table prologue
|
66 |
| -# NONFATAL-NOT: Address |
| 63 | +# NONFATAL-NEXT: total_length: 0x00000002 |
| 64 | +# NONFATAL-NEXT: version: 1 |
| 65 | +# NONFATAL-NOT: prologue_length |
67 | 66 |
|
68 | 67 | ## Malformed directory format with no path component.
|
69 | 68 | # NONFATAL: debug_line[0x00000054]
|
| 69 | +# ALL-NEXT: warning: parsing line table prologue at 0x00000054 found an invalid directory or file table description at 0x00000073 |
| 70 | +# ALL-NEXT: warning: failed to parse entry content descriptions because no path was found |
70 | 71 | # NONFATAL-NEXT: Line table prologue
|
| 72 | +# NONFATAL: prologue_length: 0x00000013 |
71 | 73 | # NONFATAL-NOT: include_directories
|
72 | 74 | # NONFATAL-NOT: file_names
|
73 | 75 | # NONFATAL: 0x8877665544332211 {{.*}} end_sequence
|
74 | 76 |
|
75 | 77 | ## Prologue with length shorter than parsed.
|
76 | 78 | # NONFATAL: debug_line[0x00000081]
|
| 79 | +# ALL-NEXT: warning: parsing line table prologue at 0x00000081 found an invalid directory or file table description at 0x000000ba |
| 80 | +# ALL-NEXT: warning: file names table was not null terminated before the end of the prologue |
| 81 | +# ALL-NEXT: warning: parsing line table prologue at 0x00000081 should have ended at 0x000000b9 but it ended at 0x000000ba |
77 | 82 | # NONFATAL-NEXT: Line table prologue
|
78 | 83 | # NONFATAL: file_names[ 2]:
|
79 | 84 | # NONFATAL-NEXT: name: "file2"
|
|
84 | 89 |
|
85 | 90 | ## Prologue with length longer than parsed.
|
86 | 91 | # NONFATAL: debug_line[0x000000c8]
|
| 92 | +# ALL-NEXT: warning: parsing line table prologue at 0x000000c8 should have ended at 0x00000103 but it ended at 0x00000102 |
87 | 93 | # NONFATAL-NEXT: Line table prologue
|
88 | 94 | # NONFATAL: file_names[ 2]:
|
89 | 95 | # NONFATAL-NEXT: name: "file2"
|
|
95 | 101 |
|
96 | 102 | ## Extended opcode with incorrect length versus expected.
|
97 | 103 | # NONFATAL: debug_line[0x00000111]
|
| 104 | +# OTHER-NEXT: warning: unexpected line op length at offset 0x00000158 expected 0x02 found 0x01 |
| 105 | +# OTHER-NEXT: warning: unexpected line op length at offset 0x0000015c expected 0x01 found 0x02 |
98 | 106 | # NONFATAL-NEXT: Line table prologue
|
| 107 | +# NONFATAL: prologue_length: 0x00000030 |
99 | 108 | # NONFATAL: 0x00000000abbadaba {{.*}} end_sequence
|
100 | 109 | # NONFATAL: 0x00000000babb1e45 {{.*}} 10 is_stmt prologue_end end_sequence{{$}}
|
101 | 110 |
|
102 | 111 | ## No end of sequence.
|
103 | 112 | # NONFATAL: debug_line[0x0000016c]
|
| 113 | +# OTHER-NEXT: warning: last sequence in debug line table at offset 0x0000016c is not terminated |
104 | 114 | # NONFATAL-NEXT: Line table prologue
|
| 115 | +# NONFATAL: prologue_length: 0x00000030 |
105 | 116 | # NONFATAL: 0x00000000deadfade {{.*}} is_stmt
|
106 | 117 | # NONFATAL-NOT: end_sequence
|
107 | 118 |
|
108 | 119 | ## Very short prologue length for V5 (ends during parameters).
|
109 | 120 | # NONFATAL: debug_line[0x000001b2]
|
| 121 | +# ALL-NEXT: warning: parsing line table prologue at 0x000001b2 should have ended at 0x000001ce but it ended at 0x000001e1 |
110 | 122 | # NONFATAL-NEXT: Line table prologue
|
111 | 123 | # NONFATAL: standard_opcode_lengths[DW_LNS_set_isa] = 1
|
112 | 124 | # NONFATAL-NEXT: include_directories[ 0] = "/tmp"
|
|
117 | 129 |
|
118 | 130 | ## V5 prologue ends during file table.
|
119 | 131 | # NONFATAL: debug_line[0x000001ee]
|
| 132 | +# ALL-NEXT: warning: parsing line table prologue at 0x000001ee should have ended at 0x00000219 but it ended at 0x00000220 |
120 | 133 | # NONFATAL-NEXT: Line table prologue
|
121 | 134 | # NONFATAL: include_directories[ 0] = "/tmp"
|
122 | 135 | # NONFATAL-NEXT: file_names[ 0]:
|
|
127 | 140 |
|
128 | 141 | ## V5 prologue ends during directory table.
|
129 | 142 | # NONFATAL: debug_line[0x0000022f]
|
| 143 | +# ALL-NEXT: warning: parsing line table prologue at 0x0000022f should have ended at 0x00000251 but it ended at 0x0000025e |
130 | 144 | # NONFATAL-NEXT: Line table prologue
|
131 | 145 | # NONFATAL: include_directories[ 0] = "/tmp"
|
132 | 146 | # NONFATAL-NEXT: file_names[ 0]:
|
|
136 | 150 |
|
137 | 151 | ## V5 invalid MD5 hash form when there is still data to be read.
|
138 | 152 | # NONFATAL: debug_line[0x0000026b]
|
| 153 | +# ALL-NEXT: warning: parsing line table prologue at 0x0000026b found an invalid directory or file table description at 0x0000029f |
| 154 | +# ALL-NEXT: warning: failed to parse file entry because the MD5 hash is invalid |
139 | 155 | # NONFATAL-NEXT: Line table prologue
|
140 | 156 | # NONFATAL: include_directories[ 0] = "/tmp"
|
141 | 157 | # NONFATAL-NOT: file_names
|
|
145 | 161 | ## V5 invalid MD5 hash form when data beyond the prologue length has
|
146 | 162 | ## been read before the MD5 problem is identified.
|
147 | 163 | # NONFATAL: debug_line[0x000002ae]
|
| 164 | +# ALL-NEXT: warning: parsing line table prologue at 0x000002ae found an invalid directory or file table description at 0x000002e0 |
| 165 | +# ALL-NEXT: warning: failed to parse file entry because the MD5 hash is invalid |
| 166 | +# ALL-NEXT: warning: parsing line table prologue at 0x000002ae should have ended at 0x000002d9 but it ended at 0x000002e0 |
148 | 167 | # NONFATAL-NEXT: Line table prologue
|
149 | 168 | # NONFATAL: include_directories[ 0] = "/tmp"
|
150 | 169 | # NONFATAL-NOT: file_names
|
|
153 | 172 |
|
154 | 173 | ## V5 invalid directory content description has unsupported form.
|
155 | 174 | # NONFATAL: debug_line[0x000002ec]
|
| 175 | +# ALL-NEXT: warning: parsing line table prologue at 0x000002ec found an invalid directory or file table description at 0x00000315 |
| 176 | +# ALL-NEXT: warning: failed to parse directory entry because skipping the form value failed. |
156 | 177 | # NONFATAL-NEXT: Line table prologue
|
157 | 178 | # NONFATAL: include_directories[ 0] = "/foo"
|
158 | 179 | # NONFATAL-NOT: include_directories
|
|
161 | 182 |
|
162 | 183 | ## Opcode base field of value zero.
|
163 | 184 | # NONFATAL: debug_line[0x00000332]
|
| 185 | +# ALL-NEXT: warning: parsing line table prologue at offset 0x00000332 found opcode base of 0. Assuming no standard opcodes |
164 | 186 | # NONFATAL-NEXT: Line table prologue
|
165 | 187 | # NONFATAL: include_directories[ 1] = "dir1"
|
166 | 188 | # NONFATAL-NEXT: file_names[ 1]:
|
|
173 | 195 |
|
174 | 196 | ## V4 table with unterminated include directory table.
|
175 | 197 | # NONFATAL: debug_line[0x00000361]
|
| 198 | +# ALL-NEXT: warning: parsing line table prologue at 0x00000361 found an invalid directory or file table description at 0x00000382 |
| 199 | +# ALL-NEXT: warning: include directories table was not null terminated before the end of the prologue |
176 | 200 | # NONFATAL-NEXT: Line table prologue
|
177 | 201 | # NONFATAL: include_directories[ 1] = "dir1"
|
178 | 202 | # NONFATAL-NOT: file_names
|
179 | 203 | # NONFATAL: 0xabcdef0123456789 {{.*}} is_stmt end_sequence
|
180 | 204 |
|
181 | 205 | ## V4 table with unterminated file name table.
|
182 | 206 | # NONFATAL: debug_line[0x00000390]
|
| 207 | +# ALL-NEXT: warning: parsing line table prologue at 0x00000390 found an invalid directory or file table description at 0x000003bb |
| 208 | +# ALL-NEXT: warning: file names table was not null terminated before the end of the prologue |
183 | 209 | # NONFATAL-NEXT: Line table prologue
|
184 | 210 | # NONFATAL: file_names[ 1]:
|
185 | 211 | # NONFATAL-NEXT: name: "foo.c"
|
|
191 | 217 |
|
192 | 218 | # LAST: debug_line[0x000003c9]
|
193 | 219 | # LAST: 0x00000000cafebabe {{.*}} end_sequence
|
194 |
| - |
195 |
| -# RESERVED: warning: parsing line table prologue at offset 0x00000048 unsupported reserved unit length found of value 0xfffffffe |
196 |
| - |
197 |
| -# ALL-NOT: warning: |
198 |
| -# ALL: warning: parsing line table prologue at offset 0x00000048 found unsupported version 0 |
199 |
| -# ALL-NEXT: warning: parsing line table prologue at offset 0x0000004e found unsupported version 1 |
200 |
| -# ALL-NEXT: warning: parsing line table prologue at 0x00000054 found an invalid directory or file table description at 0x00000073 |
201 |
| -# ALL-NEXT: warning: failed to parse entry content descriptions because no path was found |
202 |
| -# ALL-NEXT: warning: parsing line table prologue at 0x00000081 found an invalid directory or file table description at 0x000000ba |
203 |
| -# ALL-NEXT: warning: file names table was not null terminated before the end of the prologue |
204 |
| -# ALL-NEXT: warning: parsing line table prologue at 0x00000081 should have ended at 0x000000b9 but it ended at 0x000000ba |
205 |
| -# ALL-NEXT: warning: parsing line table prologue at 0x000000c8 should have ended at 0x00000103 but it ended at 0x00000102 |
206 |
| -# OTHER-NEXT: warning: unexpected line op length at offset 0x00000158 expected 0x02 found 0x01 |
207 |
| -# OTHER-NEXT: warning: unexpected line op length at offset 0x0000015c expected 0x01 found 0x02 |
208 |
| -# OTHER-NEXT: warning: last sequence in debug line table at offset 0x0000016c is not terminated |
209 |
| -# ALL-NEXT: warning: parsing line table prologue at 0x000001b2 should have ended at 0x000001ce but it ended at 0x000001e1 |
210 |
| -# ALL-NEXT: warning: parsing line table prologue at 0x000001ee should have ended at 0x00000219 but it ended at 0x00000220 |
211 |
| -# ALL-NEXT: warning: parsing line table prologue at 0x0000022f should have ended at 0x00000251 but it ended at 0x0000025e |
212 |
| -# ALL-NEXT: warning: parsing line table prologue at 0x0000026b found an invalid directory or file table description at 0x0000029f |
213 |
| -# ALL-NEXT: warning: failed to parse file entry because the MD5 hash is invalid |
214 |
| -# ALL-NEXT: warning: parsing line table prologue at 0x000002ae found an invalid directory or file table description at 0x000002e0 |
215 |
| -# ALL-NEXT: warning: failed to parse file entry because the MD5 hash is invalid |
216 |
| -# ALL-NEXT: warning: parsing line table prologue at 0x000002ae should have ended at 0x000002d9 but it ended at 0x000002e0 |
217 |
| -# ALL-NEXT: warning: parsing line table prologue at 0x000002ec found an invalid directory or file table description at 0x00000315 |
218 |
| -# ALL-NEXT: warning: failed to parse directory entry because skipping the form value failed. |
219 |
| -# ALL-NEXT: warning: parsing line table prologue at offset 0x00000332 found opcode base of 0. Assuming no standard opcodes |
220 |
| -# ALL-NEXT: warning: parsing line table prologue at 0x00000361 found an invalid directory or file table description at 0x00000382 |
221 |
| -# ALL-NEXT: warning: include directories table was not null terminated before the end of the prologue |
222 |
| -# ALL-NEXT: warning: parsing line table prologue at 0x00000390 found an invalid directory or file table description at 0x000003bb |
223 |
| -# ALL-NEXT: warning: file names table was not null terminated before the end of the prologue |
224 |
| -# ALL-NOT: warning: |
0 commit comments