]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S
update copyright year range in GDB files
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / dw2-skip-prologue.S
CommitLineData
8be455d7
JK
1/* This testcase is part of GDB, the GNU debugger.
2
61baf725 3 Copyright 2011-2017 Free Software Foundation, Inc.
8be455d7
JK
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
2abf49e1
MR
18#if PTRBITS == 64
19# define PTRBYTE .8byte
20#elif PTRBITS == 32
21# define PTRBYTE .4byte
22#else
23# error "Unsupported pointer size"
24#endif
25
8be455d7
JK
26 .section .debug_info
27.Lcu1_begin:
28 /* CU header */
29 .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
30.Lcu1_start:
31 .2byte 2 /* DWARF Version */
32 .4byte .Labbrev1_begin /* Offset into abbrev section */
2abf49e1 33 .byte PTRBITS / 8 /* Pointer size */
8be455d7
JK
34
35 /* CU die */
36 .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
37 .4byte .Lline1_begin /* DW_AT_stmt_list */
2abf49e1
MR
38 PTRBYTE func_start /* DW_AT_low_pc */
39 PTRBYTE func_end /* DW_AT_high_pc */
8be455d7 40 .ascii "main.c\0" /* DW_AT_name */
ab260dad 41 .ascii "GNU C 4.5.0\0" /* DW_AT_producer must be >= 4.5 */
8be455d7
JK
42 .byte 2 /* DW_AT_language (DW_LANG_C) */
43
44 .uleb128 2 /* Abbrev: DW_TAG_subprogram */
45 .byte 1 /* DW_AT_external */
46 .ascii "func\0" /* DW_AT_name */
47 .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
2abf49e1
MR
48 PTRBYTE func_start /* DW_AT_low_pc */
49 PTRBYTE func_end /* DW_AT_high_pc */
8be455d7
JK
50
51/* GDB `has_loclist' detection of -O2 -g code needs to see a DW_AT_location
52 location list. There may exist -O2 -g CUs still not needing/using any such
53 location list - exactly like this CU. Make one up. */
54
55 .uleb128 0x7 /* (DIE (0x42) DW_TAG_formal_parameter) */
56 .ascii "param\0" /* DW_AT_name */
856d06f9
TS
57 .4byte .Ltype_int - .Lcu1_begin /* DW_AT_type */
58 .4byte loclist /* DW_AT_location */
8be455d7
JK
59
60 .uleb128 4 /* Abbrev: DW_TAG_inlined_subroutine */
61 .ascii "inlined\0" /* DW_AT_name */
2abf49e1
MR
62 PTRBYTE func0 /* DW_AT_low_pc */
63 PTRBYTE func1 /* DW_AT_high_pc */
8be455d7
JK
64 .byte 3 /* DW_AT_inline (DW_INL_declared_inlined) */
65 .byte 1 /* DW_AT_call_file */
66 .byte 8 /* DW_AT_call_line */
67
68 .uleb128 4 /* Abbrev: DW_TAG_inlined_subroutine */
69 .ascii "inlined2\0" /* DW_AT_name */
2abf49e1
MR
70 PTRBYTE func2 /* DW_AT_low_pc */
71 PTRBYTE func3 /* DW_AT_high_pc */
8be455d7
JK
72 .byte 3 /* DW_AT_inline (DW_INL_declared_inlined) */
73 .byte 1 /* DW_AT_call_file */
74 .byte 11 /* DW_AT_call_line */
75
76#ifdef INLINED
77 .uleb128 4 /* Abbrev: DW_TAG_inlined_subroutine */
78 .ascii "otherinline\0" /* DW_AT_name */
2abf49e1
MR
79 PTRBYTE func3 /* DW_AT_low_pc */
80 PTRBYTE func_end /* DW_AT_high_pc */
8be455d7
JK
81 .byte 3 /* DW_AT_inline (DW_INL_declared_inlined) */
82 .byte 1 /* DW_AT_call_file */
83 .byte 9 /* DW_AT_call_line */
84#endif
85
86#ifdef LEXICAL
87 .uleb128 5 /* Abbrev: DW_TAG_lexical_block */
2abf49e1
MR
88 PTRBYTE func3 /* DW_AT_low_pc */
89 PTRBYTE func_end /* DW_AT_high_pc */
8be455d7
JK
90
91 /* GDB would otherwise ignore the DW_TAG_lexical_block. */
92 .uleb128 6 /* Abbrev: DW_TAG_variable */
93 .ascii "lexicalvar\0" /* DW_AT_name */
94 .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
95
96 .byte 0 /* End of children of DW_TAG_lexical_block */
97#endif
98
99 .byte 0 /* End of children of DW_TAG_subprogram */
100
101/* Simulate `fund' is also named `func' so that the function name matches and
102 fund's SAL is not discarded in expand_line_sal_maybe. */
103
104 .uleb128 2 /* Abbrev: DW_TAG_subprogram */
105 .byte 1 /* DW_AT_external */
106 .ascii "func\0" /* DW_AT_name */
107 .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
2abf49e1
MR
108 PTRBYTE fund_start /* DW_AT_low_pc */
109 PTRBYTE fund_end /* DW_AT_high_pc */
8be455d7
JK
110
111 .byte 0 /* End of children of DW_TAG_subprogram */
112
113.Ltype_int:
114 .uleb128 3 /* Abbrev: DW_TAG_base_type */
115 .ascii "int\0" /* DW_AT_name */
116 .byte 4 /* DW_AT_byte_size */
117 .byte 5 /* DW_AT_encoding */
118
119 .byte 0 /* End of children of CU */
120
121.Lcu1_end:
122
123 .section .debug_loc
124loclist:
125 /* Reset the location list base address first. */
856d06f9 126 .4byte -1, 0
8be455d7 127
2abf49e1 128 PTRBYTE func_start, func_end
8be455d7
JK
129 .2byte 2f-1f
1301: .byte 0x50 /* DW_OP_reg0 */
1312:
132 /* Location list end. */
856d06f9 133 .4byte 0, 0
8be455d7
JK
134
135/* Abbrev table */
136 .section .debug_abbrev
137.Labbrev1_begin:
138 .uleb128 1 /* Abbrev code */
139 .uleb128 0x11 /* DW_TAG_compile_unit */
140 .byte 1 /* has_children */
141 .uleb128 0x10 /* DW_AT_stmt_list */
142 .uleb128 0x6 /* DW_FORM_data4 */
143 .uleb128 0x11 /* DW_AT_low_pc */
144 .uleb128 0x1 /* DW_FORM_addr */
145 .uleb128 0x12 /* DW_AT_high_pc */
146 .uleb128 0x1 /* DW_FORM_addr */
147 .uleb128 0x3 /* DW_AT_name */
148 .uleb128 0x8 /* DW_FORM_string */
149 .uleb128 0x25 /* DW_AT_producer */
150 .uleb128 0x8 /* DW_FORM_string */
151 .uleb128 0x13 /* DW_AT_language */
152 .uleb128 0xb /* DW_FORM_data1 */
153 .byte 0x0 /* Terminator */
154 .byte 0x0 /* Terminator */
155
156 .uleb128 2 /* Abbrev code */
157 .uleb128 0x2e /* DW_TAG_subprogram */
158 .byte 1 /* has_children */
159 .uleb128 0x3f /* DW_AT_external */
160 .uleb128 0xc /* DW_FORM_flag */
161 .uleb128 0x3 /* DW_AT_name */
162 .uleb128 0x8 /* DW_FORM_string */
163 .uleb128 0x49 /* DW_AT_type */
164 .uleb128 0x13 /* DW_FORM_ref4 */
165 .uleb128 0x11 /* DW_AT_low_pc */
166 .uleb128 0x1 /* DW_FORM_addr */
167 .uleb128 0x12 /* DW_AT_high_pc */
168 .uleb128 0x1 /* DW_FORM_addr */
169 .byte 0x0 /* Terminator */
170 .byte 0x0 /* Terminator */
171
172 .uleb128 3 /* Abbrev code */
173 .uleb128 0x24 /* DW_TAG_base_type */
174 .byte 0 /* has_children */
175 .uleb128 0x3 /* DW_AT_name */
176 .uleb128 0x8 /* DW_FORM_string */
177 .uleb128 0xb /* DW_AT_byte_size */
178 .uleb128 0xb /* DW_FORM_data1 */
179 .uleb128 0x3e /* DW_AT_encoding */
180 .uleb128 0xb /* DW_FORM_data1 */
181 .byte 0x0 /* Terminator */
182 .byte 0x0 /* Terminator */
183
184 .uleb128 4 /* Abbrev code */
185 .uleb128 0x1d /* DW_TAG_inlined_subroutine */
186 .byte 0 /* has_children */
187 .uleb128 0x3 /* DW_AT_name */
188 .uleb128 0x8 /* DW_FORM_string */
189 .uleb128 0x11 /* DW_AT_low_pc */
190 .uleb128 0x1 /* DW_FORM_addr */
191 .uleb128 0x12 /* DW_AT_high_pc */
192 .uleb128 0x1 /* DW_FORM_addr */
193 .uleb128 0x20 /* DW_AT_inline */
194 .uleb128 0xb /* DW_FORM_data1 */
195 .uleb128 0x58 /* DW_AT_call_file */
196 .uleb128 0xb /* DW_FORM_data1 */
197 .uleb128 0x59 /* DW_AT_call_line */
198 .uleb128 0xb /* DW_FORM_data1 */
199 .byte 0x0 /* Terminator */
200 .byte 0x0 /* Terminator */
201
202 .uleb128 5 /* Abbrev code */
203 .uleb128 0x0b /* DW_TAG_lexical_block */
204 .byte 1 /* has_children */
205 .uleb128 0x11 /* DW_AT_low_pc */
206 .uleb128 0x1 /* DW_FORM_addr */
207 .uleb128 0x12 /* DW_AT_high_pc */
208 .uleb128 0x1 /* DW_FORM_addr */
209 .byte 0x0 /* Terminator */
210 .byte 0x0 /* Terminator */
211
212 .uleb128 6 /* Abbrev code */
213 .uleb128 0x34 /* DW_TAG_variable */
214 .byte 0 /* has_children */
215 .uleb128 0x3 /* DW_AT_name */
216 .uleb128 0x8 /* DW_FORM_string */
217 .uleb128 0x49 /* DW_AT_type */
218 .uleb128 0x13 /* DW_FORM_ref4 */
219 .byte 0x0 /* Terminator */
220 .byte 0x0 /* Terminator */
221
222 .uleb128 0x7 /* (abbrev code) */
223 .uleb128 0x5 /* (TAG: DW_TAG_formal_parameter) */
224 .byte 0x0 /* DW_children_no */
225 .uleb128 0x3 /* DW_AT_name */
226 .uleb128 0x8 /* DW_FORM_string */
227 .uleb128 0x49 /* (DW_AT_type) */
228 .uleb128 0x13 /* (DW_FORM_ref4) */
229 .uleb128 0x02 /* (DW_AT_location) */
230 .uleb128 0x06 /* (DW_FORM_data4) */
231 .byte 0x0
232 .byte 0x0
233
234 .byte 0x0 /* Terminator */
235 .byte 0x0 /* Terminator */
236
237/* Line table */
238 .section .debug_line
239.Lline1_begin:
240 .4byte .Lline1_end - .Lline1_start /* Initial length */
241.Lline1_start:
242 .2byte 2 /* Version */
243 .4byte .Lline1_lines - .Lline1_hdr /* header_length */
244.Lline1_hdr:
245 .byte 1 /* Minimum insn length */
246 .byte 1 /* default_is_stmt */
247 .byte 1 /* line_base */
248 .byte 1 /* line_range */
249 .byte 0x10 /* opcode_base */
250
251 /* Standard lengths */
252 .byte 0
253 .byte 1
254 .byte 1
255 .byte 1
256 .byte 1
257 .byte 0
258 .byte 0
259 .byte 0
260 .byte 1
261 .byte 0
262 .byte 0
263 .byte 1
264 .byte 0
265 .byte 0
266 .byte 0
267
268 /* Include directories */
269 .byte 0
270
271 /* File names */
272 .ascii "main.c\0"
273 .uleb128 0
274 .uleb128 0
275 .uleb128 0
276
277 .ascii "other.c\0"
278 .uleb128 0
279 .uleb128 0
280 .uleb128 0
281
282 .byte 0
283
284.Lline1_lines:
285 .byte 0 /* DW_LNE_set_address */
286 .uleb128 5
287 .byte 2
2abf49e1 288 PTRBYTE func_start
8be455d7
JK
289 .byte 3 /* DW_LNS_advance_line */
290 .sleb128 4 /* ... to 5 */
291 .byte 1 /* DW_LNS_copy */
292
293 .byte 0 /* DW_LNE_set_address */
294 .uleb128 5
295 .byte 2
2abf49e1 296 PTRBYTE func0
8be455d7
JK
297 .byte 4 /* DW_LNS_set_file */
298 .uleb128 2
299 .byte 3 /* DW_LNS_advance_line */
300 .sleb128 -4 /* ... to 1 */
301 .byte 1 /* DW_LNS_copy */
302
303 .byte 0 /* DW_LNE_set_address */
304 .uleb128 5
305 .byte 2
2abf49e1 306 PTRBYTE func1
8be455d7
JK
307 .byte 4 /* DW_LNS_set_file */
308 .uleb128 1
309 .byte 3 /* DW_LNS_advance_line */
310 .sleb128 8 /* ... to 9 */
311 .byte 1 /* DW_LNS_copy */
312
313 .byte 0 /* DW_LNE_set_address */
314 .uleb128 5
315 .byte 2
2abf49e1 316 PTRBYTE func2
8be455d7
JK
317 .byte 4 /* DW_LNS_set_file */
318 .uleb128 2
319 .byte 3 /* DW_LNS_advance_line */
320 .sleb128 -8 /* ... to 1 */
321 .byte 1 /* DW_LNS_copy */
322
323 .byte 0 /* DW_LNE_set_address */
324 .uleb128 5
325 .byte 2
2abf49e1 326 PTRBYTE func3
8be455d7
JK
327 .byte 4 /* DW_LNS_set_file */
328 .uleb128 1
329 .byte 3 /* DW_LNS_advance_line */
330 .sleb128 8 /* ... to 9 */
331 .byte 1 /* DW_LNS_copy */
332
333 .byte 0 /* DW_LNE_set_address */
334 .uleb128 5
335 .byte 2
2abf49e1 336 PTRBYTE func_end
8be455d7
JK
337
338/* Equivalent copy but renamed s/func/fund/. */
339
340 .byte 0 /* DW_LNE_set_address */
341 .uleb128 5
342 .byte 2
2abf49e1 343 PTRBYTE fund_start
8be455d7
JK
344 .byte 3 /* DW_LNS_advance_line */
345 .sleb128 -4 /* ... to 5 */
346 .byte 1 /* DW_LNS_copy */
347
348 .byte 0 /* DW_LNE_set_address */
349 .uleb128 5
350 .byte 2
2abf49e1 351 PTRBYTE fund0
8be455d7
JK
352 .byte 4 /* DW_LNS_set_file */
353 .uleb128 2
354 .byte 3 /* DW_LNS_advance_line */
355 .sleb128 -4 /* ... to 1 */
356 .byte 1 /* DW_LNS_copy */
357
358 .byte 0 /* DW_LNE_set_address */
359 .uleb128 5
360 .byte 2
2abf49e1 361 PTRBYTE fund1
8be455d7
JK
362 .byte 4 /* DW_LNS_set_file */
363 .uleb128 1
364 .byte 3 /* DW_LNS_advance_line */
365 .sleb128 8 /* ... to 9 */
366 .byte 1 /* DW_LNS_copy */
367
368 .byte 0 /* DW_LNE_set_address */
369 .uleb128 5
370 .byte 2
2abf49e1 371 PTRBYTE fund2
8be455d7
JK
372 .byte 4 /* DW_LNS_set_file */
373 .uleb128 2
374 .byte 3 /* DW_LNS_advance_line */
375 .sleb128 -8 /* ... to 1 */
376 .byte 1 /* DW_LNS_copy */
377
378 .byte 0 /* DW_LNE_set_address */
379 .uleb128 5
380 .byte 2
2abf49e1 381 PTRBYTE fund3
8be455d7
JK
382 .byte 4 /* DW_LNS_set_file */
383 .uleb128 1
384 .byte 3 /* DW_LNS_advance_line */
385 .sleb128 8 /* ... to 9 */
386 .byte 1 /* DW_LNS_copy */
387
388 .byte 0 /* DW_LNE_set_address */
389 .uleb128 5
390 .byte 2
2abf49e1 391 PTRBYTE fund_end
8be455d7
JK
392
393/* Line numbering end. */
394
395 .byte 0 /* DW_LNE_end_of_sequence */
396 .uleb128 1
397 .byte 1
398
399.Lline1_end: