141 lines · plain
1## This tests dumping a .debug_str_offsets.dwo section in a DWP file when it is2## referenced by units in different formats: one unit is DWARF32 and another3## is DWARF64, thus the .debug_str_offsets.dwo section has contributions with4## different sizes of offsets.5## This also checks that attributes in the units which use the DW_FORM_strx form6## are dumped correctly.7 8# RUN: llvm-mc -triple x86_64 %s -filetype=obj -o - | \9# RUN: llvm-dwarfdump -v - | \10# RUN: FileCheck %s11 12# CHECK: .debug_info.dwo contents:13# CHECK: Compile Unit:14# CHECK: DW_TAG_compile_unit [1]15# CHECK-NEXT: DW_AT_producer [DW_FORM_strx] (indexed (00000000) string = "CU0 Producer")16# CHECK-NEXT: DW_AT_name [DW_FORM_strx] (indexed (00000001) string = "CU0 Name")17# CHECK: Compile Unit:18# CHECK: DW_TAG_compile_unit [1]19# CHECK-NEXT: DW_AT_producer [DW_FORM_strx] (indexed (00000000) string = "CU1 Producer")20# CHECK-NEXT: DW_AT_name [DW_FORM_strx] (indexed (00000001) string = "CU1 Name")21 22# CHECK: .debug_str.dwo contents:23# CHECK-NEXT: 0x00000000: "CU0 Producer"24# CHECK-NEXT: 0x0000000d: "CU0 Name"25# CHECK-NEXT: 0x00000016: "CU1 Producer"26# CHECK-NEXT: 0x00000023: "CU1 Name"27 28# CHECK: .debug_str_offsets.dwo contents:29# CHECK-NEXT: 0x00000000: Contribution size = 8, Format = DWARF32, Version = 430# CHECK-NEXT: 0x00000000: 00000000 "CU0 Producer"31# CHECK-NEXT: 0x00000004: 0000000d "CU0 Name"32# CHECK-NEXT: 0x00000008: Contribution size = 16, Format = DWARF64, Version = 433# CHECK-NEXT: 0x00000008: 0000000000000016 "CU1 Producer"34# CHECK-NEXT: 0x00000010: 0000000000000023 "CU1 Name"35 36 .section .debug_str.dwo, "MSe", @progbits, 137.LStr0:38 .asciz "CU0 Producer"39.LStr1:40 .asciz "CU0 Name"41.LStr2:42 .asciz "CU1 Producer"43.LStr3:44 .asciz "CU1 Name"45 46 .section .debug_str_offsets.dwo, "e", @progbits47## The contribution of CU0 (DWARF32)48.LSO0:49 .long .LStr0-.debug_str.dwo # 0: "CU0 Producer"50 .long .LStr1-.debug_str.dwo # 1: "CU0 Name"51.LSO0End:52## The contribution of CU1 (DWARF64)53.LSO1:54 .quad .LStr2-.debug_str.dwo # 0: "CU1 Producer"55 .quad .LStr3-.debug_str.dwo # 1: "CU1 Name"56.LSO1End:57 58 .section .debug_abbrev.dwo, "e", @progbits59## For simplicity and to make the test shorter, both compilation units share60## the same abbreviations table.61.LAbbr:62 .uleb128 0x01 # Abbrev code63 .uleb128 0x11 # DW_TAG_compile_unit64 .byte 0x00 # DW_CHILDREN_no65 .uleb128 0x25 # DW_AT_producer66 .uleb128 0x1a # DW_FORM_strx67 .uleb128 0x03 # DW_AT_name68 .uleb128 0x1a # DW_FORM_strx69 .uleb128 0x2131 # DW_AT_GNU_dwo_id70 .uleb128 0x07 # DW_FORM_data871 .byte 0x00 # EOM(1)72 .byte 0x00 # EOM(2)73 .byte 0x00 # EOM(3)74.LAbbrEnd:75 76 .section .debug_info.dwo, "e", @progbits77## CU0 uses the 32-bit DWARF format.78.LCU0:79 .long .LCU0End-.LCU0Ver # Length80.LCU0Ver:81 .short 4 # Version82 .long 0 # Abbrev. offset83 .byte 8 # Address size84 .uleb128 1 # Abbrev [1] DW_TAG_compile_unit85 .uleb128 0 # DW_AT_producer ("CU0 Producer")86 .uleb128 1 # DW_AT_name ("CU0 Name")87 .quad 0x1100001122222222 # DW_AT_GNU_dwo_id88.LCU0End:89## CU1 uses the 64-bit DWARF format.90.LCU1:91 .long 0xffffffff # DWARF64 mark92 .quad .LCU1End-.LCU1Ver # Length93.LCU1Ver:94 .short 4 # Version95 .quad 0 # Abbrev. offset96 .byte 8 # Address size97 .uleb128 1 # Abbrev [1] DW_TAG_compile_unit98 .uleb128 0 # DW_AT_producer ("CU1 Producer")99 .uleb128 1 # DW_AT_name ("CU1 Name")100 .quad 0x1100001133333333 # DW_AT_GNU_dwo_id101.LCU1End:102 103 .section .debug_cu_index, "", @progbits104## Header:105 .long 2 # Version106 .long 3 # Section count107 .long 2 # Unit count108 .long 4 # Slot count109## Hash Table of Signatures:110 .quad 0111 .quad 0112 .quad 0x1100001122222222 # DWO Id of CU0113 .quad 0x1100001133333333 # DWO Id of CU1114## Parallel Table of Indexes:115 .long 0116 .long 0117 .long 1118 .long 2119## Table of Section Offsets:120## Row 0:121 .long 1 # DW_SECT_INFO122 .long 3 # DW_SECT_ABBREV123 .long 6 # DW_SECT_STR_OFFSETS124## Row 1, offsets of contributions of CU0:125 .long .LCU0-.debug_info.dwo126 .long .LAbbr-.debug_abbrev.dwo127 .long .LSO0-.debug_str_offsets.dwo128## Row 2, offsets of contributions of CU1:129 .long .LCU1-.debug_info.dwo130 .long .LAbbr-.debug_abbrev.dwo131 .long .LSO1-.debug_str_offsets.dwo132## Table of Section Sizes:133## Row 1, sizes of contributions of CU0:134 .long .LCU0End-.LCU0135 .long .LAbbrEnd-.LAbbr136 .long .LSO0End-.LSO0137## Row 2, sizes of contributions of CU1:138 .long .LCU1End-.LCU1139 .long .LAbbrEnd-.LAbbr140 .long .LSO1End-.LSO1141