1 # RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o
2 # RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s
3 # RUN: llvm-dwarfdump -debug-info %t.o -v | FileCheck --check-prefix=VERBOSE %s
5 # CHECK: DW_TAG_compile_unit
6 # CHECK: DW_AT_low_pc (0x0000000000000000)
7 # VERBOSE: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x0000000000000000 ".text")
8 # FIXME: There is a debug_addr section, it's just that the index is outside its
9 # bounds (both of the section, and the range defined by the header for the
10 # debug_addr contribution for this CU)
11 # CHECK: DW_AT_low_pc (indexed (00000001) address = <no .debug_addr section>)
12 # VERBOSE: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000001) address = <no .debug_addr section>)
14 # CHECK: DW_TAG_compile_unit
15 # FIXME: Should error "no debug_addr contribution" - rather than parsing debug_addr
16 # from the start, incorrectly interpreting the header bytes as an address.
17 # CHECK: DW_AT_low_pc (0x000800050000000c)
18 # VERBOSE: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x000800050000000c)
20 .globl foo # -- Begin function foo
25 .section .debug_abbrev,"",@progbits
26 .byte 1 # Abbreviation Code
27 .byte 17 # DW_TAG_compile_unit
28 .byte 0 # DW_CHILDREN_no
29 .byte 115 # DW_AT_addr_base
30 .byte 23 # DW_FORM_sec_offset
31 .byte 17 # DW_AT_low_pc
32 .byte 27 # DW_FORM_addrx
33 .byte 17 # DW_AT_low_pc
34 .byte 27 # DW_FORM_addrx
37 .byte 2 # Abbreviation Code
38 .byte 17 # DW_TAG_compile_unit
39 .byte 0 # DW_CHILDREN_no
40 .byte 17 # DW_AT_low_pc
41 .byte 27 # DW_FORM_addrx
45 .section .debug_info,"",@progbits
47 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
49 .short 5 # DWARF version number
50 .byte 1 # DWARF Unit Type
51 .byte 8 # Address Size (in bytes)
52 .long .debug_abbrev # Offset Into Abbrev. Section
53 .byte 1 # Abbrev [1] 0xc:0x23 DW_TAG_compile_unit
54 .long .Laddr_table_base0 # DW_AT_addr_base
55 .byte 0 # DW_AT_low_pc
56 .byte 1 # DW_AT_low_pc
59 .long .Ldebug_info_end1-.Ldebug_info_start1 # Length of Unit
61 .short 5 # DWARF version number
62 .byte 1 # DWARF Unit Type
63 .byte 8 # Address Size (in bytes)
64 .long .debug_abbrev # Offset Into Abbrev. Section
65 .byte 2 # Abbrev [2] 0xc:0x23 DW_TAG_compile_unit
66 .long .Laddr_table_base0 # DW_AT_addr_base
67 .byte 0 # DW_AT_low_pc
69 .section .debug_macinfo,"",@progbits
70 .byte 0 # End Of Macro List Mark
71 .section .debug_addr,"",@progbits
72 .long 12 # Length of Pool
73 .short 5 # DWARF version number
74 .byte 8 # Address Size (in bytes)
75 .byte 0 # Segment selector size