xref: /llvm-project/llvm/test/tools/llvm-dwarfdump/X86/Inputs/debug_line_malformed.s (revision 6f55b5a101d95b1049643f87a6572b36d6b4b44c)
1.section .debug_line,"",@progbits
2# Leading good section.
3.long   .Lunit1_end - .Lunit1_start # Length of Unit (DWARF-32 format)
4.Lunit1_start:
5.short  4               # DWARF version number
6.long   .Lprologue1_end-.Lprologue1_start # Length of Prologue
7.Lprologue1_start:
8.byte   1               # Minimum Instruction Length
9.byte   1               # Maximum Operations per Instruction
10.byte   1               # Default is_stmt
11.byte   -5              # Line Base
12.byte   14              # Line Range
13.byte   13              # Opcode Base
14.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
15.asciz "dir1"           # Include table
16.asciz "dir2"
17.byte   0
18.asciz "file1"          # File table
19.byte   0, 0, 0
20.asciz "file2"
21.byte   1, 0, 0
22.byte   0
23.Lprologue1_end:
24.byte   0, 9, 2         # DW_LNE_set_address
25.quad   0x0badbeef
26.byte   0, 1, 1         # DW_LNE_end_sequence
27.Lunit1_end:
28
29# Version 0.
30.long   .Lunit_v0_end - .Lunit_v0_start # unit length
31.Lunit_v0_start:
32.short  0               # version
33.Lunit_v0_end:
34
35# Version 1.
36.long   .Lunit_v1_end - .Lunit_v1_start # unit length
37.Lunit_v1_start:
38.short  1               # version
39.Lunit_v1_end:
40
41# Version 5 malformed line/include table.
42.long   .Lunit_v5_end - .Lunit_v5_start # unit length
43.Lunit_v5_start:
44.short  5               # version
45.byte   8               # address size
46.byte   8               # segment selector
47.long   .Lprologue_v5_end-.Lprologue_v5_start # Length of Prologue
48.Lprologue_v5_start:
49.byte   1               # Minimum Instruction Length
50.byte   1               # Maximum Operations per Instruction
51.byte   1               # Default is_stmt
52.byte   -5              # Line Base
53.byte   14              # Line Range
54.byte   13              # Opcode Base
55.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
56.byte   0               # directory table (invalid as no path component)
57.Lprologue_v5_end:
58.byte   0, 9, 2         # DW_LNE_set_address
59.quad   0x8877665544332211
60.byte   0, 1, 1         # DW_LNE_end_sequence
61.Lunit_v5_end:
62
63# Short prologue.
64.long   .Lunit_short_prologue_end - .Lunit_short_prologue_start # unit length
65.Lunit_short_prologue_start:
66.short  4               # version
67.long   .Lprologue_short_prologue_end-.Lprologue_short_prologue_start # Length of Prologue
68.Lprologue_short_prologue_start:
69.byte   1               # Minimum Instruction Length
70.byte   1               # Maximum Operations per Instruction
71.byte   1               # Default is_stmt
72.byte   -5              # Line Base
73.byte   14              # Line Range
74.byte   13              # Opcode Base
75.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
76.asciz "dir1"           # Include table
77.asciz "dir2"
78.byte   0
79.asciz "file1"          # File table
80.byte   1, 2, 3
81.asciz "file2"
82.byte   1, 2
83.Lprologue_short_prologue_end:
84.byte   0, 9, 2         # DW_LNE_set_address
85.quad   0x1122334455667788
86.byte   0, 1, 1         # DW_LNE_end_sequence
87.Lunit_short_prologue_end:
88
89# Over-long prologue.
90.long   .Lunit_long_prologue_end - .Lunit_long_prologue_start # unit length
91.Lunit_long_prologue_start:
92.short  4               # version
93.long   .Lprologue_long_prologue_end-.Lprologue_long_prologue_start # Length of Prologue
94.Lprologue_long_prologue_start:
95.byte   1               # Minimum Instruction Length
96.byte   1               # Maximum Operations per Instruction
97.byte   1               # Default is_stmt
98.byte   -5              # Line Base
99.byte   14              # Line Range
100.byte   13              # Opcode Base
101.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
102.asciz "dir1"           # Include table
103.asciz "dir2"
104.byte   0
105.asciz "file1"          # File table
106.byte   0, 0, 0
107.asciz "file2"
108.byte   1, 2, 3
109.byte   0
110# Skipped byte (treated as part of prologue).
111.byte   6
112.Lprologue_long_prologue_end:
113.byte   0, 9, 2        # DW_LNE_set_address
114.quad   0x1111222233334444
115.byte   0, 1, 1        # DW_LNE_end_sequence
116.Lunit_long_prologue_end:
117
118# Incorrect length extended opcodes.
119.long   .Lunit_long_opcode_end - .Lunit_long_opcode_start # unit length
120.Lunit_long_opcode_start:
121.short  4               # version
122.long   .Lprologue_long_opcode_end-.Lprologue_long_opcode_start # Length of Prologue
123.Lprologue_long_opcode_start:
124.byte   1               # Minimum Instruction Length
125.byte   1               # Maximum Operations per Instruction
126.byte   1               # Default is_stmt
127.byte   -5              # Line Base
128.byte   14              # Line Range
129.byte   13              # Opcode Base
130.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
131.asciz "dir1"           # Include table
132.asciz "dir2"
133.byte   0
134.asciz "file1"          # File table
135.byte   0, 0, 0
136.asciz "file2"
137.byte   1, 0, 0
138.byte   0
139.Lprologue_long_opcode_end:
140.byte   0, 9, 2         # DW_LNE_set_address
141.quad   0xabbadaba
142.byte   0, 2, 1         # DW_LNE_end_sequence (too long)
143.byte   6               # DW_LNS_negate_stmt (but will be consumed with the end sequence above).
144.byte   0, 1, 4         # DW_LNE_set_discriminator (too short)
145.byte   0xa             # Parsed as argument for set_discriminator and also DW_LNS_set_prologue_end.
146.byte   0, 9, 2         # DW_LNE_set_address
147.quad   0xbabb1e45
148.byte   0, 1, 1         # DW_LNE_end_sequence
149.Lunit_long_opcode_end:
150
151# No end of sequence.
152.long   .Lunit_no_eos_end - .Lunit_no_eos_start # unit length
153.Lunit_no_eos_start:
154.short  4               # version
155.long   .Lprologue_no_eos_end-.Lprologue_no_eos_start # Length of Prologue
156.Lprologue_no_eos_start:
157.byte   1               # Minimum Instruction Length
158.byte   1               # Maximum Operations per Instruction
159.byte   1               # Default is_stmt
160.byte   -5              # Line Base
161.byte   14              # Line Range
162.byte   13              # Opcode Base
163.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
164.asciz "dir1"           # Include table
165.asciz "dir2"
166.byte   0
167.asciz "file1"          # File table
168.byte   0, 0, 0
169.asciz "file2"
170.byte   1, 0, 0
171.byte   0
172.Lprologue_no_eos_end:
173.byte   0, 9, 2        # DW_LNE_set_address
174.quad   0xdeadfade
175.byte   1              # DW_LNS_copy
176.Lunit_no_eos_end:
177
178# V5 very short prologue length.
179.long   .Linvalid_description_end0-.Linvalid_description_start0   # Length of Unit
180.Linvalid_description_start0:
181.short  5               # DWARF version number
182.byte   8               # Address Size
183.byte   0               # Segment Selector Size
184.long   .Linvalid_description_header_end0 - .Linvalid_description_params0 # Length of Prologue (invalid)
185.Linvalid_description_params0:
186.byte   1               # Minimum Instruction Length
187.byte   1               # Maximum Operations per Instruction
188.byte   1               # Default is_stmt
189.byte   -5              # Line Base
190.byte   14              # Line Range
191.byte   13              # Opcode Base
192.byte   0, 1, 1, 1, 1, 0, 0, 0, 0, 1 # Standard Opcode Lengths
193.Linvalid_description_header_end0:
194.byte   0, 9, 2        # DW_LNE_set_address
195.quad   0xbabb1ebabb1e
196.byte   0, 1, 1         # DW_LNE_end_sequence
197.Linvalid_description_end0:
198
199# V5 prologue ends during file table.
200.long   .Linvalid_file_end0-.Linvalid_file_start0   # Length of Unit
201.Linvalid_file_start0:
202.short  5               # DWARF version number
203.byte   8               # Address Size
204.byte   0               # Segment Selector Size
205.long   .Linvalid_file_header_end0 - .Linvalid_file_params0 # Length of Prologue (invalid)
206.Linvalid_file_params0:
207.byte   1               # Minimum Instruction Length
208.byte   1               # Maximum Operations per Instruction
209.byte   1               # Default is_stmt
210.byte   -5              # Line Base
211.byte   14              # Line Range
212.byte   13              # Opcode Base
213.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
214# Directory table format
215.byte   1               # One element per directory entry
216.byte   1               # DW_LNCT_path
217.byte   0x08            # DW_FORM_string
218# Directory table entries
219.byte   1               # 1 directory
220.asciz  "/tmp"
221# File table format
222.byte   2               # 2 elements per file entry
223.byte   1               # DW_LNCT_path
224.byte   0x08            # DW_FORM_string
225.byte   2               # DW_LNCT_directory_index
226.Linvalid_file_header_end0:
227.byte   0, 9, 2         # DW_LNE_set_address
228.quad   0xab4acadab4a
229.byte   0, 1, 1         # DW_LNE_end_sequence
230.Linvalid_file_end0:
231
232# V5 prologue ends during directory table.
233.long   .Linvalid_dir_end0-.Linvalid_dir_start0   # Length of Unit
234.Linvalid_dir_start0:
235.short  5               # DWARF version number
236.byte   8               # Address Size
237.byte   0               # Segment Selector Size
238.long   .Linvalid_dir_header_end0 - .Linvalid_dir_params0 # Length of Prologue (invalid)
239.Linvalid_dir_params0:
240.byte   1               # Minimum Instruction Length
241.byte   1               # Maximum Operations per Instruction
242.byte   1               # Default is_stmt
243.byte   -5              # Line Base
244.byte   14              # Line Range
245.byte   13              # Opcode Base
246.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
247# Directory table format
248.byte   1               # One element per directory entry
249.byte   1               # DW_LNCT_path
250.byte   0x08            # DW_FORM_string
251# Directory table entries
252.byte   1               # 1 directory
253.Linvalid_dir_header_end0:
254.byte   0, 9, 2         # DW_LNE_set_address
255.quad   0x4444333322221111
256.byte   0, 1, 1         # DW_LNE_end_sequence
257.Linvalid_dir_end0:
258
259# Header truncated while reading the MD5 data.
260.long   .Linvalid_md5_end0-.Linvalid_md5_start0   # Length of Unit
261.Linvalid_md5_start0:
262.short  5               # DWARF version number
263.byte   8               # Address Size
264.byte   0               # Segment Selector Size
265.long   .Linvalid_md5_header_end0-.Linvalid_md5_params0     # Length of Prologue
266.Linvalid_md5_params0:
267.byte   1               # Minimum Instruction Length
268.byte   1               # Maximum Operations per Instruction
269.byte   1               # Default is_stmt
270.byte   -5              # Line Base
271.byte   14              # Line Range
272.byte   13              # Opcode Base
273.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
274# Directory table format
275.byte   1               # One element per directory entry
276.byte   1               # DW_LNCT_path
277.byte   0x08            # DW_FORM_string
278# Directory table entries
279.byte   1               # 1 directory
280.asciz  "/tmp"
281# File table format
282.byte   3               # 3 elements per file entry
283.byte   1               # DW_LNCT_path
284.byte   0x08            # DW_FORM_string
285.byte   5               # DW_LNCT_MD5
286.byte   0x1e            # DW_FORM_data16
287.byte   2               # DW_LNCT_directory_index
288.byte   0x0b            # DW_FORM_data1
289# File table entries
290.byte   1               # 1 file
291.asciz  "a.c"
292.byte   0
293# Data to show that the rest of the prologue is skipped.
294.byte   1
295.Linvalid_md5_header_end0:
296.byte   0, 9, 2         # DW_LNE_set_address
297.quad   0x1234123412341234
298.byte   0, 1, 1         # DW_LNE_end_sequence
299.Linvalid_md5_end0:
300
301# Header truncated while reading the MD5 form.
302.long   .Linvalid_md5_end1-.Linvalid_md5_start1   # Length of Unit
303.Linvalid_md5_start1:
304.short  5               # DWARF version number
305.byte   8               # Address Size
306.byte   0               # Segment Selector Size
307.long   .Linvalid_md5_header_end1 - .Linvalid_md5_params1 # Length of Prologue
308.Linvalid_md5_params1:
309.byte   1               # Minimum Instruction Length
310.byte   1               # Maximum Operations per Instruction
311.byte   1               # Default is_stmt
312.byte   -5              # Line Base
313.byte   14              # Line Range
314.byte   13              # Opcode Base
315.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
316# Directory table format
317.byte   1               # One element per directory entry
318.byte   1               # DW_LNCT_path
319.byte   0x08            # DW_FORM_string
320# Directory table entries
321.byte   1               # 1 directory
322.asciz  "/tmp"
323# File table format
324.byte   2               # 2 elements per file entry
325.byte   1               # DW_LNCT_path
326.byte   0x08            # DW_FORM_string
327.byte   5               # DW_LNCT_MD5
328.Linvalid_md5_header_end1:
329.byte   0, 9, 2         # DW_LNE_set_address
330.quad   0x4321432143214321
331.byte   0, 1, 1         # DW_LNE_end_sequence
332.Linvalid_md5_end1:
333
334# V5 invalid directory content description has unsupported form.
335.long   .Linvalid_dir_form_end0-.Linvalid_dir_form_start0   # Length of Unit
336.Linvalid_dir_form_start0:
337.short  5               # DWARF version number
338.byte   8               # Address Size
339.byte   0               # Segment Selector Size
340.long   .Linvalid_dir_form_header_end0 - .Linvalid_dir_form_params0
341.Linvalid_dir_form_params0:
342.byte   1               # Minimum Instruction Length
343.byte   1               # Maximum Operations per Instruction
344.byte   1               # Default is_stmt
345.byte   -5              # Line Base
346.byte   14              # Line Range
347.byte   13              # Opcode Base
348.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
349# Directory table format
350.byte   2               # Two elements per directory entry
351.byte   1               # DW_LNCT_path
352.byte   0x08            # DW_FORM_string
353.byte   2               # DW_LNCT_directory_index (ignored)
354.byte   0x7f            # Unknown form
355# Directory table entries
356.byte   2               # 2 directories
357.asciz  "/foo"          # Directory name
358.byte   0xff            # Arbitrary data for unknown form
359.asciz  "/bar"          # Directory name
360.byte   0xff            # Arbitrary data for unknown form
361# File table format
362.byte   1               # 1 element per file entry
363.byte   1               # DW_LNCT_path
364.byte   0x08            # DW_FORM_string
365# File table entries
366.byte   1               # 1 file
367.asciz  "xyz"           # File names
368.Linvalid_dir_form_header_end0:
369.byte   0, 9, 2         # DW_LNE_set_address
370.quad   0xaaaabbbbccccdddd
371.byte   0, 1, 1         # DW_LNE_end_sequence
372.Linvalid_dir_form_end0:
373
374# Zero opcode base.
375.long   .Lzero_opcode_base_end - .Lzero_opcode_base_start # unit length
376.Lzero_opcode_base_start:
377.short  4               # version
378.long   .Lzero_opcode_base_prologue_end-.Lzero_opcode_base_prologue_start # Length of Prologue
379.Lzero_opcode_base_prologue_start:
380.byte   1               # Minimum Instruction Length
381.byte   1               # Maximum Operations per Instruction
382.byte   1               # Default is_stmt
383.byte   0               # Line Base
384.byte   1               # Line Range
385.byte   0               # Opcode Base
386.asciz "dir1"           # Include table
387.byte   0
388.asciz "file1"
389.byte   1, 2, 3
390.byte   0
391.Lzero_opcode_base_prologue_end:
392.byte   0, 9, 2        # DW_LNE_set_address
393.quad   0xffffeeeeddddcccc
394.byte   0x1            # Special opcode
395.byte   0, 1, 1        # DW_LNE_end_sequence
396.Lzero_opcode_base_end:
397
398# V4 table with unterminated include directory table.
399.long   .Lunterminated_include_end - .Lunterminated_include_start # unit length
400.Lunterminated_include_start:
401.short  4               # version
402.long   .Lunterminated_include_prologue_end-.Lunterminated_include_prologue_start # Length of Prologue
403.Lunterminated_include_prologue_start:
404.byte   1               # Minimum Instruction Length
405.byte   1               # Maximum Operations per Instruction
406.byte   1               # Default is_stmt
407.byte   -5              # Line Base
408.byte   14              # Line Range
409.byte   13              # Opcode Base
410.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
411.asciz  "dir1"          # Include table
412.Lunterminated_include_prologue_end:
413.byte   0, 9, 2         # DW_LNE_set_address
414.quad   0xabcdef0123456789
415.byte   0, 1, 1         # DW_LNE_end_sequence
416.Lunterminated_include_end:
417
418# V4 table with unterminated file name table.
419.long   .Lunterminated_files_end - .Lunterminated_files_start # unit length
420.Lunterminated_files_start:
421.short  4               # version
422.long   .Lunterminated_files_prologue_end-.Lunterminated_files_prologue_start # Length of Prologue
423.Lunterminated_files_prologue_start:
424.byte   1               # Minimum Instruction Length
425.byte   1               # Maximum Operations per Instruction
426.byte   1               # Default is_stmt
427.byte   -5              # Line Base
428.byte   14              # Line Range
429.byte   13              # Opcode Base
430.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
431.asciz  "dir1"          # Include table
432.byte   0
433.asciz  "foo.c"         # File table
434.byte   1, 2, 3
435.Lunterminated_files_prologue_end:
436.byte   0, 9, 2         # DW_LNE_set_address
437.quad   0xababcdcdefef0909
438.byte   0, 1, 1         # DW_LNE_end_sequence
439.Lunterminated_files_end:
440
441# Opcode extends past the end of the table, as claimed by the unit length field.
442.long   .Lextended_past_end_end - .Lextended_past_end_start # Length of Unit
443.Lextended_past_end_start:
444.short  4               # DWARF version number
445.long   .Lprologue_extended_past_end_end-.Lprologue_extended_past_end_start # Length of Prologue
446.Lprologue_extended_past_end_start:
447.byte   1               # Minimum Instruction Length
448.byte   1               # Maximum Operations per Instruction
449.byte   1               # Default is_stmt
450.byte   -5              # Line Base
451.byte   14              # Line Range
452.byte   13              # Opcode Base
453.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
454.asciz "dir1"           # Include table
455.asciz "dir2"
456.byte   0
457.asciz "file1"          # File table
458.byte   0, 0, 0
459.asciz "file2"
460.byte   1, 0, 0
461.byte   0
462.Lprologue_extended_past_end_end:
463.byte   0, 9, 2         # DW_LNE_set_address
464.quad   0xfeedfeed
465.byte   1               # DW_LNS_copy
466.byte   0, 9, 2         # DW_LNE_set_address
467.long   0xf001f000      # Truncated address (should be 8 bytes)
468.byte   0xf0, 0, 1
469.Lextended_past_end_end:
470
471# Trailing good section.
472.long   .Lunit_good_end - .Lunit_good_start # Length of Unit (DWARF-32 format)
473.Lunit_good_start:
474.short  4               # DWARF version number
475.long   .Lprologue_good_end-.Lprologue_good_start # Length of Prologue
476.Lprologue_good_start:
477.byte   1               # Minimum Instruction Length
478.byte   1               # Maximum Operations per Instruction
479.byte   1               # Default is_stmt
480.byte   -5              # Line Base
481.byte   14              # Line Range
482.byte   13              # Opcode Base
483.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
484.asciz "dir1"           # Include table
485.asciz "dir2"
486.byte   0
487.asciz "file1"          # File table
488.byte   0, 0, 0
489.asciz "file2"
490.byte   1, 0, 0
491.byte   0
492.Lprologue_good_end:
493.byte   0, 9, 2         # DW_LNE_set_address
494.quad   0xcafebabe
495.byte   0, 1, 1         # DW_LNE_end_sequence
496.Lunit_good_end:
497