177 lines · plain
1# Test object to verify dwarfdump handles a DWARF-64 v5 line header.2# FIXME: Make the other headers DWARF-64 also.3# FIXME: Add variants for earlier DWARF versions.4 5# RUN: llvm-mc -triple x86_64-unknown-linux --defsym ELF=0 \6# RUN: -filetype=obj -o - %s | llvm-dwarfdump -v - | FileCheck %s7 8# RUN: llvm-mc -triple x86_64-apple-darwin --defsym MACHO=0 \9# RUN: -filetype=obj -o - %s | llvm-dwarfdump -v - | FileCheck %s10 11.ifdef ELF12 .section .debug_str,"MS",@progbits,113.endif14.ifdef MACHO15 .section __DWARF,__debug_str,regular,debug16.endif17str_producer:18 .asciz "Handmade DWARF producer"19str_CU_5:20 .asciz "V5_compile_unit"21str_LT_5a:22 .asciz "Directory5a"23str_LT_5b:24 .asciz "Directory5b"25 26.ifdef ELF27 .section .debug_abbrev,"",@progbits28.endif29.ifdef MACHO30 .section __DWARF,__debug_abbrev,regular,debug31.endif32abbrev:33 .byte 0x01 # Abbrev code34 .byte 0x11 # DW_TAG_compile_unit35 .byte 0x00 # DW_CHILDREN_no36 .byte 0x25 # DW_AT_producer37 .byte 0x0e # DW_FORM_strp38 .byte 0x03 # DW_AT_name39 .byte 0x0e # DW_FORM_strp40 .byte 0x10 # DW_AT_stmt_list41 .byte 0x17 # DW_FORM_sec_offset42 .byte 0x00 # EOM(1)43 .byte 0x00 # EOM(2)44 .byte 0x00 # EOM(3)45 46.ifdef ELF47 .section .debug_info,"",@progbits48.endif49.ifdef MACHO50 .section __DWARF,__debug_info,regular,debug51.endif52 53# DWARF-32 v5 normal CU header.54Lset0 = CU_5_end-CU_5_version # Length of Unit55 .long Lset056CU_5_version:57 .short 5 # DWARF version number58 .byte 1 # DWARF Unit Type59 .byte 8 # Address Size (in bytes)60.ifdef ELF61 .long abbrev # Offset Into Abbrev. Section62.endif63.ifdef MACHO64 .long 065.endif66# The compile-unit DIE, with DW_AT_producer, DW_AT_name, DW_AT_stmt_list.67 .byte 168 .long str_producer69 .long str_CU_570.ifdef ELF71 .long LH_5_start72.endif73.ifdef MACHO74 .long 075.endif76 .byte 0 # NULL77CU_5_end:78 79# CHECK-LABEL: .debug_info contents:80# CHECK: 0x00000000: Compile Unit: length = 0x00000016, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x0000001a)81# CHECK: 0x0000000c: DW_TAG_compile_unit82# CHECK-NEXT: DW_AT_producer {{.*}} "Handmade DWARF producer"83# CHECK-NEXT: DW_AT_name {{.*}} "V5_compile_unit"84# CHECK-NEXT: DW_AT_stmt_list {{.*}} (0x00000000)85 86.ifdef ELF87 .section .debug_line,"",@progbits88.endif89.ifdef MACHO90 .section __DWARF,__debug_line,regular,debug91.endif92 93# DWARF-64 v5 line-table header.94LH_5_start:95 .long -196Lset1 = LH_5_end-LH_5_version # Length of Unit97 .quad Lset198LH_5_version:99 .short 5 # DWARF version number100 .byte 8 # Address Size101 .byte 0 # Segment Selector Size102Lset2 = LH_5_header_end-LH_5_params # Length of Prologue103 .quad Lset2104LH_5_params:105 .byte 1 # Minimum Instruction Length106 .byte 1 # Maximum Operations per Instruction107 .byte 1 # Default is_stmt108 .byte -5 # Line Base109 .byte 14 # Line Range110 .byte 13 # Opcode Base111 .byte 0 # Standard Opcode Lengths112 .byte 1113 .byte 1114 .byte 1115 .byte 1116 .byte 0117 .byte 0118 .byte 0119 .byte 1120 .byte 0121 .byte 0122 .byte 1123 # Directory table format124 .byte 1 # One element per directory entry125 .byte 1 # DW_LNCT_path126 .byte 0x0e # DW_FORM_strp (-> .debug_str)127 # Directory table entries128 .byte 2 # Two directories129 .quad str_LT_5a130 .quad str_LT_5b131 # File table format132 .byte 4 # Four elements per file entry133 .byte 1 # DW_LNCT_path134 .byte 0x08 # DW_FORM_string135 .byte 2 # DW_LNCT_directory_index136 .byte 0x0b # DW_FORM_data1137 .byte 3 # DW_LNCT_timestamp138 .byte 0x0f # DW_FORM_udata139 .byte 4 # DW_LNCT_size140 .byte 0x0f # DW_FORM_udata141 # File table entries142 .byte 2 # Two files143 .asciz "File5a"144 .byte 0145 .byte 0x51146 .byte 0x52147 .asciz "File5b"148 .byte 1149 .byte 0x53150 .byte 0x54151LH_5_header_end:152 # Line number program, which is empty.153LH_5_end:154 155# CHECK-LABEL: .debug_line contents:156# CHECK: Line table prologue:157# CHECK: total_length: 0x0000000000000050158# CHECK: version: 5159# CHECK: address_size: 8160# CHECK: seg_select_size: 0161# CHECK: prologue_length: 0x0000000000000044162# CHECK: max_ops_per_inst: 1163# CHECK: include_directories[ 0] = .debug_str[0x0000000000000028] = "Directory5a"164# CHECK: include_directories[ 1] = .debug_str[0x0000000000000034] = "Directory5b"165# CHECK-NOT: include_directories166# CHECK: file_names[ 0]:167# CHECK-NEXT: name: "File5a"168# CHECK-NEXT: dir_index: 0169# CHECK-NEXT: mod_time: 0x00000051170# CHECK-NEXT: length: 0x00000052171# CHECK: file_names[ 1]:172# CHECK-NEXT: name: "File5b"173# CHECK-NEXT: dir_index: 1174# CHECK-NEXT: mod_time: 0x00000053175# CHECK-NEXT: length: 0x00000054176# CHECK-NOT: file_names177