]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.dwarf2/fission-reread.S
Update years in copyright notice for the GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / fission-reread.S
1 /* Copyright 2012-2013 Free Software Foundation, Inc.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 3 of the License, or
6 (at your option) any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */
15
16 /* Testcase to exercise the code path in bug 13961 for Fission.
17 http://gcc.gnu.org/wiki/DebugFission
18
19 Compiled from:
20
21 class foo
22 {
23 public:
24 int bar;
25 };
26
27 foo baz;
28
29 int
30 main ()
31 {
32 return 0;
33 }
34
35 And then manually edited to insert the necessary DW_AT_specification
36 entries to trigger the desired code path.
37 There's no real need to make this architecture-specific, so it has been
38 further hand-edited to support that.
39 */
40
41 .file "fission-reread.cc"
42
43 .globl baz
44 .data /* Previously this used .bss, but it's not portable. */
45 .align 4
46 .type baz, @object
47 .size baz, 4
48 baz:
49 .zero 4
50
51 .text
52 .Ltext0:
53 .globl main
54 .type main, @function
55 main:
56 .LFB0:
57 .file 1 "fission-reread.cc"
58 .loc 1 11 0
59 .4byte 0
60 .LFE0:
61 .size main, .-main
62 .Letext0:
63
64 .section .debug_types.dwo
65 .Ltu_start_dwo:
66 .4byte .Ltu_end_dwo - .Ltu_start_dwo - 4 /* Length of Compilation Unit Info */
67 .2byte 0x4 /* DWARF version number */
68 .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
69 .byte 0x4 /* Pointer Size (in bytes) */
70 .byte 0x19 /* Type Signature */
71 .byte 0x8b
72 .byte 0x7e
73 .byte 0xac
74 .byte 0xce
75 .byte 0xf1
76 .byte 0x22
77 .byte 0x90
78 .4byte .Ltu_class_type - .Ltu_start_dwo /* Offset to Type DIE */
79 .uleb128 0x1 /* (DIE (0x17) DW_TAG_type_unit) */
80 .byte 0x4 /* DW_AT_language */
81 .byte 0x73 /* DW_AT_GNU_odr_signature */
82 .byte 0xea
83 .byte 0x85
84 .byte 0x23
85 .byte 0x75
86 .byte 0x8a
87 .byte 0x7e
88 .byte 0x87
89 .4byte .Lskeleton_debug_line0 /* DW_AT_stmt_list */
90
91 /* Manually inserted to have a DW_AT_specification refering to
92 something and appearing ahead of it. */
93 .uleb128 0x8 /* DW_TAG_class_type */
94 .4byte .Ltu_class_type - .Ltu_start_dwo
95 /* End of manual insertion */
96
97 .Ltu_class_type:
98 .uleb128 0x2 /* (DIE (0x25) DW_TAG_class_type) */
99 .ascii "foo\0" /* DW_AT_name */
100 .byte 0x4 /* DW_AT_byte_size */
101 .byte 0x1 /* DW_AT_decl_file (fission-reread.cc) */
102 .byte 0x1 /* DW_AT_decl_line */
103 .4byte .Ltu_int /* DW_AT_sibling */
104 .uleb128 0x3 /* (DIE (0x31) DW_TAG_member) */
105 .ascii "bar\0" /* DW_AT_name */
106 .byte 0x1 /* DW_AT_decl_file (fission-reread.cc) */
107 .byte 0x4 /* DW_AT_decl_line */
108 .4byte .Ltu_int /* DW_AT_type */
109 .byte 0 /* DW_AT_data_member_location */
110 .byte 0x1 /* DW_AT_accessibility */
111 .byte 0 /* end of children of DIE 0x25 */
112 .Ltu_int:
113 .uleb128 0x4 /* (DIE (0x3f) DW_TAG_base_type) */
114 .byte 0x4 /* DW_AT_byte_size */
115 .byte 0x5 /* DW_AT_encoding */
116 .ascii "int\0" /* DW_AT_name */
117 .byte 0 /* end of children of DIE 0x17 */
118 .Ltu_end_dwo:
119
120 .section .debug_types
121 .Ltu_start:
122 .4byte .Ltu_end - .Ltu_start - 4 /* Length of Type Unit Info */
123 .2byte 0x4 /* DWARF version number */
124 .4byte .Lskeleton_debug_abbrev0 /* Offset Into Abbrev. Section */
125 .byte 0x4 /* Pointer Size (in bytes) */
126 .byte 0x19 /* Type Signature */
127 .byte 0x8b
128 .byte 0x7e
129 .byte 0xac
130 .byte 0xce
131 .byte 0xf1
132 .byte 0x22
133 .byte 0x90
134 .4byte 0 /* Offset to Type DIE */
135 .uleb128 0x2 /* (DIE (0) DW_TAG_type_unit) */
136 .ascii "/tmp/src/gdb/testsuite\0" /* DW_AT_comp_dir */
137 /* Normally dwo_name would be "fission-reread.dwo".
138 Simplification: Leave the DWO contents in the executable.
139 "gdb.dwarf2/" is included so that gdb can load the file without
140 having to set "debug-file-directory". This is useful when
141 testing with cc-with-tweaks.sh -i. */
142 .ascii "gdb.dwarf2/fission-reread\0" /* DW_AT_GNU_dwo_name */
143 .4byte .Ldebug_pubnames0 /* DW_AT_GNU_pubnames */
144 .4byte .Ldebug_pubtypes0 /* DW_AT_GNU_pubtypes */
145 .4byte .Ldebug_addr0 /* DW_AT_GNU_addr_base */
146 .Ltu_end:
147
148 .section .debug_info.dwo
149 .Lcu_start_dwo:
150 .4byte .Lcu_end_dwo - .Lcu_start_dwo - 4 /* Length of Compilation Unit Info */
151 .2byte 0x4 /* DWARF version number */
152 .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
153 .byte 0x4 /* Pointer Size (in bytes) */
154 .uleb128 0x5 /* (DIE (0xb) DW_TAG_compile_unit) */
155 .ascii "GNU C++ 4.6.x-fission\0" /* DW_AT_producer */
156 .byte 0x4 /* DW_AT_language */
157 .ascii "gdb.dwarf2/fission-reread.cc\0" /* DW_AT_name */
158 .ascii "/tmp/src/gdb/testsuite\0" /* DW_AT_comp_dir */
159 .byte 0 /* DW_AT_GNU_dwo_id */
160 .byte 0
161 .byte 0
162 .byte 0
163 .byte 0
164 .byte 0
165 .byte 0
166 .byte 0
167 .Lcu_int:
168 .uleb128 0x4 /* (DIE (0x7f) DW_TAG_base_type) */
169 .byte 0x4 /* DW_AT_byte_size */
170 .byte 0x5 /* DW_AT_encoding */
171 .ascii "int\0" /* DW_AT_name */
172 .uleb128 0x6 /* (DIE (0x86) DW_TAG_subprogram) */
173 /* DW_AT_external */
174 .ascii "main\0" /* DW_AT_name */
175 .byte 0x1 /* DW_AT_decl_file (fission-reread.cc) */
176 .byte 0xa /* DW_AT_decl_line */
177 .4byte .Lcu_int /* DW_AT_type */
178 .uleb128 0 /* DW_AT_low_pc */
179 .4byte .LFE0-.LFB0 /* DW_AT_high_pc */
180 .uleb128 0x1 /* DW_AT_frame_base */
181 .byte 0x9c /* DW_OP_call_frame_cfa */
182 .uleb128 0x7 /* (DIE (0x9d) DW_TAG_variable) */
183 .ascii "baz\0" /* DW_AT_name */
184 .byte 0x1 /* DW_AT_decl_file (fission-reread.cc) */
185 .byte 0x7 /* DW_AT_decl_line */
186 .byte 0x19 /* DW_AT_type */
187 .byte 0x8b
188 .byte 0x7e
189 .byte 0xac
190 .byte 0xce
191 .byte 0xf1
192 .byte 0x22
193 .byte 0x90
194 /* DW_AT_external */
195 .uleb128 0x2 /* DW_AT_location */
196 .byte 0xfb /* DW_OP_GNU_addr_index */
197 .uleb128 0x1 /* (index into .debug_addr) */
198 .byte 0 /* end of children of DIE 0xb */
199 .Lcu_end_dwo:
200
201 .section .debug_info
202 .Lskeleton_debug_info0:
203 .Lcu_start:
204 .4byte .Lcu_end - .Lcu_start - 4 /* Length of Compilation Unit Info */
205 .2byte 0x4 /* DWARF version number */
206 .4byte .Lskeleton_debug_abbrev0 /* Offset Into Abbrev. Section */
207 .byte 0x4 /* Pointer Size (in bytes) */
208 .uleb128 0x1 /* (DIE (0) DW_TAG_compile_unit) */
209 .4byte .Ltext0 /* DW_AT_low_pc */
210 .4byte .Letext0-.Ltext0 /* DW_AT_high_pc */
211 .4byte .Ldebug_line0 /* DW_AT_stmt_list */
212 .ascii "/tmp/src/gdb/testsuite\0" /* DW_AT_comp_dir */
213 /* Normally dwo_name would be "fission-reread.dwo".
214 Simplification: Leave the DWO contents in the executable.
215 "gdb.dwarf2/" is included so that gdb can load the file without
216 having to set "debug-file-directory". This is useful when
217 testing with cc-with-tweaks.sh -i. */
218 .ascii "gdb.dwarf2/fission-reread\0" /* DW_AT_GNU_dwo_name */
219 .4byte .Ldebug_pubnames0 /* DW_AT_GNU_pubnames */
220 .4byte .Ldebug_pubtypes0 /* DW_AT_GNU_pubtypes */
221 .4byte .Ldebug_addr0 /* DW_AT_GNU_addr_base */
222 .byte 0 /* DW_AT_GNU_dwo_id */
223 .byte 0
224 .byte 0
225 .byte 0
226 .byte 0
227 .byte 0
228 .byte 0
229 .byte 0
230 .Lcu_end:
231
232 .section .debug_abbrev
233 .Lskeleton_debug_abbrev0:
234 .uleb128 0x1 /* (abbrev code) */
235 .uleb128 0x11 /* (TAG: DW_TAG_compile_unit) */
236 .byte 0 /* DW_children_no */
237 .uleb128 0x11 /* (DW_AT_low_pc) */
238 .uleb128 0x1 /* (DW_FORM_addr) */
239 .uleb128 0x12 /* (DW_AT_high_pc) */
240 .uleb128 0x6 /* (DW_FORM_data4) */
241 .uleb128 0x10 /* (DW_AT_stmt_list) */
242 .uleb128 0x17 /* (DW_FORM_sec_offset) */
243 .uleb128 0x1b /* (DW_AT_comp_dir) */
244 .uleb128 0x8 /* (DW_FORM_string) */
245 .uleb128 0x2130 /* (DW_AT_GNU_dwo_name) */
246 .uleb128 0x8 /* (DW_FORM_string) */
247 .uleb128 0x2134 /* (DW_AT_GNU_pubnames) */
248 .uleb128 0x17 /* (DW_FORM_sec_offset) */
249 .uleb128 0x2135 /* (DW_AT_GNU_pubtypes) */
250 .uleb128 0x17 /* (DW_FORM_sec_offset) */
251 .uleb128 0x2133 /* (DW_AT_GNU_addr_base) */
252 .uleb128 0x17 /* (DW_FORM_sec_offset) */
253 .uleb128 0x2131 /* (DW_AT_GNU_dwo_id) */
254 .uleb128 0x7 /* (DW_FORM_data8) */
255 .byte 0
256 .byte 0
257 .uleb128 0x2 /* (abbrev code) */
258 .uleb128 0x41 /* (TAG: DW_TAG_type_unit) */
259 .byte 0 /* DW_children_no */
260 .uleb128 0x1b /* (DW_AT_comp_dir) */
261 .uleb128 0x8 /* (DW_FORM_string) */
262 .uleb128 0x2130 /* (DW_AT_GNU_dwo_name) */
263 .uleb128 0x8 /* (DW_FORM_string) */
264 .uleb128 0x2134 /* (DW_AT_GNU_pubnames) */
265 .uleb128 0x17 /* (DW_FORM_sec_offset) */
266 .uleb128 0x2135 /* (DW_AT_GNU_pubtypes) */
267 .uleb128 0x17 /* (DW_FORM_sec_offset) */
268 .uleb128 0x2133 /* (DW_AT_GNU_addr_base) */
269 .uleb128 0x17 /* (DW_FORM_sec_offset) */
270 .byte 0
271 .byte 0
272 .byte 0 /* end of skeleton .debug_abbrev */
273 .section .debug_abbrev.dwo
274 .Ldebug_abbrev0:
275 .uleb128 0x1 /* (abbrev code) */
276 .uleb128 0x41 /* (TAG: DW_TAG_type_unit) */
277 .byte 0x1 /* DW_children_yes */
278 .uleb128 0x13 /* (DW_AT_language) */
279 .uleb128 0xb /* (DW_FORM_data1) */
280 .uleb128 0x210f /* (DW_AT_GNU_odr_signature) */
281 .uleb128 0x7 /* (DW_FORM_data8) */
282 .uleb128 0x10 /* (DW_AT_stmt_list) */
283 .uleb128 0x17 /* (DW_FORM_sec_offset) */
284 .byte 0
285 .byte 0
286 .uleb128 0x2 /* (abbrev code) */
287 .uleb128 0x2 /* (TAG: DW_TAG_class_type) */
288 .byte 0x1 /* DW_children_yes */
289 .uleb128 0x3 /* (DW_AT_name) */
290 .uleb128 0x8 /* (DW_FORM_string) */
291 .uleb128 0xb /* (DW_AT_byte_size) */
292 .uleb128 0xb /* (DW_FORM_data1) */
293 .uleb128 0x3a /* (DW_AT_decl_file) */
294 .uleb128 0xb /* (DW_FORM_data1) */
295 .uleb128 0x3b /* (DW_AT_decl_line) */
296 .uleb128 0xb /* (DW_FORM_data1) */
297 .uleb128 0x1 /* (DW_AT_sibling) */
298 .uleb128 0x13 /* (DW_FORM_ref4) */
299 .byte 0
300 .byte 0
301 .uleb128 0x3 /* (abbrev code) */
302 .uleb128 0xd /* (TAG: DW_TAG_member) */
303 .byte 0 /* DW_children_no */
304 .uleb128 0x3 /* (DW_AT_name) */
305 .uleb128 0x8 /* (DW_FORM_string) */
306 .uleb128 0x3a /* (DW_AT_decl_file) */
307 .uleb128 0xb /* (DW_FORM_data1) */
308 .uleb128 0x3b /* (DW_AT_decl_line) */
309 .uleb128 0xb /* (DW_FORM_data1) */
310 .uleb128 0x49 /* (DW_AT_type) */
311 .uleb128 0x13 /* (DW_FORM_ref4) */
312 .uleb128 0x38 /* (DW_AT_data_member_location) */
313 .uleb128 0xb /* (DW_FORM_data1) */
314 .uleb128 0x32 /* (DW_AT_accessibility) */
315 .uleb128 0xb /* (DW_FORM_data1) */
316 .byte 0
317 .byte 0
318 .uleb128 0x4 /* (abbrev code) */
319 .uleb128 0x24 /* (TAG: DW_TAG_base_type) */
320 .byte 0 /* DW_children_no */
321 .uleb128 0xb /* (DW_AT_byte_size) */
322 .uleb128 0xb /* (DW_FORM_data1) */
323 .uleb128 0x3e /* (DW_AT_encoding) */
324 .uleb128 0xb /* (DW_FORM_data1) */
325 .uleb128 0x3 /* (DW_AT_name) */
326 .uleb128 0x8 /* (DW_FORM_string) */
327 .byte 0
328 .byte 0
329 .uleb128 0x5 /* (abbrev code) */
330 .uleb128 0x11 /* (TAG: DW_TAG_compile_unit) */
331 .byte 0x1 /* DW_children_yes */
332 .uleb128 0x25 /* (DW_AT_producer) */
333 .uleb128 0x8 /* (DW_FORM_string) */
334 .uleb128 0x13 /* (DW_AT_language) */
335 .uleb128 0xb /* (DW_FORM_data1) */
336 .uleb128 0x3 /* (DW_AT_name) */
337 .uleb128 0x8 /* (DW_FORM_string) */
338 .uleb128 0x1b /* (DW_AT_comp_dir) */
339 .uleb128 0x8 /* (DW_FORM_string) */
340 .uleb128 0x2131 /* (DW_AT_GNU_dwo_id) */
341 .uleb128 0x7 /* (DW_FORM_data8) */
342 .byte 0
343 .byte 0
344 .uleb128 0x6 /* (abbrev code) */
345 .uleb128 0x2e /* (TAG: DW_TAG_subprogram) */
346 .byte 0 /* DW_children_no */
347 .uleb128 0x3f /* (DW_AT_external) */
348 .uleb128 0x19 /* (DW_FORM_flag_present) */
349 .uleb128 0x3 /* (DW_AT_name) */
350 .uleb128 0x8 /* (DW_FORM_string) */
351 .uleb128 0x3a /* (DW_AT_decl_file) */
352 .uleb128 0xb /* (DW_FORM_data1) */
353 .uleb128 0x3b /* (DW_AT_decl_line) */
354 .uleb128 0xb /* (DW_FORM_data1) */
355 .uleb128 0x49 /* (DW_AT_type) */
356 .uleb128 0x13 /* (DW_FORM_ref4) */
357 .uleb128 0x11 /* (DW_AT_low_pc) */
358 .uleb128 0x1f01 /* (DW_FORM_GNU_addr_index) */
359 .uleb128 0x12 /* (DW_AT_high_pc) */
360 .uleb128 0x6 /* (DW_FORM_data4) */
361 .uleb128 0x40 /* (DW_AT_frame_base) */
362 .uleb128 0x18 /* (DW_FORM_exprloc) */
363 .byte 0
364 .byte 0
365 .uleb128 0x7 /* (abbrev code) */
366 .uleb128 0x34 /* (TAG: DW_TAG_variable) */
367 .byte 0 /* DW_children_no */
368 .uleb128 0x3 /* (DW_AT_name) */
369 .uleb128 0x8 /* (DW_FORM_string) */
370 .uleb128 0x3a /* (DW_AT_decl_file) */
371 .uleb128 0xb /* (DW_FORM_data1) */
372 .uleb128 0x3b /* (DW_AT_decl_line) */
373 .uleb128 0xb /* (DW_FORM_data1) */
374 .uleb128 0x49 /* (DW_AT_type) */
375 .uleb128 0x20 /* (DW_FORM_ref_sig8) */
376 .uleb128 0x3f /* (DW_AT_external) */
377 .uleb128 0x19 /* (DW_FORM_flag_present) */
378 .uleb128 0x2 /* (DW_AT_location) */
379 .uleb128 0x18 /* (DW_FORM_exprloc) */
380 .byte 0
381 .byte 0
382
383 /* Manually inserted. */
384 .uleb128 0x8 /* abbrev code */
385 .uleb128 0x2 /* DW_TAG_class_type */
386 .byte 0x0 /* DW_has_children_no */
387 .uleb128 0x47 /* DW_AT_specification */
388 .uleb128 0x13 /* DW_FORM_ref4 */
389 .byte 0x0 /* Terminator */
390 .byte 0x0 /* Terminator */
391 /* End of manual insertion. */
392
393 .byte 0
394 .section .debug_pubnames
395 .Ldebug_pubnames0:
396 .4byte 0x1f /* Length of Public Names Info */
397 .2byte 0x2 /* DWARF Version */
398 .4byte .Lskeleton_debug_info0 /* Offset of Compilation Unit Info */
399 .4byte 0xb0 /* Compilation Unit Length */
400 .4byte 0x86 /* DIE offset */
401 .ascii "main\0" /* external name */
402 .4byte 0x9d /* DIE offset */
403 .ascii "baz\0" /* external name */
404 .4byte 0
405 .section .debug_pubtypes
406 .Ldebug_pubtypes0:
407 .4byte 0x1e /* Length of Public Type Names Info */
408 .2byte 0x2 /* DWARF Version */
409 .4byte .Lskeleton_debug_info0 /* Offset of Compilation Unit Info */
410 .4byte 0xb0 /* Compilation Unit Length */
411 .4byte 0x7f /* DIE offset */
412 .ascii "int\0" /* external name */
413 .4byte 0x25 /* DIE offset */
414 .ascii "foo\0" /* external name */
415 .4byte 0
416 .section .debug_aranges
417 .4byte 0x2c /* Length of Address Ranges Info */
418 .2byte 0x2 /* DWARF Version */
419 .4byte .Lskeleton_debug_info0 /* Offset of Compilation Unit Info */
420 .byte 0x8 /* Size of Address */
421 .byte 0 /* Size of Segment Descriptor */
422 .2byte 0 /* Pad to 16 byte boundary */
423 .2byte 0
424 .4byte .Ltext0 /* Address */
425 .4byte .Letext0-.Ltext0 /* Length */
426 .4byte 0
427 .4byte 0
428 .section .debug_line
429 .Ldebug_line0:
430 .section .debug_line.dwo
431 .Lskeleton_debug_line0:
432 .4byte .LELT0-.LSLT0 /* Length of Source Line Info */
433 .LSLT0:
434 .2byte 0x4 /* DWARF Version */
435 .4byte .LELTP0-.LASLTP0 /* Prolog Length */
436 .LASLTP0:
437 .byte 0x1 /* Minimum Instruction Length */
438 .byte 0x1 /* Maximum Operations Per Instruction */
439 .byte 0x1 /* Default is_stmt_start flag */
440 .byte 0xf6 /* Line Base Value (Special Opcodes) */
441 .byte 0xf5 /* Line Range Value (Special Opcodes) */
442 .byte 0xa /* Special Opcode Base */
443 .byte 0 /* opcode: 0x1 has 0 args */
444 .byte 0x1 /* opcode: 0x2 has 1 args */
445 .byte 0x1 /* opcode: 0x3 has 1 args */
446 .byte 0x1 /* opcode: 0x4 has 1 args */
447 .byte 0x1 /* opcode: 0x5 has 1 args */
448 .byte 0 /* opcode: 0x6 has 0 args */
449 .byte 0 /* opcode: 0x7 has 0 args */
450 .byte 0 /* opcode: 0x8 has 0 args */
451 .byte 0x1 /* opcode: 0x9 has 1 args */
452 .byte 0 /* End directory table */
453 .ascii "fission-reread.cc\0" /* File Entry: 0x1 */
454 .uleb128 0
455 .uleb128 0
456 .uleb128 0
457 .byte 0 /* End file name table */
458 .LELTP0:
459 .LELT0:
460 .section .debug_addr
461 .Ldebug_addr0:
462 .4byte .LFB0 /* DW_AT_low_pc */
463 .4byte baz /* DW_AT_location */