125 lines · plain
1; This test checks to that DWARF v5 debug info can be correctly linked2; into a dSYM bundle by dsymutil, with the correct section names and DWARF v53; headers for the different sections.4 5; 1.o was produced with the source file:6 7; a.cpp8; __attribute__((section("1,__text_foo"))) void foo() {}9;10; int foo2(int a) {11; return a+5;12; }13; int main () {14; return 1;15; }16 17; clang -g -c -O1 a.cpp -Xclang -gdwarf-5 -o 1.o18 19 20RUN: rm -rf %t.dir && mkdir -p %t.dir21RUN: dsymutil -y %p/dummy-debug-map-arm64.map -oso-prepend-path=%p/../Inputs/DWARF5 -o %t.dir/dwarf5-macho.dSYM22RUN: llvm-dwarfdump %t.dir/dwarf5-macho.dSYM -a --verbose | FileCheck %s23 24RUN: rm -rf %t.dir && mkdir -p %t.dir25RUN: dsymutil --linker parallel --no-odr -y %p/dummy-debug-map-arm64.map \26RUN: -oso-prepend-path=%p/../Inputs/DWARF5 -o %t.dir/dwarf5-macho.dSYM27RUN: llvm-dwarfdump %t.dir/dwarf5-macho.dSYM -a --verbose | FileCheck %s28 29### Uncomment following when llvm-dwarfdump will print resolved address ranges30### for the case mutiplue compile units.31COM: rm -rf %t.dir && mkdir -p %t.dir32COM: dsymutil --linker parallel -y %p/dummy-debug-map-arm64.map \33COM: -oso-prepend-path=%p/../Inputs/DWARF5 -o %t.dir/dwarf5-macho.dSYM34COM: llvm-dwarfdump %t.dir/dwarf5-macho.dSYM -a --verbose | FileCheck %s \35COM: --check-prefixes=CHECK,CHECK-LLVM36 37 38CHECK:.debug_abbrev contents:39CHECK-NEXT: Abbrev table for offset: 0x0000000040 41CHECK: .debug_info contents:42CHECK-LLVM: Compile Unit: length = 0x0000001f, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = {{.*}}, addr_size = 0x0843CHECK-LLVM: DW_TAG_compile_unit44CHECK-LLVM: DW_TAG_base_type45CHECK: Compile Unit: length = 0x0000004a, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = {{.*}}, addr_size = 0x0846CHECK: DW_AT_ranges [DW_FORM_sec_offset] (0x[[RANGELIST_OFFSET:[0-9a-f]+]]47CHECK-NEXT: [0x[[RANGELIST_OFFSET_START:[0-9a-f]+]], 0x[[RANGELIST_OFFSET_END:[0-9a-f]+]]))48CHECK-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)49CHECK: DW_TAG_subprogram50CHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x[[#%.16x,LOCLIST_LOWPC:]])51CHECK: DW_TAG_formal_parameter52CHECK-NEXT: DW_AT_location [DW_FORM_sec_offset] (0x[[LOC_OFFSET:[0-9a-f]+]]:53CHECK-NEXT: [0x[[#%.16x,LOCLIST_PAIR_START:]], 0x[[#%.16x,LOCLIST_PAIR_END:]]): [[LOCLIST_EXPR:.*]]54CHECK-NEXT: [0x[[#%.16x,LOCLIST_PAIR_START2:]], 0x[[#%.16x,LOCLIST_PAIR_END2:]]): [[LOCLIST_EXPR2:.*]])55 56CHECK: .debug_loclists contents:57CHECK-NEXT: 0x00000000: locations list header: length = 0x00000018, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x0000000058CHECK-NEXT: 0x[[LOC_OFFSET]]:59CHECK-NEXT: DW_LLE_base_addressx (0x0000000000000000)60CHECK-NEXT: DW_LLE_offset_pair (0x[[#sub(LOCLIST_PAIR_START,LOCLIST_LOWPC)]], 0x[[#sub(LOCLIST_PAIR_END,LOCLIST_LOWPC)]])61CHECK-NEXT: DW_LLE_offset_pair (0x[[#sub(LOCLIST_PAIR_START2,LOCLIST_LOWPC)]], 0x[[#sub(LOCLIST_PAIR_END2,LOCLIST_LOWPC)]])62CHECK-NEXT: DW_LLE_end_of_list ()63 64CHECK: .debug_line contents:65CHECK-NEXT: debug_line[0x00000000]66CHECK-NEXT: Line table prologue:67CHECK-NEXT: total_length: 0x0000005a68CHECK-NEXT: format: DWARF3269CHECK-NEXT: version: 570CHECK-NEXT: address_size: 871CHECK-NEXT: seg_select_size: 072CHECK-NEXT: prologue_length: 0x0000003773CHECK-NEXT: min_inst_length: 174CHECK-NEXT: max_ops_per_inst: 175CHECK-NEXT: default_is_stmt: 176CHECK-NEXT: line_base: -577CHECK-NEXT: line_range: 1478CHECK-NEXT: opcode_base: 1379CHECK-NEXT: standard_opcode_lengths[DW_LNS_copy] = 080CHECK-NEXT: standard_opcode_lengths[DW_LNS_advance_pc] = 181CHECK-NEXT: standard_opcode_lengths[DW_LNS_advance_line] = 182CHECK-NEXT: standard_opcode_lengths[DW_LNS_set_file] = 183CHECK-NEXT: standard_opcode_lengths[DW_LNS_set_column] = 184CHECK-NEXT: standard_opcode_lengths[DW_LNS_negate_stmt] = 085CHECK-NEXT: standard_opcode_lengths[DW_LNS_set_basic_block] = 086CHECK-NEXT: standard_opcode_lengths[DW_LNS_const_add_pc] = 087CHECK-NEXT: standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 188CHECK-NEXT: standard_opcode_lengths[DW_LNS_set_prologue_end] = 089CHECK-NEXT: standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 090CHECK-NEXT: standard_opcode_lengths[DW_LNS_set_isa] = 191CHECK-NEXT: include_directories[ 0] = .debug_line_str[0x00000000] = "/Users/shubham/Development/test109275485"92CHECK-NEXT: file_names[ 0]:93CHECK-NEXT: name: .debug_line_str[0x00000029] = "a.cpp"94CHECK-NEXT: dir_index: 095CHECK-NEXT: md5_checksum: 2675ab7ce3623b564cfd8a2906a462e596 97 98CHECK: .debug_str contents:99 100CHECK: .debug_line_str contents:101CHECK-NEXT: 0x00000000: "/Users/shubham/Development/test109275485"102CHECK-NEXT: 0x00000029: "a.cpp"103 104CHECK: .debug_rnglists contents:105CHECK-NEXT: 0x00000000: range list header: length = 0x0000000e, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000106CHECK-NEXT: ranges:107CHECK-NEXT: [[RANGELIST_OFFSET]]: [DW_RLE_base_addressx]: 0x0000000000000000108CHECK-NEXT: 0x0000000e: [DW_RLE_offset_pair ]: {{.*}}[0x[[RANGELIST_OFFSET_START]], 0x[[RANGELIST_OFFSET_END]])109CHECK-NEXT: 0x00000011: [DW_RLE_end_of_list ]110 111CHECK: .debug_names contents:112CHECK-NEXT: Name Index @ 0x0 {113CHECK-NEXT: Header {114CHECK-NEXT: Length:115CHECK-NEXT: Format: DWARF32116CHECK-NEXT: Version: 5117CHECK-NEXT: CU count: 1118CHECK-NEXT: Local TU count: 0119CHECK-NEXT: Foreign TU count: 0120CHECK-NEXT: Bucket count: 3121CHECK-NEXT: Name count: 3122CHECK-NEXT: Abbreviations table size:123CHECK-NEXT: Augmentation: 'LLVM0700'124CHECK-NEXT: }125