80 lines · plain
1# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o2# RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s3# RUN: llvm-dwarfdump -debug-info %t.o -v | FileCheck --check-prefix=VERBOSE %s4# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o -crel5# RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s6 7# CHECK: DW_TAG_compile_unit8# CHECK: DW_AT_low_pc (0x0000000000000000)9# VERBOSE: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x0000000000000000 ".text")10# FIXME: Improve the error message from "unresolved" to describe the specific11# issue (in this case, the index is outside the bounds of the debug_addr12# contribution/debug_addr section)13# CHECK: DW_AT_low_pc (indexed (00000001) address = <unresolved>)14# VERBOSE: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000001) address = <unresolved>)15 16# CHECK: DW_TAG_compile_unit17# FIXME: Should error "no debug_addr contribution" - rather than parsing debug_addr18# from the start, incorrectly interpreting the header bytes as an address.19# CHECK: DW_AT_low_pc (indexed (00000000) address = <unresolved>)20# VERBOSE: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = <unresolved>)21 22 .globl foo # -- Begin function foo23foo: # @foo24.Lfunc_begin0:25 retq26.Lfunc_end0:27 .section .debug_abbrev,"",@progbits28 .byte 1 # Abbreviation Code29 .byte 17 # DW_TAG_compile_unit30 .byte 0 # DW_CHILDREN_no31 .byte 115 # DW_AT_addr_base32 .byte 23 # DW_FORM_sec_offset33 .byte 17 # DW_AT_low_pc34 .byte 27 # DW_FORM_addrx35 .byte 17 # DW_AT_low_pc36 .byte 27 # DW_FORM_addrx37 .byte 0 # EOM(1)38 .byte 0 # EOM(2)39 .byte 2 # Abbreviation Code40 .byte 17 # DW_TAG_compile_unit41 .byte 0 # DW_CHILDREN_no42 .byte 17 # DW_AT_low_pc43 .byte 27 # DW_FORM_addrx44 .byte 0 # EOM(1)45 .byte 0 # EOM(2)46 .byte 0 # EOM(3)47 .section .debug_info,"",@progbits48.Lcu_begin0:49 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit50.Ldebug_info_start0:51 .short 5 # DWARF version number52 .byte 1 # DWARF Unit Type53 .byte 8 # Address Size (in bytes)54 .long .debug_abbrev # Offset Into Abbrev. Section55 .byte 1 # Abbrev [1] 0xc:0x23 DW_TAG_compile_unit56 .long .Laddr_table_base0 # DW_AT_addr_base57 .byte 0 # DW_AT_low_pc58 .byte 1 # DW_AT_low_pc59.Ldebug_info_end0:60.Lcu_begin1:61 .long .Ldebug_info_end1-.Ldebug_info_start1 # Length of Unit62.Ldebug_info_start1:63 .short 5 # DWARF version number64 .byte 1 # DWARF Unit Type65 .byte 8 # Address Size (in bytes)66 .long .debug_abbrev # Offset Into Abbrev. Section67 .byte 2 # Abbrev [2] 0xc:0x23 DW_TAG_compile_unit68 .long .Laddr_table_base0 # DW_AT_addr_base69 .byte 0 # DW_AT_low_pc70.Ldebug_info_end1:71 .section .debug_macinfo,"",@progbits72 .byte 0 # End Of Macro List Mark73 .section .debug_addr,"",@progbits74 .long 12 # Length of Pool75 .short 5 # DWARF version number76 .byte 8 # Address Size (in bytes)77 .byte 0 # Segment selector size78.Laddr_table_base0:79 .quad .Lfunc_begin080