213 lines · yaml
1# This test verifies that: if a DW_TAG_compile_unit has children not having2# ranges then llvm-dwarfdump still correctly verifies other dies with normal3# ranges.4#5# The DWARF looks like:6# 0x0000000b: DW_TAG_compile_unit7# DW_AT_name ("/tmp/main.c")8# DW_AT_language (DW_LANG_C)9# DW_AT_low_pc (0x0000000000000000)10# DW_AT_ranges (0x0000000011# [0x0000000000002000, 0x0000000000003000)12# [0x0000000000001000, 0x0000000000002000))13#14# 0x0000001e: DW_TAG_subprogram15# DW_AT_name ("no_range1")16#17# 0x00000044: DW_TAG_subprogram18# DW_AT_name ("main")19# DW_AT_low_pc (0x0000000000001000)20# DW_AT_high_pc (0x0000000000002000)21#22# 0x00000055: DW_TAG_subprogram23# DW_AT_name ("foo")24# DW_AT_low_pc (0x0000000000002000)25# DW_AT_high_pc (0x0000000000003000)26#27# # 0x0000001e: DW_TAG_subprogram28# DW_AT_name ("no_range2")29#30# 0x00000066: NULL31 32# RUN: yaml2obj %s | llvm-dwarfdump --verify - | FileCheck %s33 34# CHECK: Verifying -: file format Mach-O 64-bit x86-6435# CHECK: Verifying .debug_abbrev...36# CHECK: Verifying .debug_info Unit Header Chain...37# CHECK: No errors.38 39--- !mach-o40FileHeader:41 magic: 0xFEEDFACF42 cputype: 0x0100000743 cpusubtype: 0x0000000344 filetype: 0x0000000145 ncmds: 446 sizeofcmds: 46447 flags: 0x0000200048 reserved: 0x0000000049LoadCommands:50 - cmd: LC_SEGMENT_6451 cmdsize: 39252 segname: ''53 vmaddr: 054 vmsize: 26155 fileoff: 52856 filesize: 26157 maxprot: 758 initprot: 759 nsects: 460 flags: 061 Sections:62 - sectname: __debug_abbrev63 segname: __DWARF64 addr: 0x000000000000000065 size: 3666 offset: 0x0000021067 align: 068 reloff: 0x0000000069 nreloc: 070 flags: 0x0000000071 reserved1: 0x0000000072 reserved2: 0x0000000073 reserved3: 0x0000000074 - sectname: __debug_info75 segname: __DWARF76 addr: 0x000000000000002477 size: 7578 offset: 0x0000023479 align: 080 reloff: 0x0000000081 nreloc: 082 flags: 0x0000000083 reserved1: 0x0000000084 reserved2: 0x0000000085 reserved3: 0x0000000086 - sectname: __debug_ranges87 segname: __DWARF88 addr: 0x000000000000008B89 size: 4890 offset: 0x0000029B91 align: 092 reloff: 0x0000000093 nreloc: 094 flags: 0x0000000095 reserved1: 0x0000000096 reserved2: 0x0000000097 reserved3: 0x0000000098 - sectname: __debug_str99 segname: __DWARF100 addr: 0x00000000000000DB101 size: 42102 offset: 0x000002EB103 align: 0104 reloff: 0x00000000105 nreloc: 0106 flags: 0x00000000107 reserved1: 0x00000000108 reserved2: 0x00000000109 reserved3: 0x00000000110 - cmd: LC_SYMTAB111 cmdsize: 24112 symoff: 0113 nsyms: 0114 stroff: 792115 strsize: 8116 - cmd: LC_BUILD_VERSION117 cmdsize: 32118 platform: 1119 minos: 658944120 sdk: 658944121 ntools: 1122 Tools:123 - tool: 3124 version: 34734080125 - cmd: LC_DATA_IN_CODE126 cmdsize: 16127 dataoff: 792128 datasize: 0129LinkEditData:130 StringTable:131 - ' '132 - ''133 - ''134 - ''135 - ''136 - ''137 - ''138DWARF:139 debug_str:140 - ''141 - '/tmp/main.c'142 - no_range1143 - no_range2144 - main145 - foo146 debug_abbrev:147 - Table:148 - Code: 0x00000001149 Tag: DW_TAG_compile_unit150 Children: DW_CHILDREN_yes151 Attributes:152 - Attribute: DW_AT_name153 Form: DW_FORM_strp154 - Attribute: DW_AT_language155 Form: DW_FORM_data2156 - Attribute: DW_AT_low_pc157 Form: DW_FORM_addr158 - Attribute: DW_AT_ranges159 Form: DW_FORM_sec_offset160 - Code: 0x00000002161 Tag: DW_TAG_subprogram162 Children: DW_CHILDREN_no163 Attributes:164 - Attribute: DW_AT_name165 Form: DW_FORM_strp166 - Attribute: DW_AT_low_pc167 Form: DW_FORM_addr168 - Attribute: DW_AT_high_pc169 Form: DW_FORM_data4170 - Code: 0x00000003171 Tag: DW_TAG_subprogram172 Children: DW_CHILDREN_no173 Attributes:174 - Attribute: DW_AT_name175 Form: DW_FORM_strp176 177 debug_ranges:178 - Offset: 0x00000000179 AddrSize: 0x08180 Entries:181 - LowOffset: 0x0000000000002000182 HighOffset: 0x0000000000003000183 - LowOffset: 0x0000000000001000184 HighOffset: 0x0000000000002000185 debug_info:186 - Version: 4187 AddrSize: 8188 Entries:189 - AbbrCode: 0x00000001190 Values:191 - Value: 0x0000000000000001192 - Value: 0x0000000000000002193 - Value: 0x0000000000000000194 - Value: 0x0000000000000000195 - AbbrCode: 0x00000003196 Values:197 - Value: 0x000000000000000D198 - AbbrCode: 0x00000002199 Values:200 - Value: 0x0000000000000021201 - Value: 0x0000000000001000202 - Value: 0x0000000000001000203 - AbbrCode: 0x00000002204 Values:205 - Value: 0x0000000000000026206 - Value: 0x0000000000002000207 - Value: 0x0000000000001000208 - AbbrCode: 0x00000003209 Values:210 - Value: 0x0000000000000017211 - AbbrCode: 0x00000000212...213