dwarfdump-str-offsets-v4-dwarf64-dwp.s
5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
## This tests dumping a .debug_str_offsets.dwo section in a DWP file when it is
## referenced by units in different formats: one unit is DWARF32 and another
## is DWARF64, thus the .debug_str_offsets.dwo section has contributions with
## different sizes of offsets.
## This also checks that attributes in the units which use the DW_FORM_strx form
## are dumped correctly.
# RUN: llvm-mc -triple x86_64 %s -filetype=obj -o - | \
# RUN: llvm-dwarfdump -v - | \
# RUN: FileCheck %s
# CHECK: .debug_info.dwo contents:
# CHECK: Compile Unit:
# CHECK: DW_TAG_compile_unit [1]
# CHECK-NEXT: DW_AT_producer [DW_FORM_strx] (indexed (00000000) string = "CU0 Producer")
# CHECK-NEXT: DW_AT_name [DW_FORM_strx] (indexed (00000001) string = "CU0 Name")
# CHECK: Compile Unit:
# CHECK: DW_TAG_compile_unit [1]
# CHECK-NEXT: DW_AT_producer [DW_FORM_strx] (indexed (00000000) string = "CU1 Producer")
# CHECK-NEXT: DW_AT_name [DW_FORM_strx] (indexed (00000001) string = "CU1 Name")
# CHECK: .debug_str.dwo contents:
# CHECK-NEXT: 0x00000000: "CU0 Producer"
# CHECK-NEXT: 0x0000000d: "CU0 Name"
# CHECK-NEXT: 0x00000016: "CU1 Producer"
# CHECK-NEXT: 0x00000023: "CU1 Name"
# CHECK: .debug_str_offsets.dwo contents:
# CHECK-NEXT: 0x00000000: Contribution size = 8, Format = DWARF32, Version = 4
# CHECK-NEXT: 0x00000000: 00000000 "CU0 Producer"
# CHECK-NEXT: 0x00000004: 0000000d "CU0 Name"
# CHECK-NEXT: 0x00000008: Contribution size = 16, Format = DWARF64, Version = 4
# CHECK-NEXT: 0x00000008: 0000000000000016 "CU1 Producer"
# CHECK-NEXT: 0x00000010: 0000000000000023 "CU1 Name"
.section .debug_str.dwo, "MSe", @progbits, 1
.LStr0:
.asciz "CU0 Producer"
.LStr1:
.asciz "CU0 Name"
.LStr2:
.asciz "CU1 Producer"
.LStr3:
.asciz "CU1 Name"
.section .debug_str_offsets.dwo, "e", @progbits
## The contribution of CU0 (DWARF32)
.LSO0:
.long .LStr0-.debug_str.dwo # 0: "CU0 Producer"
.long .LStr1-.debug_str.dwo # 1: "CU0 Name"
.LSO0End:
## The contribution of CU1 (DWARF64)
.LSO1:
.quad .LStr2-.debug_str.dwo # 0: "CU1 Producer"
.quad .LStr3-.debug_str.dwo # 1: "CU1 Name"
.LSO1End:
.section .debug_abbrev.dwo, "e", @progbits
## For simplicity and to make the test shorter, both compilation units share
## the same abbreviations table.
.LAbbr:
.uleb128 0x01 # Abbrev code
.uleb128 0x11 # DW_TAG_compile_unit
.byte 0x00 # DW_CHILDREN_no
.uleb128 0x25 # DW_AT_producer
.uleb128 0x1a # DW_FORM_strx
.uleb128 0x03 # DW_AT_name
.uleb128 0x1a # DW_FORM_strx
.uleb128 0x2131 # DW_AT_GNU_dwo_id
.uleb128 0x07 # DW_FORM_data8
.byte 0x00 # EOM(1)
.byte 0x00 # EOM(2)
.byte 0x00 # EOM(3)
.LAbbrEnd:
.section .debug_info.dwo, "e", @progbits
## CU0 uses the 32-bit DWARF format.
.LCU0:
.long .LCU0End-.LCU0Ver # Length
.LCU0Ver:
.short 4 # Version
.long 0 # Abbrev. offset
.byte 8 # Address size
.uleb128 1 # Abbrev [1] DW_TAG_compile_unit
.uleb128 0 # DW_AT_producer ("CU0 Producer")
.uleb128 1 # DW_AT_name ("CU0 Name")
.quad 0x1100001122222222 # DW_AT_GNU_dwo_id
.LCU0End:
## CU1 uses the 64-bit DWARF format.
.LCU1:
.long 0xffffffff # DWARF64 mark
.quad .LCU1End-.LCU1Ver # Length
.LCU1Ver:
.short 4 # Version
.quad 0 # Abbrev. offset
.byte 8 # Address size
.uleb128 1 # Abbrev [1] DW_TAG_compile_unit
.uleb128 0 # DW_AT_producer ("CU1 Producer")
.uleb128 1 # DW_AT_name ("CU1 Name")
.quad 0x1100001133333333 # DW_AT_GNU_dwo_id
.LCU1End:
.section .debug_cu_index, "", @progbits
## Header:
.long 2 # Version
.long 3 # Section count
.long 2 # Unit count
.long 4 # Slot count
## Hash Table of Signatures:
.quad 0
.quad 0
.quad 0x1100001122222222 # DWO Id of CU0
.quad 0x1100001133333333 # DWO Id of CU1
## Parallel Table of Indexes:
.long 0
.long 0
.long 1
.long 2
## Table of Section Offsets:
## Row 0:
.long 1 # DW_SECT_INFO
.long 3 # DW_SECT_ABBREV
.long 6 # DW_SECT_STR_OFFSETS
## Row 1, offsets of contributions of CU0:
.long .LCU0-.debug_info.dwo
.long .LAbbr-.debug_abbrev.dwo
.long .LSO0-.debug_str_offsets.dwo
## Row 2, offsets of contributions of CU1:
.long .LCU1-.debug_info.dwo
.long .LAbbr-.debug_abbrev.dwo
.long .LSO1-.debug_str_offsets.dwo
## Table of Section Sizes:
## Row 1, sizes of contributions of CU0:
.long .LCU0End-.LCU0
.long .LAbbrEnd-.LAbbr
.long .LSO0End-.LSO0
## Row 2, sizes of contributions of CU1:
.long .LCU1End-.LCU1
.long .LAbbrEnd-.LAbbr
.long .LSO1End-.LSO1