1 ; This test checks to that DWARF v5 debug info can be correctly linked
2 ; into a dSYM bundle by dsymutil, with the correct section names and DWARF v5
3 ; headers for the different sections.
5 ; 1.o was produced with the source file:
8 ; __attribute__((section("1,__text_foo"))) void foo() {}
17 ; clang -g -c -O1 a.cpp -Xclang -gdwarf-5 -o 1.o
20 RUN: rm -rf %t.dir && mkdir -p %t.dir
21 RUN: dsymutil --linker llvm -y %p/../dummy-debug-map-amr64.map \
22 RUN: -oso-prepend-path=%p/../../Inputs/DWARF5 -o %t.dir/dwarf5-macho.dSYM
23 RUN: llvm-dwarfdump %t.dir/dwarf5-macho.dSYM -a --verbose | FileCheck %s
25 CHECK:.debug_abbrev contents:
26 CHECK-NEXT: Abbrev table for offset: 0x00000000
28 CHECK: .debug_info contents:
29 CHECK-NEXT: Compile Unit: length = 0x0000004a, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x08
30 CHECK: DW_AT_ranges [DW_FORM_sec_offset] (0x[[RANGELIST_OFFSET:[0-9a-f]+]]
31 CHECK-NEXT: [0x[[RANGELIST_OFFSET_START:[0-9a-f]+]], 0x[[RANGELIST_OFFSET_END:[0-9a-f]+]]))
32 CHECK-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)
33 CHECK: 0x0000002c: DW_TAG_subprogram [2] * (0x0000000c)
34 CHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x[[#%.16x,LOCLIST_LOWPC:]])
35 CHECK: 0x0000003c: DW_TAG_formal_parameter [3] (0x0000002c)
36 CHECK-NEXT: DW_AT_location [DW_FORM_sec_offset] (0x[[LOC_OFFSET:[0-9a-f]+]]:
37 CHECK-NEXT: [0x[[#%.16x,LOCLIST_PAIR_START:]], 0x[[#%.16x,LOCLIST_PAIR_END:]]): [[LOCLIST_EXPR:.*]]
38 CHECK-NEXT: [0x[[#%.16x,LOCLIST_PAIR_START2:]], 0x[[#%.16x,LOCLIST_PAIR_END2:]]): [[LOCLIST_EXPR2:.*]])
40 CHECK: .debug_loclists contents:
41 CHECK-NEXT: 0x00000000: locations list header: length = 0x00000018, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
42 CHECK-NEXT: 0x[[LOC_OFFSET]]:
43 CHECK-NEXT: DW_LLE_base_addressx (0x0000000000000000)
44 CHECK-NEXT: DW_LLE_offset_pair (0x[[#sub(LOCLIST_PAIR_START,LOCLIST_LOWPC)]], 0x[[#sub(LOCLIST_PAIR_END,LOCLIST_LOWPC)]])
45 CHECK-NEXT: DW_LLE_offset_pair (0x[[#sub(LOCLIST_PAIR_START2,LOCLIST_LOWPC)]], 0x[[#sub(LOCLIST_PAIR_END2,LOCLIST_LOWPC)]])
46 CHECK-NEXT: DW_LLE_end_of_list ()
48 CHECK: .debug_line contents:
49 CHECK-NEXT: debug_line[0x00000000]
50 CHECK-NEXT: Line table prologue:
51 CHECK-NEXT: total_length: 0x00000048
52 CHECK-NEXT: format: DWARF32
53 CHECK-NEXT: version: 5
54 CHECK-NEXT: address_size: 8
55 CHECK-NEXT: seg_select_size: 0
56 CHECK-NEXT: prologue_length: 0x00000025
57 CHECK-NEXT: min_inst_length: 1
58 CHECK-NEXT: max_ops_per_inst: 1
59 CHECK-NEXT: default_is_stmt: 1
60 CHECK-NEXT: line_base: -5
61 CHECK-NEXT: line_range: 14
62 CHECK-NEXT: opcode_base: 13
63 CHECK-NEXT: standard_opcode_lengths[DW_LNS_copy] = 0
64 CHECK-NEXT: standard_opcode_lengths[DW_LNS_advance_pc] = 1
65 CHECK-NEXT: standard_opcode_lengths[DW_LNS_advance_line] = 1
66 CHECK-NEXT: standard_opcode_lengths[DW_LNS_set_file] = 1
67 CHECK-NEXT: standard_opcode_lengths[DW_LNS_set_column] = 1
68 CHECK-NEXT: standard_opcode_lengths[DW_LNS_negate_stmt] = 0
69 CHECK-NEXT: standard_opcode_lengths[DW_LNS_set_basic_block] = 0
70 CHECK-NEXT: standard_opcode_lengths[DW_LNS_const_add_pc] = 0
71 CHECK-NEXT: standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1
72 CHECK-NEXT: standard_opcode_lengths[DW_LNS_set_prologue_end] = 0
73 CHECK-NEXT: standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0
74 CHECK-NEXT: standard_opcode_lengths[DW_LNS_set_isa] = 1
75 CHECK-NEXT: include_directories[ 0] = .debug_line_str[0x00000000] = "/Users/shubham/Development/test109275485"
76 CHECK-NEXT: file_names[ 0]:
77 CHECK-NEXT: name: .debug_line_str[0x00000029] = "a.cpp"
78 CHECK-NEXT: dir_index: 0
81 CHECK: .debug_str contents:
83 CHECK: .debug_line_str contents:
84 CHECK-NEXT: 0x00000000: "/Users/shubham/Development/test109275485"
85 CHECK-NEXT: 0x00000029: "a.cpp"
87 CHECK: .debug_rnglists contents:
88 CHECK-NEXT: 0x00000000: range list header: length = 0x0000000e, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
90 CHECK-NEXT: [[RANGELIST_OFFSET]]: [DW_RLE_base_addressx]: 0x0000000000000000
91 CHECK-NEXT: 0x0000000e: [DW_RLE_offset_pair ]: {{.*}}[0x[[RANGELIST_OFFSET_START]], 0x[[RANGELIST_OFFSET_END]])
92 CHECK-NEXT: 0x00000011: [DW_RLE_end_of_list ]