| 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 |
| 4 |
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o -crel |
| 5 |
# RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s |
| 6 |
|
| 7 |
# CHECK: DW_TAG_compile_unit |
| 8 |
# 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 specific |
| 11 |
# issue (in this case, the index is outside the bounds of the debug_addr |
| 12 |
# 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_unit |
| 17 |
# FIXME: Should error "no debug_addr contribution" - rather than parsing debug_addr |
| 18 |
# 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 foo |
| 23 |
foo: # @foo |
| 24 |
.Lfunc_begin0: |
| 25 |
retq |
| 26 |
.Lfunc_end0: |
| 27 |
.section .debug_abbrev,"",@progbits |
| 28 |
.byte 1 # Abbreviation Code |
| 29 |
.byte 17 # DW_TAG_compile_unit |
| 30 |
.byte 0 # DW_CHILDREN_no |
| 31 |
.byte 115 # DW_AT_addr_base |
| 32 |
.byte 23 # DW_FORM_sec_offset |
| 33 |
.byte 17 # DW_AT_low_pc |
| 34 |
.byte 27 # DW_FORM_addrx |
| 35 |
.byte 17 # DW_AT_low_pc |
| 36 |
.byte 27 # DW_FORM_addrx |
| 37 |
.byte 0 # EOM(1) |
| 38 |
.byte 0 # EOM(2) |
| 39 |
.byte 2 # Abbreviation Code |
| 40 |
.byte 17 # DW_TAG_compile_unit |
| 41 |
.byte 0 # DW_CHILDREN_no |
| 42 |
.byte 17 # DW_AT_low_pc |
| 43 |
.byte 27 # DW_FORM_addrx |
| 44 |
.byte 0 # EOM(1) |
| 45 |
.byte 0 # EOM(2) |
| 46 |
.byte 0 # EOM(3) |
| 47 |
.section .debug_info,"",@progbits |
| 48 |
.Lcu_begin0: |
| 49 |
.long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit |
| 50 |
.Ldebug_info_start0: |
| 51 |
.short 5 # DWARF version number |
| 52 |
.byte 1 # DWARF Unit Type |
| 53 |
.byte 8 # Address Size (in bytes) |
| 54 |
.long .debug_abbrev # Offset Into Abbrev. Section |
| 55 |
.byte 1 # Abbrev [1] 0xc:0x23 DW_TAG_compile_unit |
| 56 |
.long .Laddr_table_base0 # DW_AT_addr_base |
| 57 |
.byte 0 # DW_AT_low_pc |
| 58 |
.byte 1 # DW_AT_low_pc |
| 59 |
.Ldebug_info_end0: |
| 60 |
.Lcu_begin1: |
| 61 |
.long .Ldebug_info_end1-.Ldebug_info_start1 # Length of Unit |
| 62 |
.Ldebug_info_start1: |
| 63 |
.short 5 # DWARF version number |
| 64 |
.byte 1 # DWARF Unit Type |
| 65 |
.byte 8 # Address Size (in bytes) |
| 66 |
.long .debug_abbrev # Offset Into Abbrev. Section |
| 67 |
.byte 2 # Abbrev [2] 0xc:0x23 DW_TAG_compile_unit |
| 68 |
.long .Laddr_table_base0 # DW_AT_addr_base |
| 69 |
.byte 0 # DW_AT_low_pc |
| 70 |
.Ldebug_info_end1: |
| 71 |
.section .debug_macinfo,"",@progbits |
| 72 |
.byte 0 # End Of Macro List Mark |
| 73 |
.section .debug_addr,"",@progbits |
| 74 |
.long 12 # Length of Pool |
| 75 |
.short 5 # DWARF version number |
| 76 |
.byte 8 # Address Size (in bytes) |
| 77 |
.byte 0 # Segment selector size |
| 78 |
.Laddr_table_base0: |
| 79 |
.quad .Lfunc_begin0 |