1 ## This tests dumping a .debug_str_offsets.dwo section in a DWP file when it is
2 ## referenced by units in different formats: one unit is DWARF32 and another
3 ## is DWARF64, thus the .debug_str_offsets.dwo section has contributions with
4 ## different sizes of offsets.
5 ## This also checks that attributes in the units which use the DW_FORM_strx form
6 ## are dumped correctly.
8 # RUN: llvm-mc -triple x86_64 %s -filetype=obj -o - | \
9 # RUN: llvm-dwarfdump -v - | \
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")
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"
28 # CHECK: .debug_str_offsets.dwo contents:
29 # CHECK-NEXT: 0x00000000: Contribution size = 8, Format = DWARF32, Version = 4
30 # CHECK-NEXT: 0x00000000: 00000000 "CU0 Producer"
31 # CHECK-NEXT: 0x00000004: 0000000d "CU0 Name"
32 # CHECK-NEXT: 0x00000008: Contribution size = 16, Format = DWARF64, Version = 4
33 # CHECK-NEXT: 0x00000008: 0000000000000016 "CU1 Producer"
34 # CHECK-NEXT: 0x00000010: 0000000000000023 "CU1 Name"
36 .section .debug_str.dwo, "MSe", @progbits, 1
46 .section .debug_str_offsets.dwo, "e", @progbits
47 ## The contribution of CU0 (DWARF32)
49 .long .LStr0-.debug_str.dwo # 0: "CU0 Producer"
50 .long .LStr1-.debug_str.dwo # 1: "CU0 Name"
52 ## The contribution of CU1 (DWARF64)
54 .quad .LStr2-.debug_str.dwo # 0: "CU1 Producer"
55 .quad .LStr3-.debug_str.dwo # 1: "CU1 Name"
58 .section .debug_abbrev.dwo, "e", @progbits
59 ## For simplicity and to make the test shorter, both compilation units share
60 ## the same abbreviations table.
62 .uleb128 0x01 # Abbrev code
63 .uleb128 0x11 # DW_TAG_compile_unit
64 .byte 0x00 # DW_CHILDREN_no
65 .uleb128 0x25 # DW_AT_producer
66 .uleb128 0x1a # DW_FORM_strx
67 .uleb128 0x03 # DW_AT_name
68 .uleb128 0x1a # DW_FORM_strx
69 .uleb128 0x2131 # DW_AT_GNU_dwo_id
70 .uleb128 0x07 # DW_FORM_data8
76 .section .debug_info.dwo, "e", @progbits
77 ## CU0 uses the 32-bit DWARF format.
79 .long .LCU0End-.LCU0Ver # Length
82 .long 0 # Abbrev. offset
83 .byte 8 # Address size
84 .uleb128 1 # Abbrev [1] DW_TAG_compile_unit
85 .uleb128 0 # DW_AT_producer ("CU0 Producer")
86 .uleb128 1 # DW_AT_name ("CU0 Name")
87 .quad 0x1100001122222222 # DW_AT_GNU_dwo_id
89 ## CU1 uses the 64-bit DWARF format.
91 .long 0xffffffff # DWARF64 mark
92 .quad .LCU1End-.LCU1Ver # Length
95 .quad 0 # Abbrev. offset
96 .byte 8 # Address size
97 .uleb128 1 # Abbrev [1] DW_TAG_compile_unit
98 .uleb128 0 # DW_AT_producer ("CU1 Producer")
99 .uleb128 1 # DW_AT_name ("CU1 Name")
100 .quad 0x1100001133333333 # DW_AT_GNU_dwo_id
103 .section .debug_cu_index, "", @progbits
106 .long 3 # Section count
109 ## Hash Table of Signatures:
112 .quad 0x1100001122222222 # DWO Id of CU0
113 .quad 0x1100001133333333 # DWO Id of CU1
114 ## Parallel Table of Indexes:
119 ## Table of Section Offsets:
121 .long 1 # DW_SECT_INFO
122 .long 3 # DW_SECT_ABBREV
123 .long 6 # DW_SECT_STR_OFFSETS
124 ## Row 1, offsets of contributions of CU0:
125 .long .LCU0-.debug_info.dwo
126 .long .LAbbr-.debug_abbrev.dwo
127 .long .LSO0-.debug_str_offsets.dwo
128 ## Row 2, offsets of contributions of CU1:
129 .long .LCU1-.debug_info.dwo
130 .long .LAbbr-.debug_abbrev.dwo
131 .long .LSO1-.debug_str_offsets.dwo
132 ## Table of Section Sizes:
133 ## Row 1, sizes of contributions of CU0:
135 .long .LAbbrEnd-.LAbbr
137 ## Row 2, sizes of contributions of CU1:
139 .long .LAbbrEnd-.LAbbr