| 1 |
# RUN: llvm-mc -triple x86_64-apple-darwin %s -filetype=obj -o %t |
| 2 |
# RUN: llvm-dwarfdump --debug-info=0x0000002a -p %t | FileCheck %s --check-prefix=PARENTS |
| 3 |
# RUN: llvm-dwarfdump --debug-info=0x0000002a -c %t | FileCheck %s --check-prefix=CHILDREN |
| 4 |
# RUN: llvm-dwarfdump --debug-info=0x0000002a -p -c %t | FileCheck %s --check-prefix=BOTH |
| 5 |
# RUN: llvm-dwarfdump --debug-info=0x00000032 -p -parent-recurse-depth 1 -c %t | FileCheck %s --check-prefix=ONEPARENT |
| 6 |
|
| 7 |
# PARENTS: DW_TAG_compile_unit |
| 8 |
# PARENTS: DW_TAG_enumeration_type |
| 9 |
# PARENTS-NOT: DW_TAG_enumerator |
| 10 |
|
| 11 |
# ONEPARENT-NOT: DW_TAG_compile_unit |
| 12 |
# ONEPARENT: DW_TAG_enumeration_type |
| 13 |
# ONEPARENT: DW_TAG_enumerator |
| 14 |
|
| 15 |
# CHILDREN-NOT: DW_TAG_compile_unit |
| 16 |
# CHILDREN: DW_TAG_enumerator |
| 17 |
# CHILDREN: DW_AT_name ("first") |
| 18 |
# CHILDREN: DW_TAG_enumerator |
| 19 |
# CHILDREN: DW_AT_name ("second") |
| 20 |
|
| 21 |
# BOTH: DW_TAG_compile_unit |
| 22 |
# BOTH: DW_TAG_enumeration_type |
| 23 |
# BOTH: DW_TAG_enumerator |
| 24 |
# BOTH: DW_AT_name ("first") |
| 25 |
# BOTH: DW_TAG_enumerator |
| 26 |
# BOTH: DW_AT_name ("second") |
| 27 |
|
| 28 |
# BOTH-NOT: DW_TAG_compile_unit |
| 29 |
# BOTH-NOT: DW_TAG_enumeration_type |
| 30 |
# BOTH-NOT: DW_TAG_enumerator |
| 31 |
|
| 32 |
.section __TEXT,__text,regular,pure_instructions |
| 33 |
.file 1 "/private/tmp" "/tmp/enum.c" |
| 34 |
.globl _main ## -- Begin function main |
| 35 |
.p2align 4, 0x90 |
| 36 |
_main: ## @main |
| 37 |
Lfunc_begin0: |
| 38 |
.loc 1 4 0 ## /tmp/enum.c:4:0 |
| 39 |
.cfi_startproc |
| 40 |
## %bb.0: ## %entry |
| 41 |
pushq %rbp |
| 42 |
.cfi_def_cfa_offset 16 |
| 43 |
.cfi_offset %rbp, -16 |
| 44 |
movq %rsp, %rbp |
| 45 |
.cfi_def_cfa_register %rbp |
| 46 |
movl $0, -4(%rbp) |
| 47 |
Ltmp0: |
| 48 |
.loc 1 5 7 prologue_end ## /tmp/enum.c:5:7 |
| 49 |
movl $0, -8(%rbp) |
| 50 |
.loc 1 6 10 ## /tmp/enum.c:6:10 |
| 51 |
movl -8(%rbp), %eax |
| 52 |
.loc 1 6 3 is_stmt 0 ## /tmp/enum.c:6:3 |
| 53 |
popq %rbp |
| 54 |
retq |
| 55 |
Ltmp1: |
| 56 |
Lfunc_end0: |
| 57 |
.cfi_endproc |
| 58 |
## -- End function |
| 59 |
.section __DWARF,__debug_str,regular,debug |
| 60 |
Linfo_string: |
| 61 |
.asciz "clang version 7.0.0 " ## string offset=0 |
| 62 |
.asciz "/tmp/enum.c" ## string offset=21 |
| 63 |
.asciz "/private/tmp" ## string offset=33 |
| 64 |
.asciz "unsigned int" ## string offset=46 |
| 65 |
.asciz "first" ## string offset=59 |
| 66 |
.asciz "second" ## string offset=65 |
| 67 |
.asciz "main" ## string offset=72 |
| 68 |
.asciz "int" ## string offset=77 |
| 69 |
.asciz "var" ## string offset=81 |
| 70 |
.section __DWARF,__debug_abbrev,regular,debug |
| 71 |
Lsection_abbrev: |
| 72 |
.byte 1 ## Abbreviation Code |
| 73 |
.byte 17 ## DW_TAG_compile_unit |
| 74 |
.byte 1 ## DW_CHILDREN_yes |
| 75 |
.byte 37 ## DW_AT_producer |
| 76 |
.byte 14 ## DW_FORM_strp |
| 77 |
.byte 19 ## DW_AT_language |
| 78 |
.byte 5 ## DW_FORM_data2 |
| 79 |
.byte 3 ## DW_AT_name |
| 80 |
.byte 14 ## DW_FORM_strp |
| 81 |
.byte 16 ## DW_AT_stmt_list |
| 82 |
.byte 23 ## DW_FORM_sec_offset |
| 83 |
.byte 27 ## DW_AT_comp_dir |
| 84 |
.byte 14 ## DW_FORM_strp |
| 85 |
.byte 17 ## DW_AT_low_pc |
| 86 |
.byte 1 ## DW_FORM_addr |
| 87 |
.byte 18 ## DW_AT_high_pc |
| 88 |
.byte 6 ## DW_FORM_data4 |
| 89 |
.byte 0 ## EOM(1) |
| 90 |
.byte 0 ## EOM(2) |
| 91 |
.byte 2 ## Abbreviation Code |
| 92 |
.byte 4 ## DW_TAG_enumeration_type |
| 93 |
.byte 1 ## DW_CHILDREN_yes |
| 94 |
.byte 73 ## DW_AT_type |
| 95 |
.byte 19 ## DW_FORM_ref4 |
| 96 |
.byte 11 ## DW_AT_byte_size |
| 97 |
.byte 11 ## DW_FORM_data1 |
| 98 |
.byte 58 ## DW_AT_decl_file |
| 99 |
.byte 11 ## DW_FORM_data1 |
| 100 |
.byte 59 ## DW_AT_decl_line |
| 101 |
.byte 11 ## DW_FORM_data1 |
| 102 |
.byte 0 ## EOM(1) |
| 103 |
.byte 0 ## EOM(2) |
| 104 |
.byte 3 ## Abbreviation Code |
| 105 |
.byte 40 ## DW_TAG_enumerator |
| 106 |
.byte 0 ## DW_CHILDREN_no |
| 107 |
.byte 3 ## DW_AT_name |
| 108 |
.byte 14 ## DW_FORM_strp |
| 109 |
.byte 28 ## DW_AT_const_value |
| 110 |
.byte 15 ## DW_FORM_udata |
| 111 |
.byte 0 ## EOM(1) |
| 112 |
.byte 0 ## EOM(2) |
| 113 |
.byte 4 ## Abbreviation Code |
| 114 |
.byte 36 ## DW_TAG_base_type |
| 115 |
.byte 0 ## DW_CHILDREN_no |
| 116 |
.byte 3 ## DW_AT_name |
| 117 |
.byte 14 ## DW_FORM_strp |
| 118 |
.byte 62 ## DW_AT_encoding |
| 119 |
.byte 11 ## DW_FORM_data1 |
| 120 |
.byte 11 ## DW_AT_byte_size |
| 121 |
.byte 11 ## DW_FORM_data1 |
| 122 |
.byte 0 ## EOM(1) |
| 123 |
.byte 0 ## EOM(2) |
| 124 |
.byte 5 ## Abbreviation Code |
| 125 |
.byte 46 ## DW_TAG_subprogram |
| 126 |
.byte 1 ## DW_CHILDREN_yes |
| 127 |
.byte 17 ## DW_AT_low_pc |
| 128 |
.byte 1 ## DW_FORM_addr |
| 129 |
.byte 18 ## DW_AT_high_pc |
| 130 |
.byte 6 ## DW_FORM_data4 |
| 131 |
.byte 64 ## DW_AT_frame_base |
| 132 |
.byte 24 ## DW_FORM_exprloc |
| 133 |
.byte 3 ## DW_AT_name |
| 134 |
.byte 14 ## DW_FORM_strp |
| 135 |
.byte 58 ## DW_AT_decl_file |
| 136 |
.byte 11 ## DW_FORM_data1 |
| 137 |
.byte 59 ## DW_AT_decl_line |
| 138 |
.byte 11 ## DW_FORM_data1 |
| 139 |
.byte 73 ## DW_AT_type |
| 140 |
.byte 19 ## DW_FORM_ref4 |
| 141 |
.byte 63 ## DW_AT_external |
| 142 |
.byte 25 ## DW_FORM_flag_present |
| 143 |
.byte 0 ## EOM(1) |
| 144 |
.byte 0 ## EOM(2) |
| 145 |
.byte 6 ## Abbreviation Code |
| 146 |
.byte 52 ## DW_TAG_variable |
| 147 |
.byte 0 ## DW_CHILDREN_no |
| 148 |
.byte 2 ## DW_AT_location |
| 149 |
.byte 24 ## DW_FORM_exprloc |
| 150 |
.byte 3 ## DW_AT_name |
| 151 |
.byte 14 ## DW_FORM_strp |
| 152 |
.byte 58 ## DW_AT_decl_file |
| 153 |
.byte 11 ## DW_FORM_data1 |
| 154 |
.byte 59 ## DW_AT_decl_line |
| 155 |
.byte 11 ## DW_FORM_data1 |
| 156 |
.byte 73 ## DW_AT_type |
| 157 |
.byte 19 ## DW_FORM_ref4 |
| 158 |
.byte 0 ## EOM(1) |
| 159 |
.byte 0 ## EOM(2) |
| 160 |
.byte 0 ## EOM(3) |
| 161 |
.section __DWARF,__debug_info,regular,debug |
| 162 |
Lsection_info: |
| 163 |
Lcu_begin0: |
| 164 |
.long 114 ## Length of Unit |
| 165 |
.short 4 ## DWARF version number |
| 166 |
.set Lset0, Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section |
| 167 |
.long Lset0 |
| 168 |
.byte 8 ## Address Size (in bytes) |
| 169 |
.byte 1 ## Abbrev [1] 0xb:0x6b DW_TAG_compile_unit |
| 170 |
.long 0 ## DW_AT_producer |
| 171 |
.short 12 ## DW_AT_language |
| 172 |
.long 21 ## DW_AT_name |
| 173 |
.set Lset1, Lline_table_start0-Lsection_line ## DW_AT_stmt_list |
| 174 |
.long Lset1 |
| 175 |
.long 33 ## DW_AT_comp_dir |
| 176 |
.quad Lfunc_begin0 ## DW_AT_low_pc |
| 177 |
.set Lset2, Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc |
| 178 |
.long Lset2 |
| 179 |
.byte 2 ## Abbrev [2] 0x2a:0x15 DW_TAG_enumeration_type |
| 180 |
.long 63 ## DW_AT_type |
| 181 |
.byte 4 ## DW_AT_byte_size |
| 182 |
.byte 1 ## DW_AT_decl_file |
| 183 |
.byte 1 ## DW_AT_decl_line |
| 184 |
.byte 3 ## Abbrev [3] 0x32:0x6 DW_TAG_enumerator |
| 185 |
.long 59 ## DW_AT_name |
| 186 |
.byte 0 ## DW_AT_const_value |
| 187 |
.byte 3 ## Abbrev [3] 0x38:0x6 DW_TAG_enumerator |
| 188 |
.long 65 ## DW_AT_name |
| 189 |
.byte 1 ## DW_AT_const_value |
| 190 |
.byte 0 ## End Of Children Mark |
| 191 |
.byte 4 ## Abbrev [4] 0x3f:0x7 DW_TAG_base_type |
| 192 |
.long 46 ## DW_AT_name |
| 193 |
.byte 7 ## DW_AT_encoding |
| 194 |
.byte 4 ## DW_AT_byte_size |
| 195 |
.byte 5 ## Abbrev [5] 0x46:0x28 DW_TAG_subprogram |
| 196 |
.quad Lfunc_begin0 ## DW_AT_low_pc |
| 197 |
.set Lset3, Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc |
| 198 |
.long Lset3 |
| 199 |
.byte 1 ## DW_AT_frame_base |
| 200 |
.byte 86 |
| 201 |
.long 72 ## DW_AT_name |
| 202 |
.byte 1 ## DW_AT_decl_file |
| 203 |
.byte 3 ## DW_AT_decl_line |
| 204 |
.long 110 ## DW_AT_type |
| 205 |
## DW_AT_external |
| 206 |
.byte 6 ## Abbrev [6] 0x5f:0xe DW_TAG_variable |
| 207 |
.byte 2 ## DW_AT_location |
| 208 |
.byte 145 |
| 209 |
.byte 120 |
| 210 |
.long 81 ## DW_AT_name |
| 211 |
.byte 1 ## DW_AT_decl_file |
| 212 |
.byte 5 ## DW_AT_decl_line |
| 213 |
.long 110 ## DW_AT_type |
| 214 |
.byte 0 ## End Of Children Mark |
| 215 |
.byte 4 ## Abbrev [4] 0x6e:0x7 DW_TAG_base_type |
| 216 |
.long 77 ## DW_AT_name |
| 217 |
.byte 5 ## DW_AT_encoding |
| 218 |
.byte 4 ## DW_AT_byte_size |
| 219 |
.byte 0 ## End Of Children Mark |
| 220 |
.section __DWARF,__debug_ranges,regular,debug |
| 221 |
Ldebug_range: |
| 222 |
.section __DWARF,__debug_macinfo,regular,debug |
| 223 |
Ldebug_macinfo: |
| 224 |
.byte 0 ## End Of Macro List Mark |
| 225 |
.section __DWARF,__apple_names,regular,debug |
| 226 |
Lnames_begin: |
| 227 |
.long 1212240712 ## Header Magic |
| 228 |
.short 1 ## Header Version |
| 229 |
.short 0 ## Header Hash Function |
| 230 |
.long 1 ## Header Bucket Count |
| 231 |
.long 1 ## Header Hash Count |
| 232 |
.long 12 ## Header Data Length |
| 233 |
.long 0 ## HeaderData Die Offset Base |
| 234 |
.long 1 ## HeaderData Atom Count |
| 235 |
.short 1 ## DW_ATOM_die_offset |
| 236 |
.short 6 ## DW_FORM_data4 |
| 237 |
.long 0 ## Bucket 0 |
| 238 |
.long 2090499946 ## Hash in Bucket 0 |
| 239 |
.set Lset4, LNames0-Lnames_begin ## Offset in Bucket 0 |
| 240 |
.long Lset4 |
| 241 |
LNames0: |
| 242 |
.long 72 ## main |
| 243 |
.long 1 ## Num DIEs |
| 244 |
.long 70 |
| 245 |
.long 0 |
| 246 |
.section __DWARF,__apple_objc,regular,debug |
| 247 |
Lobjc_begin: |
| 248 |
.long 1212240712 ## Header Magic |
| 249 |
.short 1 ## Header Version |
| 250 |
.short 0 ## Header Hash Function |
| 251 |
.long 1 ## Header Bucket Count |
| 252 |
.long 0 ## Header Hash Count |
| 253 |
.long 12 ## Header Data Length |
| 254 |
.long 0 ## HeaderData Die Offset Base |
| 255 |
.long 1 ## HeaderData Atom Count |
| 256 |
.short 1 ## DW_ATOM_die_offset |
| 257 |
.short 6 ## DW_FORM_data4 |
| 258 |
.long -1 ## Bucket 0 |
| 259 |
.section __DWARF,__apple_namespac,regular,debug |
| 260 |
Lnamespac_begin: |
| 261 |
.long 1212240712 ## Header Magic |
| 262 |
.short 1 ## Header Version |
| 263 |
.short 0 ## Header Hash Function |
| 264 |
.long 1 ## Header Bucket Count |
| 265 |
.long 0 ## Header Hash Count |
| 266 |
.long 12 ## Header Data Length |
| 267 |
.long 0 ## HeaderData Die Offset Base |
| 268 |
.long 1 ## HeaderData Atom Count |
| 269 |
.short 1 ## DW_ATOM_die_offset |
| 270 |
.short 6 ## DW_FORM_data4 |
| 271 |
.long -1 ## Bucket 0 |
| 272 |
.section __DWARF,__apple_types,regular,debug |
| 273 |
Ltypes_begin: |
| 274 |
.long 1212240712 ## Header Magic |
| 275 |
.short 1 ## Header Version |
| 276 |
.short 0 ## Header Hash Function |
| 277 |
.long 2 ## Header Bucket Count |
| 278 |
.long 2 ## Header Hash Count |
| 279 |
.long 20 ## Header Data Length |
| 280 |
.long 0 ## HeaderData Die Offset Base |
| 281 |
.long 3 ## HeaderData Atom Count |
| 282 |
.short 1 ## DW_ATOM_die_offset |
| 283 |
.short 6 ## DW_FORM_data4 |
| 284 |
.short 3 ## DW_ATOM_die_tag |
| 285 |
.short 5 ## DW_FORM_data2 |
| 286 |
.short 4 ## DW_ATOM_type_flags |
| 287 |
.short 11 ## DW_FORM_data1 |
| 288 |
.long 0 ## Bucket 0 |
| 289 |
.long 1 ## Bucket 1 |
| 290 |
.long 193495088 ## Hash in Bucket 0 |
| 291 |
.long -1304652851 ## Hash in Bucket 1 |
| 292 |
.set Lset5, Ltypes1-Ltypes_begin ## Offset in Bucket 0 |
| 293 |
.long Lset5 |
| 294 |
.set Lset6, Ltypes0-Ltypes_begin ## Offset in Bucket 1 |
| 295 |
.long Lset6 |
| 296 |
Ltypes1: |
| 297 |
.long 77 ## int |
| 298 |
.long 1 ## Num DIEs |
| 299 |
.long 110 |
| 300 |
.short 36 |
| 301 |
.byte 0 |
| 302 |
.long 0 |
| 303 |
Ltypes0: |
| 304 |
.long 46 ## unsigned int |
| 305 |
.long 1 ## Num DIEs |
| 306 |
.long 63 |
| 307 |
.short 36 |
| 308 |
.byte 0 |
| 309 |
.long 0 |
| 310 |
|
| 311 |
.subsections_via_symbols |
| 312 |
.section __DWARF,__debug_line,regular,debug |
| 313 |
Lsection_line: |
| 314 |
Lline_table_start0: |