brintos

brintos / llvm-project-archived public Read only

0
0
Text · 7.9 KiB · cfe7058 Raw
285 lines · plain
1## This test checks handling of DWARFv5 address attribute.2## It contains two compile units. One is a good one and3## should be processed correctly. Second is a bad - it 4## missing DW_AT_addr_base attribute. All address attributes5## inside this unit should be skipped. 6 7# RUN: yaml2obj %s -o %t.o8# RUN: echo '---' > %t2.map9# RUN: echo "triple:          'x86_64-apple-darwin'" >> %t2.map10# RUN: echo 'objects:'  >> %t2.map11# RUN: echo " -  filename: '%t.o'" >> %t2.map12# RUN: echo '    symbols:' >> %t2.map13# RUN: echo '      - { sym: __Z3foov, objAddr: 0x0, binAddr: 0x10000, size: 0x10 }' >> %t2.map14# RUN: echo '...' >> %t2.map15# RUN: dsymutil -y %t2.map -f -o - | llvm-dwarfdump -a - | FileCheck %s16 17# CHECK: file format Mach-O 64-bit x86-6418# CHECK: .debug_info contents:19# CHECK: Compile Unit:20# CHECK: DW_TAG_compile_unit21# CHECK: DW_AT_name{{.*}}"GoodCU"22# CHECK: DW_AT_low_pc23# CHECK: DW_TAG_subprogram24# CHECK: DW_AT_name{{.*}}"foo"25# CHECK: DW_TAG_variable26# CHECK: DW_AT_name{{.*}}"var1"27# CHECK: DW_AT_location        (DW_OP_addr28# CHECK: 0x00000043:   NULL29# CHECK: Compile Unit:30# CHECK: DW_TAG_compile_unit31# CHECK-NOT: DW_AT_low_pc32# CHECK: DW_AT_name{{.*}}"BadCU"33# CHECK-NOT: DW_TAG_subprogram34# CHECK-NOT: DW_TAG_variable35# CHECK: 0x0000005b:   NULL36 37--- !mach-o38FileHeader:39  magic:      0xFEEDFACF40  cputype:    0x0100000741  cpusubtype: 0x0000000342  filetype:   0x0000000143  ncmds:      244  sizeofcmds: 47245  flags:      0x0000200046  reserved:   0x0000000047LoadCommands:48  - cmd:      LC_SEGMENT_6449    cmdsize:  31250    segname:  ''51    vmaddr:   0x0052    vmsize:   0x30053    fileoff:  0x30054    filesize: 0x30055    maxprot:  756    initprot: 757    nsects:   358    flags:    059    Sections:60      - sectname:  __debug_abbrev61        segname:   __DWARF62        addr:      0x000000000000000F63        size:      0x6064        offset:    0x0000021065        align:     066        reloff:    0x0000000067        nreloc:    068        flags:     0x0000000069        reserved1: 0x0000000070        reserved2: 0x0000000071        reserved3: 0x0000000072      - sectname:  __debug_info73        segname:   __DWARF74        addr:      0x00000000000010075        size:      0x9e76        offset:    0x0000031077        align:     078        reloff:    0x0000000079        nreloc:    080        flags:     0x0000000081        reserved1: 0x0000000082        reserved2: 0x0000000083        reserved3: 0x0000000084      - sectname:  __debug_addr85        segname:   __DWARF86        addr:      0x000000000000020087        size:      0x3088        offset:    0x0000040089        align:     090        reloff:    0x0000060091        nreloc:    292        flags:     0x0200000093        reserved1: 0x0000000094        reserved2: 0x0000000095        reserved3: 0x0000000096        relocations:97          - address:         0x898            symbolnum:       199            pcrel:           true100            length:          3101            extern:          true102            type:            0103            scattered:       false104            value:           0105          - address:         0x1c106            symbolnum:       1107            pcrel:           true108            length:          3109            extern:          true110            type:            0111            scattered:       false112            value:           0113  - cmd:             LC_SYMTAB114    cmdsize:         24115    symoff:          0x700116    nsyms:           2117    stroff:          0x720118    strsize:         10119LinkEditData:120  NameList:121    - n_strx:          1122      n_type:          0x0F123      n_sect:          1124      n_desc:          0125      n_value:         0126    - n_strx:          1127      n_type:          0x0F128      n_sect:          1129      n_desc:          0130      n_value:         0131  StringTable:132    - ''133    - '__Z3foov'134    - ''135DWARF:136  debug_abbrev:137    - Table:138      - Tag:      DW_TAG_compile_unit139        Children: DW_CHILDREN_yes140        Attributes:141          - Attribute: DW_AT_producer142            Form:      DW_FORM_string143          - Attribute: DW_AT_language144            Form:      DW_FORM_data2145          - Attribute: DW_AT_name146            Form:      DW_FORM_string147          - Attribute: DW_AT_low_pc148            Form:      DW_FORM_addrx149          - Attribute: DW_AT_high_pc150            Form:      DW_FORM_data8151          - Attribute: DW_AT_addr_base152            Form:      DW_FORM_sec_offset153      - Tag:      DW_TAG_subprogram154        Children: DW_CHILDREN_yes155        Attributes:156          - Attribute: DW_AT_name157            Form:      DW_FORM_string158          - Attribute: DW_AT_low_pc159            Form:      DW_FORM_addrx160          - Attribute: DW_AT_high_pc161            Form:      DW_FORM_data8162          - Attribute: DW_AT_type163            Form:      DW_FORM_ref4164      - Tag:      DW_TAG_base_type165        Children: DW_CHILDREN_no166        Attributes:167          - Attribute: DW_AT_name168            Form:      DW_FORM_string169      - Tag:      DW_TAG_variable170        Children: DW_CHILDREN_no171        Attributes:172          - Attribute: DW_AT_name173            Form:      DW_FORM_string174          - Attribute: DW_AT_type175            Form:      DW_FORM_ref4176          - Attribute: DW_AT_location177            Form:      DW_FORM_exprloc178    - Table:179      - Tag:      DW_TAG_compile_unit180        Children: DW_CHILDREN_yes181        Attributes:182          - Attribute: DW_AT_producer183            Form:      DW_FORM_string184          - Attribute: DW_AT_language185            Form:      DW_FORM_data2186          - Attribute: DW_AT_name187            Form:      DW_FORM_string188          - Attribute: DW_AT_low_pc189            Form:      DW_FORM_addrx190          - Attribute: DW_AT_high_pc191            Form:      DW_FORM_data8192      - Tag:      DW_TAG_subprogram193        Children: DW_CHILDREN_yes194        Attributes:195          - Attribute: DW_AT_name196            Form:      DW_FORM_string197          - Attribute: DW_AT_low_pc198            Form:      DW_FORM_addrx199          - Attribute: DW_AT_high_pc200            Form:      DW_FORM_data8201          - Attribute: DW_AT_type202            Form:      DW_FORM_ref4203      - Tag:      DW_TAG_base_type204        Children: DW_CHILDREN_no205        Attributes:206          - Attribute: DW_AT_name207            Form:      DW_FORM_string208      - Tag:      DW_TAG_variable209        Children: DW_CHILDREN_no210        Attributes:211          - Attribute: DW_AT_name212            Form:      DW_FORM_string213          - Attribute: DW_AT_type214            Form:      DW_FORM_ref4215          - Attribute: DW_AT_location216            Form:      DW_FORM_exprloc217  debug_info:218    - Version: 5219      UnitType:   DW_UT_compile220      Entries:221        - AbbrCode: 1222          Values:223            - CStr: by_hand224            - Value:  0x04225            - CStr: GoodCU 226            - Value:  0x0227            - Value:  0x10228            - Value:  0x8229        - AbbrCode: 2230          Values:231            - CStr: foo232            - Value: 0x0233            - Value: 0x10234            - Value: 0x3e235        - AbbrCode: 0236        - AbbrCode: 3237          Values:238            - CStr: int239        - AbbrCode: 4240          Values:241            - CStr: var1242            - Value:  0x0000003e243            - BlockData:244                - 0xa1245                - 0x00246        - AbbrCode: 0247    - Version: 5248      UnitType:   DW_UT_compile249      Entries:250        - AbbrCode: 1251          Values:252            - CStr: by_hand253            - Value:  0x04254            - CStr: BadCU255            - Value:  0x0256            - Value:  0x10257        - AbbrCode: 2258          Values:259            - CStr: foo1260            - Value: 0x0261            - Value: 0x10262            - Value: 0x3e263        - AbbrCode: 0264        - AbbrCode: 3265          Values:266            - CStr: int267        - AbbrCode: 4268          Values:269            - CStr: var1270            - Value:  0x0000003e271            - BlockData:272                - 0xa1273                - 0x00274        - AbbrCode: 0275  debug_addr:276    - Version: 5277      AddressSize: 0x08278      Entries:279        - Address: 0x1130280    - Version: 5281      AddressSize: 0x08282      Entries:283        - Address: 0x10284...285