1 /* This testcase is part of GDB, the GNU debugger.
3 Copyright 2013 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 This file was created by doing:
19 gcc -O2 -gdwarf-4 -gsplit-debug -S -dA fission-loclists.c
20 and then massaging the output.
26 __attribute__ ((noinline)) void foo (int* x) { v = *x; }
29 main (int argc, char *argv[])
36 .file "fission-loclists.c"
44 .file 1 "fission-loclists.c"
45 # fission-loclists.c:3
49 # BLOCK 2 freq:10000 seq:0
50 # PRED: ENTRY [100.0%] (fallthru)
51 # fission-loclists.c:3
60 .text # was .section .text.startup,"ax",@progbits
66 # fission-loclists.c:7
70 # BLOCK 2 freq:10000 seq:0
71 # PRED: ENTRY [100.0%] (fallthru)
73 .cfi_def_cfa_offset 16
74 # fission-loclists.c:7
77 # fission-loclists.c:8
83 # fission-loclists.c:10
96 .section .debug_addr,"",@progbits
105 .section .debug_info.dwo,"",@progbits
107 .4byte .Ldebug_info0_end - .Ldebug_info0 - 4 # Length of Compilation Unit Info
108 .value 0x4 # DWARF version number
109 .4byte .Ldebug_abbrev0 # Offset Into Abbrev. Section
110 .byte 0x8 # Pointer Size (in bytes)
111 .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
112 .ascii "GNU C 4.7.x-fission\0" # DW_AT_producer
113 .byte 0x1 # DW_AT_language
114 .ascii "fission-loclists.c\0" # DW_AT_name
115 .ascii "/tmp\0" # DW_AT_comp_dir
116 .byte 0xcb # DW_AT_GNU_dwo_id
125 .uleb128 0x2 # (DIE (0x5c) DW_TAG_subprogram)
127 .ascii "foo\0" # DW_AT_name
128 .byte 0x1 # DW_AT_decl_file (fission-loclists.c)
129 .byte 0x3 # DW_AT_decl_line
131 .uleb128 0x3 # DW_AT_low_pc
132 .8byte .LFE0-.LFB0 # DW_AT_high_pc
133 .uleb128 0x1 # DW_AT_frame_base
134 .byte 0x9c # DW_OP_call_frame_cfa
135 # DW_AT_GNU_all_call_sites
136 .4byte .Lint_ptr_type - .Ldebug_info0 # DW_AT_sibling
137 .uleb128 0x3 # (DIE (0x72) DW_TAG_formal_parameter)
138 .ascii "x\0" # DW_AT_name
139 .byte 0x1 # DW_AT_decl_file (fission-loclists.c)
140 .byte 0x3 # DW_AT_decl_line
141 .4byte .Lint_ptr_type - .Ldebug_info0 # DW_AT_type
142 .uleb128 0x1 # DW_AT_location
143 .byte 0x55 # DW_OP_reg5
144 .byte 0 # end of children of DIE 0x5c
146 .uleb128 0x4 # (DIE (0x7e) DW_TAG_pointer_type)
147 .byte 0x8 # DW_AT_byte_size
148 .4byte .Lint_type - .Ldebug_info0 # DW_AT_type
150 .uleb128 0x5 # (DIE (0x84) DW_TAG_base_type)
151 .byte 0x4 # DW_AT_byte_size
152 .byte 0x5 # DW_AT_encoding
153 .ascii "int\0" # DW_AT_name
154 .uleb128 0x6 # (DIE (0x8b) DW_TAG_subprogram)
156 .ascii "main\0" # DW_AT_name
157 .byte 0x1 # DW_AT_decl_file (fission-loclists.c)
158 .byte 0x6 # DW_AT_decl_line
160 .4byte .Lint_type - .Ldebug_info0 # DW_AT_type
161 .uleb128 0x4 # DW_AT_low_pc
162 .8byte .LFE1-.LFB1 # DW_AT_high_pc
163 .uleb128 0x1 # DW_AT_frame_base
164 .byte 0x9c # DW_OP_call_frame_cfa
165 # DW_AT_GNU_all_call_sites
166 .4byte .Lchar_ptr_ptr_type - .Ldebug_info0 # DW_AT_sibling
167 .uleb128 0x7 # (DIE (0xa6) DW_TAG_formal_parameter)
168 .ascii "argc\0" # DW_AT_name
169 .byte 0x1 # DW_AT_decl_file (fission-loclists.c)
170 .byte 0x6 # DW_AT_decl_line
171 .4byte .Lint_type - .Ldebug_info0 # DW_AT_type
172 .4byte .LLST0-.Ldebug_loc0 # DW_AT_location
173 .uleb128 0x7 # (DIE (0xb6) DW_TAG_formal_parameter)
174 .ascii "argv\0" # DW_AT_name
175 .byte 0x1 # DW_AT_decl_file (fission-loclists.c)
176 .byte 0x6 # DW_AT_decl_line
177 .4byte .Lchar_ptr_ptr_type - .Ldebug_info0 # DW_AT_type
178 .4byte .LLST1-.Ldebug_loc0 # DW_AT_location
179 .uleb128 0x8 # (DIE (0xc6) DW_TAG_GNU_call_site)
180 .uleb128 0x2 # DW_AT_low_pc
181 .4byte .Lfoo_func - .Ldebug_info0 # DW_AT_abstract_origin
182 .uleb128 0x9 # (DIE (0xcc) DW_TAG_GNU_call_site_parameter)
183 .uleb128 0x1 # DW_AT_location
184 .byte 0x55 # DW_OP_reg5
185 .uleb128 0x2 # DW_AT_GNU_call_site_value
186 .byte 0x91 # DW_OP_fbreg
188 .byte 0 # end of children of DIE 0xc6
189 .byte 0 # end of children of DIE 0x8b
191 .uleb128 0x4 # (DIE (0xd4) DW_TAG_pointer_type)
192 .byte 0x8 # DW_AT_byte_size
193 .4byte .Lchar_ptr_type - .Ldebug_info0 # DW_AT_type
195 .uleb128 0x4 # (DIE (0xda) DW_TAG_pointer_type)
196 .byte 0x8 # DW_AT_byte_size
197 .4byte .Lchar_type - .Ldebug_info0 # DW_AT_type
199 .uleb128 0x5 # (DIE (0xe0) DW_TAG_base_type)
200 .byte 0x1 # DW_AT_byte_size
201 .byte 0x6 # DW_AT_encoding
202 .ascii "char\0" # DW_AT_name
203 .uleb128 0xa # (DIE (0xe8) DW_TAG_variable)
204 .ascii "v\0" # DW_AT_name
205 .byte 0x1 # DW_AT_decl_file (fission-loclists.c)
206 .byte 0x1 # DW_AT_decl_line
207 .4byte .Lvolatile_int_type - .Ldebug_info0 # DW_AT_type
209 .uleb128 0x2 # DW_AT_location
210 .byte 0xfb # DW_OP_GNU_addr_index
211 .uleb128 0x1 # (index into .debug_addr)
213 .uleb128 0xb # (DIE (0xf4) DW_TAG_volatile_type)
214 .4byte .Lint_type - .Ldebug_info0 # DW_AT_type
215 .byte 0 # end of children of DIE 0xb
217 .section .debug_info,"",@progbits
218 .Lskeleton_debug_info0:
219 .4byte .Lskeleton_debug_info0_end - .Lskeleton_debug_info0 - 4 # Length of Compilation Unit Info
220 .value 0x4 # DWARF version number
221 .4byte .Lskeleton_debug_abbrev0 # Offset Into Abbrev. Section
222 .byte 0x8 # Pointer Size (in bytes)
223 .uleb128 0x1 # (DIE (0) DW_TAG_compile_unit)
224 .4byte .Ldebug_ranges0+0 # DW_AT_ranges
225 # This next line is the core of the test.
226 # We want a non-zero value for low_pc to verify gdb is *not* using it
227 # (the initial base address) when evaluating location list addresses in
229 # Note: Setting a non-zero value here means we had to adjust the
230 # values in .debug_ranges.
231 .8byte .Ltext0 # DW_AT_low_pc
232 .4byte .Ldebug_line0 # DW_AT_stmt_list
233 .byte 0xcb # DW_AT_GNU_dwo_id
241 .4byte .Ldebug_ranges0 # DW_AT_GNU_ranges_base
242 .ascii "/tmp\0" # DW_AT_comp_dir
243 # Normally dwo_name would be "fission-loclists.dwo".
244 # Simplification: Leave the DWO contents in the executable.
245 # "gdb.dwarf2/" is included so that gdb can load the file without
246 # having to set "debug-file-directory". This is useful when
247 # testing with cc-with-tweaks.sh -i.
248 .ascii "gdb.dwarf2/fission-loclists\0" # DW_AT_GNU_dwo_name
249 .4byte .Ldebug_pubnames0 # DW_AT_GNU_pubnames
250 .4byte .Ldebug_pubtypes0 # DW_AT_GNU_pubtypes
251 .4byte .Ldebug_addr0 # DW_AT_GNU_addr_base
252 .Lskeleton_debug_info0_end:
253 .section .debug_abbrev,"",@progbits
254 .Lskeleton_debug_abbrev0:
255 .uleb128 0x1 # (abbrev code)
256 .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
257 .byte 0 # DW_children_no
258 .uleb128 0x55 # (DW_AT_ranges)
259 .uleb128 0x17 # (DW_FORM_sec_offset)
260 .uleb128 0x11 # (DW_AT_low_pc)
261 .uleb128 0x1 # (DW_FORM_addr)
262 .uleb128 0x10 # (DW_AT_stmt_list)
263 .uleb128 0x17 # (DW_FORM_sec_offset)
264 .uleb128 0x2131 # (DW_AT_GNU_dwo_id)
265 .uleb128 0x7 # (DW_FORM_data8)
266 .uleb128 0x2132 # (DW_AT_GNU_ranges_base)
267 .uleb128 0x17 # (DW_FORM_sec_offset)
268 .uleb128 0x1b # (DW_AT_comp_dir)
269 .uleb128 0x8 # (DW_FORM_string)
270 .uleb128 0x2130 # (DW_AT_GNU_dwo_name)
271 .uleb128 0x8 # (DW_FORM_string)
272 .uleb128 0x2134 # (DW_AT_GNU_pubnames)
273 .uleb128 0x17 # (DW_FORM_sec_offset)
274 .uleb128 0x2135 # (DW_AT_GNU_pubtypes)
275 .uleb128 0x17 # (DW_FORM_sec_offset)
276 .uleb128 0x2133 # (DW_AT_GNU_addr_base)
277 .uleb128 0x17 # (DW_FORM_sec_offset)
280 .uleb128 0x2 # (abbrev code)
281 .uleb128 0x41 # (TAG: DW_TAG_type_unit)
282 .byte 0 # DW_children_no
283 .uleb128 0x1b # (DW_AT_comp_dir)
284 .uleb128 0x8 # (DW_FORM_string)
285 .uleb128 0x2130 # (DW_AT_GNU_dwo_name)
286 .uleb128 0x8 # (DW_FORM_string)
287 .uleb128 0x2134 # (DW_AT_GNU_pubnames)
288 .uleb128 0x17 # (DW_FORM_sec_offset)
289 .uleb128 0x2135 # (DW_AT_GNU_pubtypes)
290 .uleb128 0x17 # (DW_FORM_sec_offset)
291 .uleb128 0x2133 # (DW_AT_GNU_addr_base)
292 .uleb128 0x17 # (DW_FORM_sec_offset)
295 .byte 0 # end of skeleton .debug_abbrev
296 .section .debug_abbrev.dwo,"",@progbits
298 .uleb128 0x1 # (abbrev code)
299 .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
300 .byte 0x1 # DW_children_yes
301 .uleb128 0x25 # (DW_AT_producer)
302 .uleb128 0x8 # (DW_FORM_string)
303 .uleb128 0x13 # (DW_AT_language)
304 .uleb128 0xb # (DW_FORM_data1)
305 .uleb128 0x3 # (DW_AT_name)
306 .uleb128 0x8 # (DW_FORM_string)
307 .uleb128 0x1b # (DW_AT_comp_dir)
308 .uleb128 0x8 # (DW_FORM_string)
309 .uleb128 0x2131 # (DW_AT_GNU_dwo_id)
310 .uleb128 0x7 # (DW_FORM_data8)
313 .uleb128 0x2 # (abbrev code)
314 .uleb128 0x2e # (TAG: DW_TAG_subprogram)
315 .byte 0x1 # DW_children_yes
316 .uleb128 0x3f # (DW_AT_external)
317 .uleb128 0x19 # (DW_FORM_flag_present)
318 .uleb128 0x3 # (DW_AT_name)
319 .uleb128 0x8 # (DW_FORM_string)
320 .uleb128 0x3a # (DW_AT_decl_file)
321 .uleb128 0xb # (DW_FORM_data1)
322 .uleb128 0x3b # (DW_AT_decl_line)
323 .uleb128 0xb # (DW_FORM_data1)
324 .uleb128 0x27 # (DW_AT_prototyped)
325 .uleb128 0x19 # (DW_FORM_flag_present)
326 .uleb128 0x11 # (DW_AT_low_pc)
327 .uleb128 0x1f01 # (DW_FORM_GNU_addr_index)
328 .uleb128 0x12 # (DW_AT_high_pc)
329 .uleb128 0x7 # (DW_FORM_data8)
330 .uleb128 0x40 # (DW_AT_frame_base)
331 .uleb128 0x18 # (DW_FORM_exprloc)
332 .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
333 .uleb128 0x19 # (DW_FORM_flag_present)
334 .uleb128 0x1 # (DW_AT_sibling)
335 .uleb128 0x13 # (DW_FORM_ref4)
338 .uleb128 0x3 # (abbrev code)
339 .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
340 .byte 0 # DW_children_no
341 .uleb128 0x3 # (DW_AT_name)
342 .uleb128 0x8 # (DW_FORM_string)
343 .uleb128 0x3a # (DW_AT_decl_file)
344 .uleb128 0xb # (DW_FORM_data1)
345 .uleb128 0x3b # (DW_AT_decl_line)
346 .uleb128 0xb # (DW_FORM_data1)
347 .uleb128 0x49 # (DW_AT_type)
348 .uleb128 0x13 # (DW_FORM_ref4)
349 .uleb128 0x2 # (DW_AT_location)
350 .uleb128 0x18 # (DW_FORM_exprloc)
353 .uleb128 0x4 # (abbrev code)
354 .uleb128 0xf # (TAG: DW_TAG_pointer_type)
355 .byte 0 # DW_children_no
356 .uleb128 0xb # (DW_AT_byte_size)
357 .uleb128 0xb # (DW_FORM_data1)
358 .uleb128 0x49 # (DW_AT_type)
359 .uleb128 0x13 # (DW_FORM_ref4)
362 .uleb128 0x5 # (abbrev code)
363 .uleb128 0x24 # (TAG: DW_TAG_base_type)
364 .byte 0 # DW_children_no
365 .uleb128 0xb # (DW_AT_byte_size)
366 .uleb128 0xb # (DW_FORM_data1)
367 .uleb128 0x3e # (DW_AT_encoding)
368 .uleb128 0xb # (DW_FORM_data1)
369 .uleb128 0x3 # (DW_AT_name)
370 .uleb128 0x8 # (DW_FORM_string)
373 .uleb128 0x6 # (abbrev code)
374 .uleb128 0x2e # (TAG: DW_TAG_subprogram)
375 .byte 0x1 # DW_children_yes
376 .uleb128 0x3f # (DW_AT_external)
377 .uleb128 0x19 # (DW_FORM_flag_present)
378 .uleb128 0x3 # (DW_AT_name)
379 .uleb128 0x8 # (DW_FORM_string)
380 .uleb128 0x3a # (DW_AT_decl_file)
381 .uleb128 0xb # (DW_FORM_data1)
382 .uleb128 0x3b # (DW_AT_decl_line)
383 .uleb128 0xb # (DW_FORM_data1)
384 .uleb128 0x27 # (DW_AT_prototyped)
385 .uleb128 0x19 # (DW_FORM_flag_present)
386 .uleb128 0x49 # (DW_AT_type)
387 .uleb128 0x13 # (DW_FORM_ref4)
388 .uleb128 0x11 # (DW_AT_low_pc)
389 .uleb128 0x1f01 # (DW_FORM_GNU_addr_index)
390 .uleb128 0x12 # (DW_AT_high_pc)
391 .uleb128 0x7 # (DW_FORM_data8)
392 .uleb128 0x40 # (DW_AT_frame_base)
393 .uleb128 0x18 # (DW_FORM_exprloc)
394 .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
395 .uleb128 0x19 # (DW_FORM_flag_present)
396 .uleb128 0x1 # (DW_AT_sibling)
397 .uleb128 0x13 # (DW_FORM_ref4)
400 .uleb128 0x7 # (abbrev code)
401 .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
402 .byte 0 # DW_children_no
403 .uleb128 0x3 # (DW_AT_name)
404 .uleb128 0x8 # (DW_FORM_string)
405 .uleb128 0x3a # (DW_AT_decl_file)
406 .uleb128 0xb # (DW_FORM_data1)
407 .uleb128 0x3b # (DW_AT_decl_line)
408 .uleb128 0xb # (DW_FORM_data1)
409 .uleb128 0x49 # (DW_AT_type)
410 .uleb128 0x13 # (DW_FORM_ref4)
411 .uleb128 0x2 # (DW_AT_location)
412 .uleb128 0x17 # (DW_FORM_sec_offset)
415 .uleb128 0x8 # (abbrev code)
416 .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site)
417 .byte 0x1 # DW_children_yes
418 .uleb128 0x11 # (DW_AT_low_pc)
419 .uleb128 0x1f01 # (DW_FORM_GNU_addr_index)
420 .uleb128 0x31 # (DW_AT_abstract_origin)
421 .uleb128 0x13 # (DW_FORM_ref4)
424 .uleb128 0x9 # (abbrev code)
425 .uleb128 0x410a # (TAG: DW_TAG_GNU_call_site_parameter)
426 .byte 0 # DW_children_no
427 .uleb128 0x2 # (DW_AT_location)
428 .uleb128 0x18 # (DW_FORM_exprloc)
429 .uleb128 0x2111 # (DW_AT_GNU_call_site_value)
430 .uleb128 0x18 # (DW_FORM_exprloc)
433 .uleb128 0xa # (abbrev code)
434 .uleb128 0x34 # (TAG: DW_TAG_variable)
435 .byte 0 # DW_children_no
436 .uleb128 0x3 # (DW_AT_name)
437 .uleb128 0x8 # (DW_FORM_string)
438 .uleb128 0x3a # (DW_AT_decl_file)
439 .uleb128 0xb # (DW_FORM_data1)
440 .uleb128 0x3b # (DW_AT_decl_line)
441 .uleb128 0xb # (DW_FORM_data1)
442 .uleb128 0x49 # (DW_AT_type)
443 .uleb128 0x13 # (DW_FORM_ref4)
444 .uleb128 0x3f # (DW_AT_external)
445 .uleb128 0x19 # (DW_FORM_flag_present)
446 .uleb128 0x2 # (DW_AT_location)
447 .uleb128 0x18 # (DW_FORM_exprloc)
450 .uleb128 0xb # (abbrev code)
451 .uleb128 0x35 # (TAG: DW_TAG_volatile_type)
452 .byte 0 # DW_children_no
453 .uleb128 0x49 # (DW_AT_type)
454 .uleb128 0x13 # (DW_FORM_ref4)
458 .section .debug_loc.dwo,"",@progbits
461 .byte 0x3 # Location list start/length entry (*.LLST0)
462 .uleb128 0 # Location list range start index (*.LVL1)
463 .4byte .LVL2-.LVL1 # Location list range length (*.LLST0)
464 .value 0x1 # Location expression size
465 .byte 0x55 # DW_OP_reg5
466 .byte 0x3 # Location list start/length entry (*.LLST0)
467 .uleb128 0x6 # Location list range start index (*.LVL2)
468 .4byte .LFE1-.LVL2 # Location list range length (*.LLST0)
469 .value 0x2 # Location expression size
470 .byte 0x91 # DW_OP_fbreg
472 .byte 0 # Location list terminator (*.LLST0)
474 .byte 0x3 # Location list start/length entry (*.LLST1)
475 .uleb128 0 # Location list range start index (*.LVL1)
476 .4byte .LVL3-1-.LVL1 # Location list range length (*.LLST1)
477 .value 0x1 # Location expression size
478 .byte 0x54 # DW_OP_reg4
479 .byte 0x3 # Location list start/length entry (*.LLST1)
480 .uleb128 0x5 # Location list range start index (*.LVL3-1)
481 .4byte .LFE1-.LVL3-1 # Location list range length (*.LLST1)
482 .value 0x4 # Location expression size
483 .byte 0xf3 # DW_OP_GNU_entry_value
485 .byte 0x54 # DW_OP_reg4
486 .byte 0x9f # DW_OP_stack_value
487 .byte 0 # Location list terminator (*.LLST1)
488 .section .debug_gnu_pubnames,"",@progbits
491 .section .debug_gnu_pubtypes,"",@progbits
494 .section .debug_aranges,"",@progbits
495 .4byte 0x3c # Length of Address Ranges Info
496 .value 0x2 # DWARF Version
497 .4byte .Lskeleton_debug_info0 # Offset of Compilation Unit Info
498 .byte 0x8 # Size of Address
499 .byte 0 # Size of Segment Descriptor
500 .value 0 # Pad to 16 byte boundary
502 .8byte .Ltext0 # Address
503 .8byte .Letext0-.Ltext0 # Length
504 .8byte .LFB1 # Address
505 .8byte .LFE1-.LFB1 # Length
508 .section .debug_ranges,"",@progbits
510 .8byte .Ltext0 - .Ltext0 # Offset 0
511 .8byte .Letext0 - .Ltext0
512 .8byte .LFB1 - .Ltext0 # Offset 0x10
513 .8byte .LFE1 - .Ltext0
516 .section .debug_line,"",@progbits
518 .section .debug_line.dwo,"",@progbits
519 .Lskeleton_debug_line0:
520 .4byte .LELT0-.LSLT0 # Length of Source Line Info
522 .value 0x4 # DWARF Version
523 .4byte .LELTP0-.LASLTP0 # Prolog Length
525 .byte 0x1 # Minimum Instruction Length
526 .byte 0x1 # Maximum Operations Per Instruction
527 .byte 0x1 # Default is_stmt_start flag
528 .byte 0xf6 # Line Base Value (Special Opcodes)
529 .byte 0xf2 # Line Range Value (Special Opcodes)
530 .byte 0xd # Special Opcode Base
531 .byte 0 # opcode: 0x1 has 0 args
532 .byte 0x1 # opcode: 0x2 has 1 args
533 .byte 0x1 # opcode: 0x3 has 1 args
534 .byte 0x1 # opcode: 0x4 has 1 args
535 .byte 0x1 # opcode: 0x5 has 1 args
536 .byte 0 # opcode: 0x6 has 0 args
537 .byte 0 # opcode: 0x7 has 0 args
538 .byte 0 # opcode: 0x8 has 0 args
539 .byte 0x1 # opcode: 0x9 has 1 args
540 .byte 0 # opcode: 0xa has 0 args
541 .byte 0 # opcode: 0xb has 0 args
542 .byte 0x1 # opcode: 0xc has 1 args
543 .byte 0 # End directory table
544 .ascii "fission-loclists.c\0" # File Entry: 0x1
548 .byte 0 # End file name table
551 .section .debug_str_offsets.dwo,"",@progbits
552 .section .debug_str.dwo,"",@progbits
553 .ident "GCC: 4.7.x-fission"
554 .section .note.GNU-stack,"",@progbits