| 1 |
# RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \ |
| 2 |
# RUN: | llvm-dwarfdump --debug-info --debug-line - \ |
| 3 |
# RUN: | FileCheck %s |
| 4 |
# RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \ |
| 5 |
# RUN: | llvm-dwarfdump --debug-info --debug-line - -o %t |
| 6 |
# RUN: cat %t | FileCheck %s |
| 7 |
|
| 8 |
# CHECK-NOT: .debug_abbrev contents: |
| 9 |
# |
| 10 |
# CHECK: .debug_info contents: |
| 11 |
# CHECK: DW_TAG_compile_unit |
| 12 |
# CHECK-NOT: DW_FORM |
| 13 |
# CHECK: DW_AT_name ("brief.c") |
| 14 |
# CHECK: DW_AT_name ("main") |
| 15 |
# CHECK: DW_AT_name ("int") |
| 16 |
# CHECK-NOT: debug_str |
| 17 |
# CHECK-NOT: DW_AT_type {{.*}} => |
| 18 |
|
| 19 |
# CHECK: Address Line Column File ISA Discriminator OpIndex Flags |
| 20 |
# CHECK-NEXT:------------------ ------ ------ ------ --- ------------- ------- ------------- |
| 21 |
# CHECK-NEXT:0x0000000000000000 1 0 1 0 0 0 is_stmt |
| 22 |
# CHECK-NEXT:0x0000000000000006 1 12 1 0 0 0 is_stmt prologue_end |
| 23 |
# CHECK-NEXT:0x0000000000000008 1 12 1 0 0 0 is_stmt end_sequence |
| 24 |
|
| 25 |
# CHECK-NOT: {{.*}} contents: |
| 26 |
|
| 27 |
# This test is meant to verify that without specifying -verbose DW_FORMs and |
| 28 |
# abbreviation codes are hidden from .debug_info section. Furthermore it |
| 29 |
# verifies that it also hides .debug_str and die reference offsets into the CU |
| 30 |
# and that the .debug_line table is printed rather than the opcodes. |
| 31 |
|
| 32 |
.section __TEXT,__text,regular,pure_instructions |
| 33 |
.macosx_version_min 10, 12 |
| 34 |
.globl _main ## -- Begin function main |
| 35 |
.p2align 4, 0x90 |
| 36 |
_main: ## @main |
| 37 |
Lfunc_begin0: |
| 38 |
.file 1 "brief.c" |
| 39 |
.loc 1 1 0 ## brief.c:1:0 |
| 40 |
.cfi_startproc |
| 41 |
## %bb.0: ## %entry |
| 42 |
pushq %rbp |
| 43 |
.cfi_def_cfa_offset 16 |
| 44 |
.cfi_offset %rbp, -16 |
| 45 |
movq %rsp, %rbp |
| 46 |
.cfi_def_cfa_register %rbp |
| 47 |
xorl %eax, %eax |
| 48 |
Ltmp0: |
| 49 |
.loc 1 1 12 prologue_end ## brief.c:1:12 |
| 50 |
popq %rbp |
| 51 |
retq |
| 52 |
Ltmp1: |
| 53 |
Lfunc_end0: |
| 54 |
.cfi_endproc |
| 55 |
## -- End function |
| 56 |
.section __DWARF,__debug_str,regular,debug |
| 57 |
Linfo_string: |
| 58 |
.asciz "clang version 6.0.0 (trunk 311115) (llvm/trunk 311188)" ## string offset=0 |
| 59 |
.asciz "brief.c" ## string offset=55 |
| 60 |
.asciz "/private/tmp" ## string offset=63 |
| 61 |
.asciz "main" ## string offset=76 |
| 62 |
.asciz "int" ## string offset=81 |
| 63 |
.section __DWARF,__debug_abbrev,regular,debug |
| 64 |
Lsection_abbrev: |
| 65 |
.byte 1 ## Abbreviation Code |
| 66 |
.byte 17 ## DW_TAG_compile_unit |
| 67 |
.byte 1 ## DW_CHILDREN_yes |
| 68 |
.byte 37 ## DW_AT_producer |
| 69 |
.byte 14 ## DW_FORM_strp |
| 70 |
.byte 19 ## DW_AT_language |
| 71 |
.byte 5 ## DW_FORM_data2 |
| 72 |
.byte 3 ## DW_AT_name |
| 73 |
.byte 14 ## DW_FORM_strp |
| 74 |
.byte 16 ## DW_AT_stmt_list |
| 75 |
.byte 23 ## DW_FORM_sec_offset |
| 76 |
.byte 27 ## DW_AT_comp_dir |
| 77 |
.byte 14 ## DW_FORM_strp |
| 78 |
.byte 17 ## DW_AT_low_pc |
| 79 |
.byte 1 ## DW_FORM_addr |
| 80 |
.byte 18 ## DW_AT_high_pc |
| 81 |
.byte 6 ## DW_FORM_data4 |
| 82 |
.byte 0 ## EOM(1) |
| 83 |
.byte 0 ## EOM(2) |
| 84 |
.byte 2 ## Abbreviation Code |
| 85 |
.byte 46 ## DW_TAG_subprogram |
| 86 |
.byte 0 ## DW_CHILDREN_no |
| 87 |
.byte 17 ## DW_AT_low_pc |
| 88 |
.byte 1 ## DW_FORM_addr |
| 89 |
.byte 18 ## DW_AT_high_pc |
| 90 |
.byte 6 ## DW_FORM_data4 |
| 91 |
.byte 64 ## DW_AT_frame_base |
| 92 |
.byte 24 ## DW_FORM_exprloc |
| 93 |
.byte 3 ## DW_AT_name |
| 94 |
.byte 14 ## DW_FORM_strp |
| 95 |
.byte 58 ## DW_AT_decl_file |
| 96 |
.byte 11 ## DW_FORM_data1 |
| 97 |
.byte 59 ## DW_AT_decl_line |
| 98 |
.byte 11 ## DW_FORM_data1 |
| 99 |
.byte 73 ## DW_AT_type |
| 100 |
.byte 19 ## DW_FORM_ref4 |
| 101 |
.byte 63 ## DW_AT_external |
| 102 |
.byte 25 ## DW_FORM_flag_present |
| 103 |
.byte 0 ## EOM(1) |
| 104 |
.byte 0 ## EOM(2) |
| 105 |
.byte 3 ## Abbreviation Code |
| 106 |
.byte 36 ## DW_TAG_base_type |
| 107 |
.byte 0 ## DW_CHILDREN_no |
| 108 |
.byte 3 ## DW_AT_name |
| 109 |
.byte 14 ## DW_FORM_strp |
| 110 |
.byte 62 ## DW_AT_encoding |
| 111 |
.byte 11 ## DW_FORM_data1 |
| 112 |
.byte 11 ## DW_AT_byte_size |
| 113 |
.byte 11 ## DW_FORM_data1 |
| 114 |
.byte 0 ## EOM(1) |
| 115 |
.byte 0 ## EOM(2) |
| 116 |
.byte 0 ## EOM(3) |
| 117 |
.section __DWARF,__debug_info,regular,debug |
| 118 |
Lsection_info: |
| 119 |
Lcu_begin0: |
| 120 |
.long 71 ## Length of Unit |
| 121 |
.short 4 ## DWARF version number |
| 122 |
Lset0 = Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section |
| 123 |
.long Lset0 |
| 124 |
.byte 8 ## Address Size (in bytes) |
| 125 |
.byte 1 ## Abbrev [1] 0xb:0x40 DW_TAG_compile_unit |
| 126 |
.long 0 ## DW_AT_producer |
| 127 |
.short 12 ## DW_AT_language |
| 128 |
.long 55 ## DW_AT_name |
| 129 |
Lset1 = Lline_table_start0-Lsection_line ## DW_AT_stmt_list |
| 130 |
.long Lset1 |
| 131 |
.long 63 ## DW_AT_comp_dir |
| 132 |
.quad Lfunc_begin0 ## DW_AT_low_pc |
| 133 |
Lset2 = Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc |
| 134 |
.long Lset2 |
| 135 |
.byte 2 ## Abbrev [2] 0x2a:0x19 DW_TAG_subprogram |
| 136 |
.quad Lfunc_begin0 ## DW_AT_low_pc |
| 137 |
Lset3 = Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc |
| 138 |
.long Lset3 |
| 139 |
.byte 1 ## DW_AT_frame_base |
| 140 |
.byte 86 |
| 141 |
.long 76 ## DW_AT_name |
| 142 |
.byte 1 ## DW_AT_decl_file |
| 143 |
.byte 1 ## DW_AT_decl_line |
| 144 |
.long 67 ## DW_AT_type |
| 145 |
## DW_AT_external |
| 146 |
.byte 3 ## Abbrev [3] 0x43:0x7 DW_TAG_base_type |
| 147 |
.long 81 ## DW_AT_name |
| 148 |
.byte 5 ## DW_AT_encoding |
| 149 |
.byte 4 ## DW_AT_byte_size |
| 150 |
.byte 0 ## End Of Children Mark |
| 151 |
.section __DWARF,__debug_ranges,regular,debug |
| 152 |
Ldebug_range: |
| 153 |
.section __DWARF,__apple_names,regular,debug |
| 154 |
Lnames_begin: |
| 155 |
.long 1212240712 ## Header Magic |
| 156 |
.short 1 ## Header Version |
| 157 |
.short 0 ## Header Hash Function |
| 158 |
.long 1 ## Header Bucket Count |
| 159 |
.long 1 ## Header Hash Count |
| 160 |
.long 12 ## Header Data Length |
| 161 |
.long 0 ## HeaderData Die Offset Base |
| 162 |
.long 1 ## HeaderData Atom Count |
| 163 |
.short 1 ## DW_ATOM_die_offset |
| 164 |
.short 6 ## DW_FORM_data4 |
| 165 |
.long 0 ## Bucket 0 |
| 166 |
.long 2090499946 ## Hash in Bucket 0 |
| 167 |
.long LNames0-Lnames_begin ## Offset in Bucket 0 |
| 168 |
LNames0: |
| 169 |
.long 76 ## main |
| 170 |
.long 1 ## Num DIEs |
| 171 |
.long 42 |
| 172 |
.long 0 |
| 173 |
.section __DWARF,__apple_objc,regular,debug |
| 174 |
Lobjc_begin: |
| 175 |
.long 1212240712 ## Header Magic |
| 176 |
.short 1 ## Header Version |
| 177 |
.short 0 ## Header Hash Function |
| 178 |
.long 1 ## Header Bucket Count |
| 179 |
.long 0 ## Header Hash Count |
| 180 |
.long 12 ## Header Data Length |
| 181 |
.long 0 ## HeaderData Die Offset Base |
| 182 |
.long 1 ## HeaderData Atom Count |
| 183 |
.short 1 ## DW_ATOM_die_offset |
| 184 |
.short 6 ## DW_FORM_data4 |
| 185 |
.long -1 ## Bucket 0 |
| 186 |
.section __DWARF,__apple_namespac,regular,debug |
| 187 |
Lnamespac_begin: |
| 188 |
.long 1212240712 ## Header Magic |
| 189 |
.short 1 ## Header Version |
| 190 |
.short 0 ## Header Hash Function |
| 191 |
.long 1 ## Header Bucket Count |
| 192 |
.long 0 ## Header Hash Count |
| 193 |
.long 12 ## Header Data Length |
| 194 |
.long 0 ## HeaderData Die Offset Base |
| 195 |
.long 1 ## HeaderData Atom Count |
| 196 |
.short 1 ## DW_ATOM_die_offset |
| 197 |
.short 6 ## DW_FORM_data4 |
| 198 |
.long -1 ## Bucket 0 |
| 199 |
.section __DWARF,__apple_types,regular,debug |
| 200 |
Ltypes_begin: |
| 201 |
.long 1212240712 ## Header Magic |
| 202 |
.short 1 ## Header Version |
| 203 |
.short 0 ## Header Hash Function |
| 204 |
.long 1 ## Header Bucket Count |
| 205 |
.long 1 ## Header Hash Count |
| 206 |
.long 20 ## Header Data Length |
| 207 |
.long 0 ## HeaderData Die Offset Base |
| 208 |
.long 3 ## HeaderData Atom Count |
| 209 |
.short 1 ## DW_ATOM_die_offset |
| 210 |
.short 6 ## DW_FORM_data4 |
| 211 |
.short 3 ## DW_ATOM_die_tag |
| 212 |
.short 5 ## DW_FORM_data2 |
| 213 |
.short 4 ## DW_ATOM_type_flags |
| 214 |
.short 11 ## DW_FORM_data1 |
| 215 |
.long 0 ## Bucket 0 |
| 216 |
.long 193495088 ## Hash in Bucket 0 |
| 217 |
.long Ltypes0-Ltypes_begin ## Offset in Bucket 0 |
| 218 |
Ltypes0: |
| 219 |
.long 81 ## int |
| 220 |
.long 1 ## Num DIEs |
| 221 |
.long 67 |
| 222 |
.short 36 |
| 223 |
.byte 0 |
| 224 |
.long 0 |
| 225 |
|
| 226 |
.subsections_via_symbols |
| 227 |
.section __DWARF,__debug_line,regular,debug |
| 228 |
Lsection_line: |
| 229 |
Lline_table_start0: |