gdb/
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / dw2-icc-opaque.S
1 /* Copyright (C) 2011-2012 Free Software Foundation, Inc.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 3 of the License, or
6 (at your option) any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */
15
16 /* This test demonstrates a failure to resolve opaque structure types in
17 binaries compiled by the Intel C compiler. This is GDB PR symtab/13277.
18
19 The test was derived from opaque-pointer.c, which contains the single line:
20
21 struct opaque_struct_t *p_struct;
22
23 and opaque_struct.c, which looks like:
24
25 struct opaque_struct_t
26 {
27 int wrapped_value;
28 };
29
30 struct opaque_struct_t opaque_internal = { 0 };
31
32 What follows is a simplified version of the debug info generated by ICC
33 version 12.0.4.191. */
34
35 .file "opaque-pointer.c"
36 .data
37 .comm p_struct,8,8
38 .global p_struct#
39
40 .section .debug_info
41 .align 1
42 debug_info_seg1:
43 .4byte debug_info_seg1_end - 1f /* Length of compilation unit info. */
44 1:
45 .2byte 0x0002 /* DWARF version number. */
46 .4byte .debug_abbrev_seg1 /* Points to abbrev section for this unit. */
47 .byte 0x04 /* Target address size. */
48
49 .byte 0x01 /* DIE 1: DW_TAG_compile_unit. */
50 .byte 0x01 /* DW_AT_language = DW_LANG_C89. */
51 .ascii "Intel(R) C Intel(R) 64 Compiler XE " /* DW_AT_producer. */
52 .ascii "for applications running on Intel(R) 64, "
53 .ascii "Version 12.0.4.191 Build 20110427\n "
54 .asciz "Fixes SameLinkageName MemberPointers"
55
56 .byte 0x02 /* DIE 2: DW_TAG_variable. */
57 .byte 0x01 /* DW_AT_accessibility. */
58 .asciz "p_struct" /* DW_AT_name. */
59 .4byte 3f - debug_info_seg1 /* DW_AT_type. */
60 .2byte 0x0305 /* DW_AT_location: 5 bytes, DW_OP_addr */
61 .4byte p_struct /* followed by the address of p_struct. */
62 .byte 0x01 /* DW_AT_external. */
63
64 3:
65 .byte 0x03 /* DIE 3: DW_TAG_pointer_type. */
66 .4byte 4f - debug_info_seg1 /* DW_AT_type. */
67
68 4:
69 .byte 0x04 /* DIE 4: DW_TAG_structure_type. */
70 .byte 0x01 /* DW_AT_accessibility. */
71 .byte 0x00 /* DW_AT_byte_size. */
72 .asciz "opaque_struct_t" /* DW_AT_name. */
73
74 .byte 0x00 /* End DIE 1. */
75 debug_info_seg1_end:
76
77 .section .debug_abbrev
78 .debug_abbrev_seg1:
79 .align 1
80 .byte 0x01 /* Abbrev 1. */
81 .byte 0x11 /* DW_TAG_compile_unit. */
82 .byte 0x01 /* DW_CHILDREN_yes. */
83 .byte 0x13 /* DW_AT_language. */
84 .byte 0x0b /* DW_FORM_data1. */
85 .byte 0x25 /* DW_AT_producer. */
86 .byte 0x08 /* DW_AT_string. */
87 .2byte 0x0000 /* End abbrev. */
88
89 .byte 0x02 /* Abbrev 2. */
90 .byte 0x34 /* DW_TAG_variable. */
91 .byte 0x00 /* DW_CHILDREN_no. */
92 .byte 0x32 /* DW_AT_accessibility. */
93 .byte 0x0b /* DW_FORM_data1. */
94 .byte 0x03 /* DW_AT_name. */
95 .byte 0x08 /* DW_FORM_string. */
96 .byte 0x49 /* DW_AT_type. */
97 .byte 0x13 /* DW_FORM_ref4. */
98 .byte 0x02 /* DW_AT_location. */
99 .byte 0x0a /* DW_FORM_block1. */
100 .byte 0x3f /* DW_AT_external. */
101 .byte 0x0c /* DW_FORM_flag. */
102 .2byte 0x0000 /* End abbrev. */
103
104 .byte 0x03 /* Abbrev 3. */
105 .byte 0x0f /* DW_TAG_pointer_type. */
106 .byte 0x00 /* DW_CHILDREN_no. */
107 .byte 0x49 /* DW_AT_type. */
108 .byte 0x13 /* DW_FORM_ref4. */
109 .2byte 0x0000 /* End abbrev. */
110
111 .byte 0x04 /* Abbrev 4. */
112 .byte 0x13 /* DW_TAG_structure_type. */
113 .byte 0x00 /* DW_CHILDREN_no. */
114 .byte 0x32 /* DW_AT_accessibility. */
115 .byte 0x0b /* DW_FORM_data1. */
116 .byte 0x0b /* DW_AT_byte_size. */
117 .byte 0x0b /* DW_FORM_data1. */
118 .byte 0x03 /* DW_AT_name. */
119 .byte 0x08 /* DW_FORM_string. */
120 .2byte 0x0000 /* End abbrev. */
121 .byte 0x00 /* End abbrev table. */
122
123
124 .file "opaque-struct.c"
125 .section .debug_info
126 .align 1
127 debug_info_seg2:
128 .4byte debug_info_seg2_end - 1f /* Length of compilation unit info. */
129 1:
130 .2byte 0x0002 /* DWARF version number. */
131 .4byte .debug_abbrev_seg2 /* Points to abbrev section for this unit. */
132 .byte 0x04 /* Target address size. */
133
134 .byte 0x01 /* DIE 1: DW_TAG_compile_unit. */
135 .byte 0x01 /* DW_AT_language = DW_LANG_C89. */
136 .ascii "Intel(R) C Intel(R) 64 Compiler XE " /* DW_AT_producer. */
137 .ascii "for applications running on Intel(R) 64, "
138 .ascii "Version 12.0.4.191 Build 20110427\n "
139 .asciz "Fixes SameLinkageName MemberPointers"
140
141 .byte 0x02 /* DIE 2: DW_TAG_structure_type. */
142 .byte 0x01 /* DW_AT_accessibility. */
143 .byte 0x04 /* DW_AT_byte_size. */
144 .asciz "opaque_struct_t" /* DW_AT_name. */
145
146
147 .byte 0x03 /* DIE 3: DW_TAG_member. */
148 .2byte 0x2302 /* DW_AT_data_member_location, 2 bytes, */
149 .byte 0x00 /* DW_OP_plus_uconst followed by zero. */
150 .asciz "wrapped_value" /* DW_AT_name. */
151 .4byte 4f - debug_info_seg2 /* DW_AT_type. */
152 .byte 0x00
153
154 4:
155 .byte 0x04 /* DIE 4: DW_TAG_base_type. */
156 .byte 0x04 /* DW_AT_byte_size. */
157 .byte 0x05 /* DW_AT_encoding. */
158 .asciz "int" /* DW_AT_name. */
159
160 .byte 0x00 /* End DIE 1. */
161 debug_info_seg2_end:
162
163 .section .debug_abbrev
164 .debug_abbrev_seg2:
165 .align 1
166 .byte 0x01 /* Abbrev 1. */
167 .byte 0x11 /* DW_TAG_compile_unit. */
168 .byte 0x01 /* DW_CHILDREN_yes. */
169 .byte 0x13 /* DW_AT_language. */
170 .byte 0x0b /* DW_FORM_data1. */
171 .byte 0x25 /* DW_AT_producer. */
172 .byte 0x08 /* DW_FORM_string. */
173 .2byte 0x0000 /* End abbrev. */
174
175 .byte 0x02 /* Abbrev 2. */
176 .byte 0x13 /* DW_TAG_structure_type. */
177 .byte 0x01 /* DW_CHILDREN_yes. */
178 .byte 0x32 /* DW_AT_accessibility. */
179 .byte 0x0b /* DW_FORM_data1. */
180 .byte 0x0b /* DW_AT_byte_size. */
181 .byte 0x0b /* DW_FORM_data1. */
182 .byte 0x03 /* DW_AT_name. */
183 .byte 0x08 /* DW_FORM_string. */
184 .2byte 0x0000 /* End abbrev. */
185
186 .byte 0x03 /* Abbrev 3. */
187 .byte 0x0d /* DW_TAG_member. */
188 .byte 0x00 /* DW_CHILDREN_no. */
189 .byte 0x38 /* DW_AT_data_member_location. */
190 .byte 0x0a /* DW_FORM_block1. */
191 .byte 0x03 /* DW_AT_name. */
192 .byte 0x08 /* DW_FORM_string. */
193 .byte 0x49 /* DW_AT_type. */
194 .byte 0x13 /* DW_FORM_ref4. */
195 .2byte 0x0000 /* End abbrev. */
196
197 .byte 0x04 /* Abbrev 4. */
198 .byte 0x24 /* DW_TAG_base_type. */
199 .byte 0x00 /* DW_CHILDREN_no. */
200 .byte 0x0b /* DW_AT_byte_size. */
201 .byte 0x0b /* DW_FORM_data1. */
202 .byte 0x3e /* DW_AT_encoding. */
203 .byte 0x0b /* DW_FORM_data1. */
204 .byte 0x03 /* DW_AT_name. */
205 .byte 0x08 /* DW_FORM_string. */
206 .2byte 0x0000 /* End abbrev. */
207 .byte 0x00 /* End abbrev table. */
208
209
210 .file "opaque-pointer2.c"
211
212 .section .debug_info
213 .align 1
214 debug_info_seg3:
215 .4byte debug_info_seg3_end - 1f /* Length of compilation unit info. */
216 1:
217 .2byte 0x0002 /* DWARF version number. */
218 .4byte .debug_abbrev_seg3 /* Points to abbrev section for this unit. */
219 .byte 0x04 /* Target address size. */
220
221 .byte 0x01 /* DIE 1: DW_TAG_compile_unit. */
222 .byte 0x01 /* DW_AT_language = DW_LANG_C89. */
223 .ascii "Intel(R) C Intel(R) 64 Compiler XE " /* DW_AT_producer. */
224 .ascii "for applications running on Intel(R) 64, "
225 .ascii "Version 12.0.4.191 Build 20110427\n "
226 .asciz "Fixes SameLinkageName MemberPointers"
227
228 .byte 0x04 /* DIE 4: DW_TAG_structure_type. */
229 .byte 0x01 /* DW_AT_accessibility. */
230 .byte 0x00 /* DW_AT_byte_size. */
231 .asciz "opaque_struct_t" /* DW_AT_name. */
232
233 .byte 0x00 /* End DIE 1. */
234 debug_info_seg3_end:
235
236 .section .debug_abbrev
237 .debug_abbrev_seg3:
238 .align 1
239 .byte 0x01 /* Abbrev 1. */
240 .byte 0x11 /* DW_TAG_compile_unit. */
241 .byte 0x01 /* DW_CHILDREN_yes. */
242 .byte 0x13 /* DW_AT_language. */
243 .byte 0x0b /* DW_FORM_data1. */
244 .byte 0x25 /* DW_AT_producer. */
245 .byte 0x08 /* DW_AT_string. */
246 .2byte 0x0000 /* End abbrev. */
247
248 .byte 0x04 /* Abbrev 4. */
249 .byte 0x13 /* DW_TAG_structure_type. */
250 .byte 0x00 /* DW_CHILDREN_no. */
251 .byte 0x32 /* DW_AT_accessibility. */
252 .byte 0x0b /* DW_FORM_data1. */
253 .byte 0x0b /* DW_AT_byte_size. */
254 .byte 0x0b /* DW_FORM_data1. */
255 .byte 0x03 /* DW_AT_name. */
256 .byte 0x08 /* DW_FORM_string. */
257 .2byte 0x0000 /* End abbrev. */
258 .byte 0x00 /* End abbrev table. */
This page took 0.056046 seconds and 4 git commands to generate.