1 /* This testcase is part of GDB, the GNU debugger.
3 Copyright 2011-2019 Free Software Foundation, Inc.
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.
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.
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/>. */
19 # define PTRBYTE .8byte
21 # define PTRBYTE .4byte
23 # error "Unsupported pointer size"
29 .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
31 .2byte 2 /* DWARF Version */
32 .4byte .Labbrev1_begin /* Offset into abbrev section */
33 .byte PTRBITS / 8 /* Pointer size */
36 .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
37 .4byte .Lline1_begin /* DW_AT_stmt_list */
38 PTRBYTE func_start /* DW_AT_low_pc */
39 PTRBYTE func_end /* DW_AT_high_pc */
40 .ascii "main.c\0" /* DW_AT_name */
41 .ascii "GNU C 4.5.0\0" /* DW_AT_producer must be >= 4.5 */
42 .byte 2 /* DW_AT_language (DW_LANG_C) */
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 */
48 PTRBYTE func_start /* DW_AT_low_pc */
49 PTRBYTE func_end /* DW_AT_high_pc */
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. */
55 .uleb128 0x7 /* (DIE (0x42) DW_TAG_formal_parameter) */
56 .ascii "param\0" /* DW_AT_name */
57 .4byte .Ltype_int - .Lcu1_begin /* DW_AT_type */
58 .4byte loclist /* DW_AT_location */
60 .uleb128 4 /* Abbrev: DW_TAG_inlined_subroutine */
61 .ascii "inlined\0" /* DW_AT_name */
62 PTRBYTE func0 /* DW_AT_low_pc */
63 PTRBYTE func1 /* DW_AT_high_pc */
64 .byte 3 /* DW_AT_inline (DW_INL_declared_inlined) */
65 .byte 1 /* DW_AT_call_file */
66 .byte 8 /* DW_AT_call_line */
68 .uleb128 4 /* Abbrev: DW_TAG_inlined_subroutine */
69 .ascii "inlined2\0" /* DW_AT_name */
70 PTRBYTE func2 /* DW_AT_low_pc */
71 PTRBYTE func3 /* DW_AT_high_pc */
72 .byte 3 /* DW_AT_inline (DW_INL_declared_inlined) */
73 .byte 1 /* DW_AT_call_file */
74 .byte 11 /* DW_AT_call_line */
77 .uleb128 4 /* Abbrev: DW_TAG_inlined_subroutine */
78 .ascii "otherinline\0" /* DW_AT_name */
79 PTRBYTE func3 /* DW_AT_low_pc */
80 PTRBYTE func_end /* DW_AT_high_pc */
81 .byte 3 /* DW_AT_inline (DW_INL_declared_inlined) */
82 .byte 1 /* DW_AT_call_file */
83 .byte 9 /* DW_AT_call_line */
87 .uleb128 5 /* Abbrev: DW_TAG_lexical_block */
88 PTRBYTE func3 /* DW_AT_low_pc */
89 PTRBYTE func_end /* DW_AT_high_pc */
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 */
96 .byte 0 /* End of children of DW_TAG_lexical_block */
99 .byte 0 /* End of children of DW_TAG_subprogram */
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. */
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 */
108 PTRBYTE fund_start /* DW_AT_low_pc */
109 PTRBYTE fund_end /* DW_AT_high_pc */
111 .byte 0 /* End of children of DW_TAG_subprogram */
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 */
119 .byte 0 /* End of children of CU */
125 /* Reset the location list base address first. */
128 PTRBYTE func_start, func_end
130 1: .byte 0x50 /* DW_OP_reg0 */
132 /* Location list end. */
136 .section .debug_abbrev
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 */
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 */
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 */
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 */
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 */
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 */
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) */
234 .byte 0x0 /* Terminator */
235 .byte 0x0 /* Terminator */
240 .4byte .Lline1_end - .Lline1_start /* Initial length */
242 .2byte 2 /* Version */
243 .4byte .Lline1_lines - .Lline1_hdr /* header_length */
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 */
251 /* Standard lengths */
268 /* Include directories */
285 .byte 0 /* DW_LNE_set_address */
289 .byte 3 /* DW_LNS_advance_line */
290 .sleb128 4 /* ... to 5 */
291 .byte 1 /* DW_LNS_copy */
293 .byte 0 /* DW_LNE_set_address */
297 .byte 4 /* DW_LNS_set_file */
299 .byte 3 /* DW_LNS_advance_line */
300 .sleb128 -4 /* ... to 1 */
301 .byte 1 /* DW_LNS_copy */
303 .byte 0 /* DW_LNE_set_address */
307 .byte 4 /* DW_LNS_set_file */
309 .byte 3 /* DW_LNS_advance_line */
310 .sleb128 8 /* ... to 9 */
311 .byte 1 /* DW_LNS_copy */
313 .byte 0 /* DW_LNE_set_address */
317 .byte 4 /* DW_LNS_set_file */
319 .byte 3 /* DW_LNS_advance_line */
320 .sleb128 -8 /* ... to 1 */
321 .byte 1 /* DW_LNS_copy */
323 .byte 0 /* DW_LNE_set_address */
327 .byte 4 /* DW_LNS_set_file */
329 .byte 3 /* DW_LNS_advance_line */
330 .sleb128 8 /* ... to 9 */
331 .byte 1 /* DW_LNS_copy */
333 .byte 0 /* DW_LNE_set_address */
338 /* Equivalent copy but renamed s/func/fund/. */
340 .byte 0 /* DW_LNE_set_address */
344 .byte 3 /* DW_LNS_advance_line */
345 .sleb128 -4 /* ... to 5 */
346 .byte 1 /* DW_LNS_copy */
348 .byte 0 /* DW_LNE_set_address */
352 .byte 4 /* DW_LNS_set_file */
354 .byte 3 /* DW_LNS_advance_line */
355 .sleb128 -4 /* ... to 1 */
356 .byte 1 /* DW_LNS_copy */
358 .byte 0 /* DW_LNE_set_address */
362 .byte 4 /* DW_LNS_set_file */
364 .byte 3 /* DW_LNS_advance_line */
365 .sleb128 8 /* ... to 9 */
366 .byte 1 /* DW_LNS_copy */
368 .byte 0 /* DW_LNE_set_address */
372 .byte 4 /* DW_LNS_set_file */
374 .byte 3 /* DW_LNS_advance_line */
375 .sleb128 -8 /* ... to 1 */
376 .byte 1 /* DW_LNS_copy */
378 .byte 0 /* DW_LNE_set_address */
382 .byte 4 /* DW_LNS_set_file */
384 .byte 3 /* DW_LNS_advance_line */
385 .sleb128 8 /* ... to 9 */
386 .byte 1 /* DW_LNS_copy */
388 .byte 0 /* DW_LNE_set_address */
393 /* Line numbering end. */
395 .byte 0 /* DW_LNE_end_of_sequence */