1 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.ada/packed_array.exp
2 ===================================================================
3 --- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.ada/packed_array.exp 2017-02-26 19:15:28.552824751 +0100
4 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.ada/packed_array.exp 2017-02-26 19:15:36.597882316 +0100
6 # are. Observed with (FSF GNU Ada 4.5.3 20110124).
9 + -re "= \\(\\)\[\r\n\]+$gdb_prompt $" {
10 + # archer-jankratochvil-vla resolves it as a dynamic type resolved as an
11 + # empty array [0..-1].
12 + # DW_AT_upper_bound : (DW_OP_fbreg: -48; DW_OP_deref)
17 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S
18 ===================================================================
19 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
20 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S 2017-02-26 19:15:36.598882323 +0100
22 + .file "x86_64-vla-pointer.c"
26 + .type foo, @function
29 + .file 1 "gdb.arch/x86_64-vla-pointer.c"
30 + # gdb.arch/x86_64-vla-pointer.c:22
34 +# PRED: ENTRY (FALLTHRU)
36 + .cfi_def_cfa_offset 16
39 + .cfi_def_cfa_register 6
43 + movl %edi, -52(%rbp)
44 + # gdb.arch/x86_64-vla-pointer.c:22
48 + # gdb.arch/x86_64-vla-pointer.c:23
50 + movl -52(%rbp), %eax
53 + movq %rdx, -32(%rbp)
57 + # gdb.arch/x86_64-vla-pointer.c:24
69 + imulq $16, %rax, %rax
73 + movq %rax, -40(%rbp)
74 + # gdb.arch/x86_64-vla-pointer.c:27
82 + # gdb.arch/x86_64-vla-pointer.c:28
83 + .loc 1 28 0 discriminator 3
84 + movl -20(%rbp), %eax
86 + movq -40(%rbp), %rdx
87 + movl -20(%rbp), %eax
89 + movb %cl, (%rdx,%rax)
90 +# SUCC: 4 (FALLTHRU,DFS_BACK)
91 + # gdb.arch/x86_64-vla-pointer.c:27
92 + .loc 1 27 0 discriminator 3
95 +# PRED: 3 (FALLTHRU,DFS_BACK) 2 [100.0%]
97 + # gdb.arch/x86_64-vla-pointer.c:27
98 + .loc 1 27 0 is_stmt 0 discriminator 1
99 + movl -20(%rbp), %eax
100 + cmpl -52(%rbp), %eax
101 +# SUCC: 3 5 (FALLTHRU)
104 +# PRED: 4 (FALLTHRU)
105 + # gdb.arch/x86_64-vla-pointer.c:30
106 + .loc 1 30 0 is_stmt 1
107 + movq -40(%rbp), %rax
110 + # gdb.arch/x86_64-vla-pointer.c:31
113 + movq -8(%rbp), %rbx
116 +# SUCC: EXIT [100.0%]
122 + .section .debug_info,"",@progbits
124 + .long 0xa5 # Length of Compilation Unit Info
125 + .value 0x4 # DWARF version number
126 + .long .Ldebug_abbrev0 # Offset Into Abbrev. Section
127 + .byte 0x8 # Pointer Size (in bytes)
128 + .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
129 + .long .LASF3 # DW_AT_producer: "GNU C11 6.2.1 20160916 (Red Hat 6.2.1-2) -mtune=generic -march=x86-64 -g"
130 + .byte 0xc # DW_AT_language
131 + .long .LASF4 # DW_AT_name: "gdb.arch/x86_64-vla-pointer.c"
132 + .long .LASF5 # DW_AT_comp_dir: "/home/jkratoch/redhat/fedora/gdb/master/gdb-7.12/gdb/testsuite"
133 + .quad .Ltext0 # DW_AT_low_pc
134 + .quad .Letext0-.Ltext0 # DW_AT_high_pc
135 + .long .Ldebug_line0 # DW_AT_stmt_list
136 + .uleb128 0x2 # (DIE (0x2d) DW_TAG_subprogram)
138 + .ascii "foo\0" # DW_AT_name
139 + .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
140 + .byte 0x15 # DW_AT_decl_line
142 + .quad .LFB0 # DW_AT_low_pc
143 + .quad .LFE0-.LFB0 # DW_AT_high_pc
144 + .uleb128 0x1 # DW_AT_frame_base
145 + .byte 0x9c # DW_OP_call_frame_cfa
146 + # DW_AT_GNU_all_call_sites
147 + .long 0x80 # DW_AT_sibling
148 + .uleb128 0x3 # (DIE (0x4a) DW_TAG_formal_parameter)
149 + .long .LASF6 # DW_AT_name: "size"
150 + .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
151 + .byte 0x15 # DW_AT_decl_line
152 + .long 0x80 # DW_AT_type
153 + .uleb128 0x3 # DW_AT_location
154 + .byte 0x91 # DW_OP_fbreg
156 + .uleb128 0x4 # (DIE (0x59) DW_TAG_typedef)
157 + .long .LASF7 # DW_AT_name: "array_t"
158 + .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
159 + .byte 0x17 # DW_AT_decl_line
160 + .long 0x87 # DW_AT_type
161 + .uleb128 0x5 # (DIE (0x64) DW_TAG_variable)
162 + .long .LASF0 # DW_AT_name: "array"
163 + .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
164 + .byte 0x18 # DW_AT_decl_line
165 + .long 0x59 # DW_AT_type
166 + .uleb128 0x3 # DW_AT_location
167 + .byte 0x91 # DW_OP_fbreg
169 + .byte 0x6 # DW_OP_deref
170 + .uleb128 0x6 # (DIE (0x73) DW_TAG_variable)
171 + .ascii "i\0" # DW_AT_name
172 + .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
173 + .byte 0x19 # DW_AT_decl_line
174 + .long 0x80 # DW_AT_type
175 + .uleb128 0x2 # DW_AT_location
176 + .byte 0x91 # DW_OP_fbreg
178 + .byte 0 # end of children of DIE 0x2d
179 + .uleb128 0x7 # (DIE (0x80) DW_TAG_base_type)
180 + .byte 0x4 # DW_AT_byte_size
181 + .byte 0x5 # DW_AT_encoding
182 + .ascii "int\0" # DW_AT_name
183 + .uleb128 0x8 # (DIE (0x87) DW_TAG_array_type)
184 + .long 0xa1 # DW_AT_type
185 + .long 0x9a # DW_AT_sibling
186 + .uleb128 0x9 # (DIE (0x90) DW_TAG_subrange_type)
187 + .long 0x9a # DW_AT_type
188 + .uleb128 0x3 # DW_AT_upper_bound
189 + .byte 0x91 # DW_OP_fbreg
191 + .byte 0x6 # DW_OP_deref
192 + .byte 0 # end of children of DIE 0x87
193 + .uleb128 0xa # (DIE (0x9a) DW_TAG_base_type)
194 + .byte 0x8 # DW_AT_byte_size
195 + .byte 0x7 # DW_AT_encoding
196 + .long .LASF1 # DW_AT_name: "sizetype"
197 + .uleb128 0xa # (DIE (0xa1) DW_TAG_base_type)
198 + .byte 0x1 # DW_AT_byte_size
199 + .byte 0x6 # DW_AT_encoding
200 + .long .LASF2 # DW_AT_name: "char"
201 + .byte 0 # end of children of DIE 0xb
202 + .section .debug_abbrev,"",@progbits
204 + .uleb128 0x1 # (abbrev code)
205 + .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
206 + .byte 0x1 # DW_children_yes
207 + .uleb128 0x25 # (DW_AT_producer)
208 + .uleb128 0xe # (DW_FORM_strp)
209 + .uleb128 0x13 # (DW_AT_language)
210 + .uleb128 0xb # (DW_FORM_data1)
211 + .uleb128 0x3 # (DW_AT_name)
212 + .uleb128 0xe # (DW_FORM_strp)
213 + .uleb128 0x1b # (DW_AT_comp_dir)
214 + .uleb128 0xe # (DW_FORM_strp)
215 + .uleb128 0x11 # (DW_AT_low_pc)
216 + .uleb128 0x1 # (DW_FORM_addr)
217 + .uleb128 0x12 # (DW_AT_high_pc)
218 + .uleb128 0x7 # (DW_FORM_data8)
219 + .uleb128 0x10 # (DW_AT_stmt_list)
220 + .uleb128 0x17 # (DW_FORM_sec_offset)
223 + .uleb128 0x2 # (abbrev code)
224 + .uleb128 0x2e # (TAG: DW_TAG_subprogram)
225 + .byte 0x1 # DW_children_yes
226 + .uleb128 0x3f # (DW_AT_external)
227 + .uleb128 0x19 # (DW_FORM_flag_present)
228 + .uleb128 0x3 # (DW_AT_name)
229 + .uleb128 0x8 # (DW_FORM_string)
230 + .uleb128 0x3a # (DW_AT_decl_file)
231 + .uleb128 0xb # (DW_FORM_data1)
232 + .uleb128 0x3b # (DW_AT_decl_line)
233 + .uleb128 0xb # (DW_FORM_data1)
234 + .uleb128 0x27 # (DW_AT_prototyped)
235 + .uleb128 0x19 # (DW_FORM_flag_present)
236 + .uleb128 0x11 # (DW_AT_low_pc)
237 + .uleb128 0x1 # (DW_FORM_addr)
238 + .uleb128 0x12 # (DW_AT_high_pc)
239 + .uleb128 0x7 # (DW_FORM_data8)
240 + .uleb128 0x40 # (DW_AT_frame_base)
241 + .uleb128 0x18 # (DW_FORM_exprloc)
242 + .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
243 + .uleb128 0x19 # (DW_FORM_flag_present)
244 + .uleb128 0x1 # (DW_AT_sibling)
245 + .uleb128 0x13 # (DW_FORM_ref4)
248 + .uleb128 0x3 # (abbrev code)
249 + .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
250 + .byte 0 # DW_children_no
251 + .uleb128 0x3 # (DW_AT_name)
252 + .uleb128 0xe # (DW_FORM_strp)
253 + .uleb128 0x3a # (DW_AT_decl_file)
254 + .uleb128 0xb # (DW_FORM_data1)
255 + .uleb128 0x3b # (DW_AT_decl_line)
256 + .uleb128 0xb # (DW_FORM_data1)
257 + .uleb128 0x49 # (DW_AT_type)
258 + .uleb128 0x13 # (DW_FORM_ref4)
259 + .uleb128 0x2 # (DW_AT_location)
260 + .uleb128 0x18 # (DW_FORM_exprloc)
263 + .uleb128 0x4 # (abbrev code)
264 + .uleb128 0x16 # (TAG: DW_TAG_typedef)
265 + .byte 0 # DW_children_no
266 + .uleb128 0x3 # (DW_AT_name)
267 + .uleb128 0xe # (DW_FORM_strp)
268 + .uleb128 0x3a # (DW_AT_decl_file)
269 + .uleb128 0xb # (DW_FORM_data1)
270 + .uleb128 0x3b # (DW_AT_decl_line)
271 + .uleb128 0xb # (DW_FORM_data1)
272 + .uleb128 0x49 # (DW_AT_type)
273 + .uleb128 0x13 # (DW_FORM_ref4)
276 + .uleb128 0x5 # (abbrev code)
277 + .uleb128 0x34 # (TAG: DW_TAG_variable)
278 + .byte 0 # DW_children_no
279 + .uleb128 0x3 # (DW_AT_name)
280 + .uleb128 0xe # (DW_FORM_strp)
281 + .uleb128 0x3a # (DW_AT_decl_file)
282 + .uleb128 0xb # (DW_FORM_data1)
283 + .uleb128 0x3b # (DW_AT_decl_line)
284 + .uleb128 0xb # (DW_FORM_data1)
285 + .uleb128 0x49 # (DW_AT_type)
286 + .uleb128 0x13 # (DW_FORM_ref4)
287 + .uleb128 0x2 # (DW_AT_location)
288 + .uleb128 0x18 # (DW_FORM_exprloc)
291 + .uleb128 0x6 # (abbrev code)
292 + .uleb128 0x34 # (TAG: DW_TAG_variable)
293 + .byte 0 # DW_children_no
294 + .uleb128 0x3 # (DW_AT_name)
295 + .uleb128 0x8 # (DW_FORM_string)
296 + .uleb128 0x3a # (DW_AT_decl_file)
297 + .uleb128 0xb # (DW_FORM_data1)
298 + .uleb128 0x3b # (DW_AT_decl_line)
299 + .uleb128 0xb # (DW_FORM_data1)
300 + .uleb128 0x49 # (DW_AT_type)
301 + .uleb128 0x13 # (DW_FORM_ref4)
302 + .uleb128 0x2 # (DW_AT_location)
303 + .uleb128 0x18 # (DW_FORM_exprloc)
306 + .uleb128 0x7 # (abbrev code)
307 + .uleb128 0x24 # (TAG: DW_TAG_base_type)
308 + .byte 0 # DW_children_no
309 + .uleb128 0xb # (DW_AT_byte_size)
310 + .uleb128 0xb # (DW_FORM_data1)
311 + .uleb128 0x3e # (DW_AT_encoding)
312 + .uleb128 0xb # (DW_FORM_data1)
313 + .uleb128 0x3 # (DW_AT_name)
314 + .uleb128 0x8 # (DW_FORM_string)
317 + .uleb128 0x8 # (abbrev code)
318 + .uleb128 0x1 # (TAG: DW_TAG_array_type)
319 + .byte 0x1 # DW_children_yes
320 + .uleb128 0x49 # (DW_AT_type)
321 + .uleb128 0x13 # (DW_FORM_ref4)
322 + .uleb128 0x1 # (DW_AT_sibling)
323 + .uleb128 0x13 # (DW_FORM_ref4)
326 + .uleb128 0x9 # (abbrev code)
327 + .uleb128 0x21 # (TAG: DW_TAG_subrange_type)
328 + .byte 0 # DW_children_no
329 + .uleb128 0x49 # (DW_AT_type)
330 + .uleb128 0x13 # (DW_FORM_ref4)
331 + .uleb128 0x2f # (DW_AT_upper_bound)
332 + .uleb128 0x18 # (DW_FORM_exprloc)
335 + .uleb128 0xa # (abbrev code)
336 + .uleb128 0x24 # (TAG: DW_TAG_base_type)
337 + .byte 0 # DW_children_no
338 + .uleb128 0xb # (DW_AT_byte_size)
339 + .uleb128 0xb # (DW_FORM_data1)
340 + .uleb128 0x3e # (DW_AT_encoding)
341 + .uleb128 0xb # (DW_FORM_data1)
342 + .uleb128 0x3 # (DW_AT_name)
343 + .uleb128 0xe # (DW_FORM_strp)
347 + .section .debug_aranges,"",@progbits
348 + .long 0x2c # Length of Address Ranges Info
349 + .value 0x2 # DWARF Version
350 + .long .Ldebug_info0 # Offset of Compilation Unit Info
351 + .byte 0x8 # Size of Address
352 + .byte 0 # Size of Segment Descriptor
353 + .value 0 # Pad to 16 byte boundary
355 + .quad .Ltext0 # Address
356 + .quad .Letext0-.Ltext0 # Length
359 + .section .debug_line,"",@progbits
361 + .section .debug_str,"MS",@progbits,1
363 + .string "gdb.arch/x86_64-vla-pointer.c"
367 + .string "GNU C11 6.2.1 20160916 (Red Hat 6.2.1-2) -mtune=generic -march=x86-64 -g"
373 + .string "/home/jkratoch/redhat/fedora/gdb/master/gdb-7.12/gdb/testsuite"
378 + .ident "GCC: (GNU) 6.2.1 20160916 (Red Hat 6.2.1-2)"
379 + .section .note.GNU-stack,"",@progbits
380 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c
381 ===================================================================
382 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
383 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c 2017-02-26 19:15:36.598882323 +0100
385 +/* This testcase is part of GDB, the GNU debugger.
387 + Copyright 2009 Free Software Foundation, Inc.
389 + This program is free software; you can redistribute it and/or modify
390 + it under the terms of the GNU General Public License as published by
391 + the Free Software Foundation; either version 3 of the License, or
392 + (at your option) any later version.
394 + This program is distributed in the hope that it will be useful,
395 + but WITHOUT ANY WARRANTY; without even the implied warranty of
396 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
397 + GNU General Public License for more details.
399 + You should have received a copy of the GNU General Public License
400 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
407 + typedef char array_t[size];
411 + for (i = 0; i < size; i++)
414 + array[0] = 0; /* break-here */
419 +void foo (int size);
430 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp
431 ===================================================================
432 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
433 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp 2017-02-26 19:15:36.598882323 +0100
435 +# Copyright 2009 Free Software Foundation, Inc.
437 +# This program is free software; you can redistribute it and/or modify
438 +# it under the terms of the GNU General Public License as published by
439 +# the Free Software Foundation; either version 3 of the License, or
440 +# (at your option) any later version.
442 +# This program is distributed in the hope that it will be useful,
443 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
444 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
445 +# GNU General Public License for more details.
447 +# You should have received a copy of the GNU General Public License
448 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
450 +if ![istarget "x86_64-*-*"] then {
451 + verbose "Skipping over gdb.arch/x86_64-vla-pointer.exp test made only for x86_64."
455 +set testfile x86_64-vla-pointer
456 +set srcasmfile ${testfile}-foo.S
457 +set srcfile ${testfile}.c
458 +set binfile [standard_output_file ${testfile}]
459 +set binobjfile [standard_output_file ${testfile}-foo.o]
460 +if { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } {
461 + untested "Couldn't compile test program"
464 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {}] != "" } {
465 + untested "Couldn't compile test program"
471 +gdb_reinitialize_dir $srcdir/$subdir
475 + untested x86_64-vla-pointer
479 +gdb_breakpoint $srcfile:[gdb_get_line_number "break-here"]
481 +gdb_continue_to_breakpoint "break-here"
483 +gdb_test "whatis array" "type = array_t" "first: whatis array"
484 +gdb_test "whatis array_t" "type = char \\\[variable length\\\]" "first: whatis array_t"
485 +gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array"
487 +gdb_test "whatis *array" "type = char" "first: whatis *array"
488 +gdb_test "ptype *array" "type = char" "first: ptype *array"
490 +gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'"
491 +gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'"
492 +gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'"
493 +gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'"
495 +gdb_continue_to_breakpoint "break_here"
497 +gdb_test "whatis array" "type = array_t" "second: whatis array"
498 +gdb_test "whatis array_t" "type = char \\\[variable length\\\]" "second: whatis array_t"
499 +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array"
500 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S
501 ===================================================================
502 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
503 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S 2017-02-26 19:15:36.598882323 +0100
505 + .file "x86_64-vla-typedef.c"
506 + .section .debug_abbrev,"",@progbits
508 + .section .debug_info,"",@progbits
510 + .section .debug_line,"",@progbits
515 + .type foo, @function
518 + .file 1 "x86_64-vla-typedef.c"
526 + movl %edi, -36(%rbp)
529 + movq %rax, -48(%rbp)
531 + movl -36(%rbp), %edx
534 + movq %rax, -24(%rbp)
542 + movq %rsp, -56(%rbp)
543 + movq -56(%rbp), %rax
547 + movq %rax, -56(%rbp)
548 + movq -56(%rbp), %rax
549 + movq %rax, -16(%rbp)
555 + movl -4(%rbp), %esi
556 + movl -4(%rbp), %eax
558 + movq -16(%rbp), %rdx
560 + movb %cl, (%rdx,%rax)
564 + movl -4(%rbp), %eax
565 + cmpl -36(%rbp), %eax
570 + movq -16(%rbp), %rax
572 + movq -48(%rbp), %rsp
578 + .section .debug_frame,"",@progbits
580 + .long .LECIE0-.LSCIE0
596 + .long .LEFDE0-.LASFDE0
608 + .long .LCFI1-.LCFI0
613 + .section .eh_frame,"a",@progbits
615 + .long .LECIE1-.LSCIE1
633 + .long .LEFDE1-.LASFDE1
635 + .long .LASFDE1-.Lframe1
646 + .long .LCFI1-.LCFI0
653 + .section .debug_loc,"",@progbits
656 + .quad .LFB2-.Ltext0
657 + .quad .LCFI0-.Ltext0
661 + .quad .LCFI0-.Ltext0
662 + .quad .LCFI1-.Ltext0
666 + .quad .LCFI1-.Ltext0
667 + .quad .LFE2-.Ltext0
673 + .section .debug_info
674 + .long .Ldebug_end - .Ldebug_start
677 + .long .Ldebug_abbrev0
686 + .long .Ldebug_line0
710 + .long .Ltag_array_type - .debug_info
711 + .uleb128 0x5 /* Abbrev Number: 5 (DW_TAG_variable) */
716 + .long .Ltag_typedef - .debug_info
718 + /* Debugging only: Skip the typedef indirection. */
719 + .long .Ltag_array_type - .debug_info
721 + /* DW_AT_location: DW_FORM_block1: start */
726 + .byte 0x6 /* DW_OP_deref */
728 + .byte 0x96 /* DW_OP_nop */
730 + /* DW_AT_location: DW_FORM_block1: end */
745 + .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */
746 + .long 0xa0 + (2f - 1f) /* DW_AT_type: DW_FORM_ref4 */
747 + .long 0x9d + (2f - 1f) /* DW_AT_sibling: DW_FORM_ref4 */
748 +1: /* DW_AT_data_location: DW_FORM_block1: start */
749 + .byte 2f - 3f /* length */
751 + .byte 0x97 /* DW_OP_push_object_address */
752 + .byte 0x6 /* DW_OP_deref */
753 +2: /* DW_AT_data_location: DW_FORM_block1: end */
755 + .long 0x9d + (2b - 1b) /* DW_AT_type: DW_FORM_ref4 */
770 + .section .debug_abbrev
882 + .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */
885 + .uleb128 0x49 /* DW_AT_type */
886 + .uleb128 0x13 /* DW_FORM_ref4 */
887 + .uleb128 0x1 /* DW_AT_sibling */
888 + .uleb128 0x13 /* DW_FORM_ref4 */
889 + .uleb128 0x50 /* DW_AT_data_location */
890 + .uleb128 0xa /* DW_FORM_block1 */
896 + .uleb128 0x49 /* DW_AT_type */
897 + .uleb128 0x13 /* DW_FORM_ref4 */
923 + .section .debug_pubnames,"",@progbits
926 + .long .Ldebug_info0
931 + .section .debug_aranges,"",@progbits
934 + .long .Ldebug_info0
940 + .quad .Letext0-.Ltext0
943 + .section .debug_str,"MS",@progbits,1
949 + .string "x86_64-vla-typedef.c"
957 + .string "GNU C 4.3.2 20081105 (Red Hat 4.3.2-7)"
958 + .ident "GCC: (GNU) 4.3.2 20081105 (Red Hat 4.3.2-7)"
959 + .section .note.GNU-stack,"",@progbits
960 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c
961 ===================================================================
962 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
963 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c 2017-02-26 19:15:36.599882330 +0100
965 +/* This testcase is part of GDB, the GNU debugger.
967 + Copyright 2008 Free Software Foundation, Inc.
969 + This program is free software; you can redistribute it and/or modify
970 + it under the terms of the GNU General Public License as published by
971 + the Free Software Foundation; either version 3 of the License, or
972 + (at your option) any later version.
974 + This program is distributed in the hope that it will be useful,
975 + but WITHOUT ANY WARRANTY; without even the implied warranty of
976 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
977 + GNU General Public License for more details.
979 + You should have received a copy of the GNU General Public License
980 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
987 + typedef char array_t[size];
991 + for (i = 0; i < size; i++)
994 + array[0] = 0; /* break-here */
999 +void foo (int size);
1010 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp
1011 ===================================================================
1012 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1013 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp 2017-02-26 19:15:36.599882330 +0100
1015 +# Copyright 2009 Free Software Foundation, Inc.
1017 +# This program is free software; you can redistribute it and/or modify
1018 +# it under the terms of the GNU General Public License as published by
1019 +# the Free Software Foundation; either version 3 of the License, or
1020 +# (at your option) any later version.
1022 +# This program is distributed in the hope that it will be useful,
1023 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1024 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1025 +# GNU General Public License for more details.
1027 +# You should have received a copy of the GNU General Public License
1028 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
1030 +# Test DW_AT_data_location accessed through DW_TAG_typedef intermediate.
1032 +if ![istarget "x86_64-*-*"] then {
1033 + verbose "Skipping over gdb.arch/x86_64-vla-typedef.exp test made only for x86_64."
1037 +set testfile x86_64-vla-typedef
1038 +set srcasmfile ${testfile}-foo.S
1039 +set srcfile ${testfile}.c
1040 +set binfile [standard_output_file ${testfile}]
1041 +set binobjfile [standard_output_file ${testfile}-foo.o]
1042 +if { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } {
1043 + untested "Couldn't compile test program"
1046 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {debug}] != "" } {
1047 + untested "Couldn't compile test program"
1053 +gdb_reinitialize_dir $srcdir/$subdir
1054 +gdb_load ${binfile}
1057 + untested x86_64-vla-typedef
1061 +gdb_breakpoint "break_here"
1063 +gdb_continue_to_breakpoint "break_here"
1065 +gdb_test "whatis array" "type = array_t" "first: whatis array"
1067 +gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array"
1069 +gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'"
1070 +gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'"
1071 +gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'"
1072 +gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'"
1074 +gdb_continue_to_breakpoint "break_here"
1076 +gdb_test "whatis array" "type = array_t" "second: whatis array"
1078 +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array"
1079 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.c
1080 ===================================================================
1081 --- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.base/arrayidx.c 2017-02-26 19:15:28.555824772 +0100
1082 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.c 2017-02-26 19:15:36.599882330 +0100
1085 int array[] = {1, 2, 3, 4};
1097 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.exp
1098 ===================================================================
1099 --- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.base/arrayidx.exp 2017-02-26 19:15:28.555824772 +0100
1100 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.exp 2017-02-26 19:15:36.599882330 +0100
1102 "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \
1103 "print array with array-indexes on"
1106 +set test "p unbound.a == &unbound.a\[0\]"
1107 +gdb_test_multiple $test $test {
1108 + -re " = 1\r\n$gdb_prompt $" {
1111 + -re "No symbol \"unbound\" in current context.\r\n$gdb_prompt $" {
1112 + unsupported "$test (no GCC)"
1115 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.c
1116 ===================================================================
1117 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1118 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.c 2017-02-26 19:15:36.599882330 +0100
1120 +/* This testcase is part of GDB, the GNU debugger.
1122 + Copyright 2009 Free Software Foundation, Inc.
1124 + This program is free software; you can redistribute it and/or modify
1125 + it under the terms of the GNU General Public License as published by
1126 + the Free Software Foundation; either version 3 of the License, or
1127 + (at your option) any later version.
1129 + This program is distributed in the hope that it will be useful,
1130 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1131 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1132 + GNU General Public License for more details.
1134 + You should have received a copy of the GNU General Public License
1135 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
1139 +} staticstruct = { 1 };
1140 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.exp
1141 ===================================================================
1142 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1143 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.exp 2017-02-26 19:15:36.600882337 +0100
1145 +# Copyright 2009 Free Software Foundation, Inc.
1147 +# This program is free software; you can redistribute it and/or modify
1148 +# it under the terms of the GNU General Public License as published by
1149 +# the Free Software Foundation; either version 3 of the License, or
1150 +# (at your option) any later version.
1152 +# This program is distributed in the hope that it will be useful,
1153 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1154 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1155 +# GNU General Public License for more details.
1157 +# You should have received a copy of the GNU General Public License
1158 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
1160 +set test internal-var-field-address
1161 +set binfile ${test}.x
1162 +if { [gdb_compile "${srcdir}/${subdir}/${test}.c" "[standard_output_file ${binfile}]" object {debug}] != "" } {
1163 + untested "Couldn't compile test program"
1167 +clean_restart $binfile
1169 +gdb_test {set $varstruct = staticstruct}
1170 +gdb_test {p $varstruct.field} " = 1"
1171 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.c
1172 ===================================================================
1173 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1174 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.c 2017-02-26 19:15:36.600882337 +0100
1176 +/* This testcase is part of GDB, the GNU debugger.
1178 + Copyright 2011 Free Software Foundation, Inc.
1180 + This program is free software; you can redistribute it and/or modify
1181 + it under the terms of the GNU General Public License as published by
1182 + the Free Software Foundation; either version 3 of the License, or
1183 + (at your option) any later version.
1185 + This program is distributed in the hope that it will be useful,
1186 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1187 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1188 + GNU General Public License for more details.
1190 + You should have received a copy of the GNU General Public License
1191 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
1193 +#include <string.h>
1196 +main (int argc, char **argv)
1199 + void (*f) (char *) = 0;
1201 + memset (s, 0, sizeof (s));
1207 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.exp
1208 ===================================================================
1209 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1210 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.exp 2017-02-26 19:15:36.600882337 +0100
1212 +# Copyright 2011 Free Software Foundation, Inc.
1214 +# This program is free software; you can redistribute it and/or modify
1215 +# it under the terms of the GNU General Public License as published by
1216 +# the Free Software Foundation; either version 3 of the License, or
1217 +# (at your option) any later version.
1219 +# This program is distributed in the hope that it will be useful,
1220 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1221 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1222 +# GNU General Public License for more details.
1224 +# You should have received a copy of the GNU General Public License
1225 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
1227 +set testfile vla-frame
1228 +set executable ${testfile}
1230 +if { [prepare_for_testing ${testfile}.exp ${executable}] } {
1238 +set test "continue"
1239 +gdb_test_multiple $test $test {
1240 + -re "Continuing\\.\r\n\r\nProgram received signal SIGSEGV, Segmentation fault\\.\r\n0x0+ in \\?\\? \\(\\)\r\n$gdb_prompt $" {
1243 + -re "\r\n$gdb_prompt $" {
1244 + untested ${testfile}.exp
1249 +gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*"
1250 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.c
1251 ===================================================================
1252 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1253 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.c 2017-02-26 19:15:36.600882337 +0100
1255 +/* This testcase is part of GDB, the GNU debugger.
1257 + Copyright 2008 Free Software Foundation, Inc.
1259 + This program is free software; you can redistribute it and/or modify
1260 + it under the terms of the GNU General Public License as published by
1261 + the Free Software Foundation; either version 3 of the License, or
1262 + (at your option) any later version.
1264 + This program is distributed in the hope that it will be useful,
1265 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1266 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1267 + GNU General Public License for more details.
1269 + You should have received a copy of the GNU General Public License
1270 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
1272 +#include <stdlib.h>
1275 +main (int argc, char **argv)
1279 + array[0] = array[0];
1285 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.exp
1286 ===================================================================
1287 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1288 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.exp 2017-02-26 19:15:36.600882337 +0100
1290 +# Copyright 2008 Free Software Foundation, Inc.
1292 +# This program is free software; you can redistribute it and/or modify
1293 +# it under the terms of the GNU General Public License as published by
1294 +# the Free Software Foundation; either version 3 of the License, or
1295 +# (at your option) any later version.
1297 +# This program is distributed in the hope that it will be useful,
1298 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1299 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1300 +# GNU General Public License for more details.
1302 +# You should have received a copy of the GNU General Public License
1303 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
1305 +# We could crash in:
1306 +# #0 block_linkage_function (bl=0x0) at ../../gdb/block.c:69
1307 +# #1 in dwarf_block_get_frame_base (...) at ../../gdb/dwarf2block.c:97
1308 +# 97 framefunc = block_linkage_function (get_frame_block (frame, NULL));
1309 +# #2 in execute_stack_op (...) at ../../gdb/dwarf2expr.c:496
1310 +# #3 in dwarf_block_exec_core () at ../../gdb/dwarf2block.c:156
1311 +# #4 dwarf_block_exec (...) at ../../gdb/dwarf2block.c:206
1312 +# #5 in range_type_count_bound_internal (...) at ../../gdb/gdbtypes.c:1430
1313 +# #6 in create_array_type (...) at ../../gdb/gdbtypes.c:840
1315 +# #21 in psymtab_to_symtab (...) at ../../gdb/symfile.c:292
1317 +# #29 in backtrace_command_1 () at ../../gdb/stack.c:1273
1319 +set testfile vla-overflow
1320 +set shfile [standard_output_file ${testfile}-gdb.sh]
1321 +set srcfile ${testfile}.c
1322 +set binfile [standard_output_file ${testfile}]
1323 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
1324 + untested "Couldn't compile test program"
1328 +set f [open "|getconf PAGESIZE" "r"]
1334 +gdb_reinitialize_dir $srcdir/$subdir
1335 +gdb_load ${binfile}
1337 +set pid_of_gdb [exp_pid -i [board_info host fileid]]
1339 +if { [runto_main] < 0 } {
1340 + untested vla-overflow
1344 +# Get the GDB memory size when we stay at main.
1346 +proc memory_v_pages_get {} {
1347 + global pid_of_gdb pagesize
1348 + set fd [open "/proc/$pid_of_gdb/statm"]
1351 + # number of pages of virtual memory
1352 + scan $line "%d" drs
1356 +set pages_found [memory_v_pages_get]
1358 +# s390x with glibc-debuginfo.s390x installed used approx. 16MB.
1360 +verbose -log "pages_found = $pages_found, mb_reserve = $mb_reserve"
1361 +set kb_found [expr $pages_found * $pagesize / 1024]
1362 +set kb_permit [expr $kb_found + 1 * 1024 + $mb_reserve * 1024]
1363 +verbose -log "kb_found = $kb_found, kb_permit = $kb_permit"
1365 +# Create the ulimit wrapper.
1366 +set f [open $shfile "w"]
1367 +puts $f "#! /bin/sh"
1368 +puts $f "ulimit -v $kb_permit"
1369 +puts $f "exec $GDB \"\$@\""
1371 +remote_exec host "chmod +x $shfile"
1379 +gdb_reinitialize_dir $srcdir/$subdir
1380 +gdb_load ${binfile}
1382 +set pid_of_gdb [exp_pid -i [board_info host fileid]]
1384 +# Check the size again after the second run.
1385 +# We must not stop in main as it would cache `array' and never crash later.
1389 +verbose -log "kb_found before abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
1391 +gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()"
1393 +verbose -log "kb_found in abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
1395 +# `abort' can get expressed as `*__GI_abort'.
1396 +gdb_test "bt" "in \[^ \]*abort \\(.* in main \\(.*" "Backtrace after abort()"
1398 +verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
1399 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.c
1400 ===================================================================
1401 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1402 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.c 2017-02-26 19:15:36.600882337 +0100
1404 +/* This testcase is part of GDB, the GNU debugger.
1406 + Copyright 2008 Free Software Foundation, Inc.
1408 + This program is free software; you can redistribute it and/or modify
1409 + it under the terms of the GNU General Public License as published by
1410 + the Free Software Foundation; either version 3 of the License, or
1411 + (at your option) any later version.
1413 + This program is distributed in the hope that it will be useful,
1414 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1415 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1416 + GNU General Public License for more details.
1418 + You should have received a copy of the GNU General Public License
1419 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
1421 +#include <string.h>
1429 +bar (char *a, char *b, char *c, int size)
1431 + memset (a, '1', size);
1432 + memset (b, '2', size);
1433 + memset (c, '3', 48);
1442 + temp1[size - 1] = '\0';
1446 + bar (temp1, temp2, temp3, size);
1448 + marker (); /* break-here */
1459 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.exp
1460 ===================================================================
1461 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1462 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.exp 2017-02-26 19:15:36.600882337 +0100
1464 +# Copyright 2008 Free Software Foundation, Inc.
1466 +# This program is free software; you can redistribute it and/or modify
1467 +# it under the terms of the GNU General Public License as published by
1468 +# the Free Software Foundation; either version 3 of the License, or
1469 +# (at your option) any later version.
1471 +# This program is distributed in the hope that it will be useful,
1472 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1473 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1474 +# GNU General Public License for more details.
1476 +# You should have received a copy of the GNU General Public License
1477 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
1480 +set srcfile ${testfile}.c
1481 +set binfile [standard_output_file ${testfile}]
1482 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
1483 + untested "Couldn't compile test program"
1489 +gdb_reinitialize_dir $srcdir/$subdir
1490 +gdb_load ${binfile}
1497 +gdb_breakpoint [gdb_get_line_number "break-here"]
1499 +gdb_continue_to_breakpoint "break-here"
1501 +gdb_test "whatis temp1" "type = char \\\[26\\\]" "first: whatis temp1"
1502 +gdb_test "whatis temp2" "type = char \\\[26\\\]" "first: whatis temp2"
1503 +gdb_test "whatis temp3" "type = char \\\[48\\\]" "first: whatis temp3"
1505 +gdb_test "ptype temp1" "type = char \\\[26\\\]" "first: ptype temp1"
1506 +gdb_test "ptype temp2" "type = char \\\[26\\\]" "first: ptype temp2"
1507 +gdb_test "ptype temp3" "type = char \\\[48\\\]" "first: ptype temp3"
1509 +gdb_test "p temp1" " = '1' <repeats 26 times>" "first: print temp1"
1510 +gdb_test "p temp2" " = '2' <repeats 26 times>" "first: print temp2"
1511 +gdb_test "p temp3" " = '3' <repeats 48 times>" "first: print temp3"
1513 +gdb_continue_to_breakpoint "break-here"
1515 +gdb_test "whatis temp1" "type = char \\\[78\\\]" "second: whatis temp1"
1516 +gdb_test "whatis temp2" "type = char \\\[78\\\]" "second: whatis temp2"
1517 +gdb_test "whatis temp3" "type = char \\\[48\\\]" "second: whatis temp3"
1519 +gdb_test "ptype temp1" "type = char \\\[78\\\]" "second: ptype temp1"
1520 +gdb_test "ptype temp2" "type = char \\\[78\\\]" "second: ptype temp2"
1521 +gdb_test "ptype temp3" "type = char \\\[48\\\]" "second: ptype temp3"
1523 +gdb_test "p temp1" " = '1' <repeats 78 times>" "second: print temp1"
1524 +gdb_test "p temp2" " = '2' <repeats 78 times>" "second: print temp2"
1525 +gdb_test "p temp3" " = '3' <repeats 48 times>" "second: print temp3"
1526 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.cc
1527 ===================================================================
1528 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1529 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.cc 2017-02-26 19:15:36.601882344 +0100
1531 +/* This testcase is part of GDB, the GNU debugger.
1533 + Copyright 2008, 2009 Free Software Foundation, Inc.
1535 + This program is free software; you can redistribute it and/or modify
1536 + it under the terms of the GNU General Public License as published by
1537 + the Free Software Foundation; either version 3 of the License, or
1538 + (at your option) any later version.
1540 + This program is distributed in the hope that it will be useful,
1541 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1542 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1543 + GNU General Public License for more details.
1545 + You should have received a copy of the GNU General Public License
1546 + along with this program. If not, see <http://www.gnu.org/licenses/>.
1548 +#include <iostream>
1550 +using namespace std;
1552 +class NextOverThrowDerivates
1558 + // Single throw an exception in this function.
1564 + // Throw an exception in another function.
1570 + // Throw an exception in another function, but handle it
1581 + cout << "Caught and handled function1 exception" << endl;
1600 + // We use this to test that a "finish" here does not end up in
1601 + // this frame, but in the one above.
1609 + function1 (); // marker for until
1615 + function1 (); // until here
1619 +NextOverThrowDerivates next_cases;
1626 + next_cases.function1 ();
1635 + next_cases.function2 ();
1644 + // This is duplicated so we can next over one but step into
1646 + next_cases.function2 ();
1653 + next_cases.function3 ();
1657 + next_cases.rethrow ();
1666 + // Another duplicate so we can test "finish".
1667 + next_cases.function2 ();
1674 + // Another test for "finish".
1677 + next_cases.finish ();
1683 + // Test of "until".
1686 + next_cases.finish ();
1692 + // Test of "until" with an argument.
1695 + next_cases.until ();
1701 + // Test of "advance".
1704 + next_cases.until ();
1711 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.exp
1712 ===================================================================
1713 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1714 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.exp 2017-02-26 19:15:36.601882344 +0100
1716 +# Copyright 2008, 2009 Free Software Foundation, Inc.
1718 +# This program is free software; you can redistribute it and/or modify
1719 +# it under the terms of the GNU General Public License as published by
1720 +# the Free Software Foundation; either version 3 of the License, or
1721 +# (at your option) any later version.
1723 +# This program is distributed in the hope that it will be useful,
1724 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1725 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1726 +# GNU General Public License for more details.
1728 +# You should have received a copy of the GNU General Public License
1729 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
1732 +if $tracelevel then {
1733 + strace $tracelevel
1736 +if { [skip_cplus_tests] } { continue }
1738 +set testfile "gdb9593"
1739 +set srcfile ${testfile}.cc
1740 +set binfile [standard_output_file $testfile]
1742 +# Create and source the file that provides information about the compiler
1743 +# used to compile the test case.
1744 +if [get_compiler_info "c++"] {
1745 + untested gdb9593.exp
1749 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
1750 + untested gdb9593.exp
1754 +# Some targets can't do function calls, so don't even bother with this
1756 +if [target_info exists gdb,cannot_call_functions] {
1757 + setup_xfail "*-*-*" 9593
1758 + fail "This target can not call functions"
1764 +gdb_reinitialize_dir $srcdir/$subdir
1765 +gdb_load ${binfile}
1767 +if ![runto_main] then {
1768 + perror "couldn't run to main"
1772 +# See whether we have the needed unwinder hooks.
1774 +gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook" {
1775 + -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" {
1776 + pass "check for unwinder hook"
1778 + -re "No symbol .* in current context.\r\n$gdb_prompt $" {
1779 + # Pass the test so we don't get bogus fails in the results.
1780 + pass "check for unwinder hook"
1785 + untested gdb9593.exp
1789 +# See http://sourceware.org/bugzilla/show_bug.cgi?id=9593
1792 + ".*catch (...).*" \
1793 + "next over a throw 1"
1796 + ".*next_cases.function2.*" \
1797 + "next past catch 1"
1800 + ".*catch (...).*" \
1801 + "next over a throw 2"
1804 + ".*next_cases.function2.*" \
1805 + "next past catch 2"
1808 + ".*function1().*" \
1809 + "step into function2 1"
1812 + ".*catch (...).*" \
1813 + "next over a throw 3"
1816 + ".*next_cases.function3.*" \
1817 + "next past catch 3"
1820 + ".*next_cases.rethrow.*" \
1821 + "next over a throw 4"
1824 + ".*catch (...).*" \
1825 + "next over a rethrow"
1828 + ".*next_cases.function2.*" \
1829 + "next after a rethrow"
1832 + ".*function1().*" \
1833 + "step into function2 2"
1835 +gdb_test "finish" \
1836 + ".*catch (...).*" \
1840 + ".*next_cases.finish ().*" \
1841 + "next past catch 4"
1844 + ".*function1 ().*" \
1845 + "step into finish method"
1847 +gdb_test "finish" \
1848 + ".*catch (...).*" \
1852 + ".*next_cases.finish ().*" \
1853 + "next past catch 5"
1856 + ".*function1 ().*" \
1857 + "step into finish, for until"
1860 + ".*function1 ().*" \
1861 + "until with no argument 1"
1863 +set line [gdb_get_line_number "marker for until" $testfile.cc]
1865 +gdb_test "until $line" \
1866 + ".*function1 ().*" \
1867 + "next past catch 6"
1870 + ".*catch (...).*" \
1871 + "until with no argument 2"
1873 +set line [gdb_get_line_number "until here" $testfile.cc]
1876 + ".*next_cases.until ().*" \
1877 + "next past catch 6"
1880 + ".*function1 ().*" \
1883 +gdb_test "until $line" \
1884 + ".*catch (...).*" \
1885 + "until-over-throw"
1888 + ".*next_cases.until ().*" \
1889 + "next past catch 7"
1892 + ".*function1 ().*" \
1893 + "step into until, for advance"
1895 +gdb_test "advance $line" \
1896 + ".*catch (...).*" \
1897 + "advance-over-throw"
1898 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S
1899 ===================================================================
1900 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1901 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S 2017-02-26 19:15:36.601882344 +0100
1903 +/* This testcase is part of GDB, the GNU debugger.
1905 + Copyright 2010 Free Software Foundation, Inc.
1907 + This program is free software; you can redistribute it and/or modify
1908 + it under the terms of the GNU General Public License as published by
1909 + the Free Software Foundation; either version 3 of the License, or
1910 + (at your option) any later version.
1912 + This program is distributed in the hope that it will be useful,
1913 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1914 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1915 + GNU General Public License for more details.
1917 + You should have received a copy of the GNU General Public License
1918 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
1920 +/* Debug information */
1922 +/* We will `break *main' at the very first instruction. */
1923 +#define main_length 1
1927 + /* See DW_OP_lit3 + 1 (0-based). */
1928 + .string "seennotseen"
1930 + .section .debug_info
1932 + .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
1934 + .2byte 2 /* DWARF version number */
1935 + .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
1936 + .byte 4 /* Pointer Size (in bytes) */
1939 + .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
1940 + .4byte .Lproducer /* DW_AT_producer */
1941 + /* Use C++ to exploit a bug in parsing DW_AT_name "". */
1942 + .byte 4 /* DW_AT_language (C++) - */
1943 + .4byte main /* DW_AT_low_pc */
1944 + .byte main_length /* DW_AT_high_pc */
1947 + .uleb128 2 /* Abbrev: DW_TAG_array_type */
1948 + .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */
1950 + .uleb128 3 /* Abbrev: DW_TAG_subrange_type */
1951 + .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
1952 + .byte 0 /* DW_AT_lower_bound */
1953 + .4byte .Llen_var-.Lcu1_begin /* DW_AT_upper_bound */
1954 + .byte 0 /* End of children of die */
1956 + /* DW_AT_upper_bound is referencing an optimized-out variable. */
1958 + .uleb128 2 /* Abbrev: DW_TAG_array_type */
1959 + .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */
1961 + .uleb128 3 /* Abbrev: DW_TAG_subrange_type */
1962 + .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
1963 + .byte 0 /* DW_AT_lower_bound */
1964 + .4byte .Llenb_var-.Lcu1_begin /* DW_AT_upper_bound */
1965 + .byte 0 /* End of children of die */
1967 + /* DW_AT_upper_bound is referencing register. */
1969 + .uleb128 2 /* Abbrev: DW_TAG_array_type */
1970 + .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */
1972 + .uleb128 8 /* Abbrev: DW_TAG_subrange_type with block */
1973 + .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
1974 + .byte 0 /* DW_AT_lower_bound */
1975 + .byte 2f - 1f /* DW_AT_upper_bound */
1976 +1: .byte 0x50 /* DW_OP_reg0 */
1978 + .byte 0 /* End of children of die */
1981 + .uleb128 4 /* Abbrev: DW_TAG_base_type */
1982 + .4byte .Luint_str /* DW_AT_name */
1983 + .byte 4 /* DW_AT_byte_size */
1984 + .byte 7 /* DW_AT_encoding */
1987 + .uleb128 4 /* Abbrev: DW_TAG_base_type */
1988 + .4byte .Lchar_str /* DW_AT_name */
1989 + .byte 1 /* DW_AT_byte_size */
1990 + .byte 6 /* DW_AT_encoding */
1993 + .uleb128 5 /* Abbrev: DW_TAG_variable artificial */
1994 + .byte 1 /* DW_AT_artificial */
1995 + .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
1996 + .4byte .Llen_loclist-.Lloclist /* DW_AT_location */
1998 + /* optimized-out variable for b_string. */
2000 + .uleb128 7 /* Abbrev: DW_TAG_variable artificial no DW_AT_location */
2001 + .byte 1 /* DW_AT_artificial */
2002 + .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
2004 + .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */
2005 + .string "a_string" /* DW_AT_name */
2006 + .4byte .Larray_type-.Lcu1_begin /* DW_AT_type */
2007 + .byte 2f - 1f /* DW_AT_location */
2008 +1: .byte 3 /* DW_OP_addr */
2009 + .4byte vardata /* <addr> */
2012 + /* DW_AT_upper_bound is referencing an optimized-out variable. */
2013 + .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */
2014 + .string "b_string" /* DW_AT_name */
2015 + .4byte .Larrayb_type-.Lcu1_begin /* DW_AT_type */
2016 + .byte 2f - 1f /* DW_AT_location */
2017 +1: .byte 3 /* DW_OP_addr */
2018 + .4byte vardata /* <addr> */
2021 + /* DW_AT_upper_bound is referencing register. */
2022 + .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */
2023 + .string "reg_string" /* DW_AT_name */
2024 + .4byte .Larrayreg_type-.Lcu1_begin /* DW_AT_type */
2025 + .byte 2f - 1f /* DW_AT_location */
2026 +1: .byte 3 /* DW_OP_addr */
2027 + .4byte vardata /* <addr> */
2030 + .byte 0 /* End of children of CU */
2033 + .section .debug_loc
2036 + .4byte 0 # Location list begin address
2037 + .4byte main_length # Location list end address
2038 + .value 2f-1f # Location expression size
2039 +1: .byte 0x33 # DW_OP_lit3
2040 + .byte 0x9f # DW_OP_stack_value
2042 + .quad 0x0 # Location list terminator begin (*.LLST2)
2043 + .quad 0x0 # Location list terminator end (*.LLST2)
2045 + .section .debug_abbrev
2047 + .uleb128 1 /* Abbrev code */
2048 + .uleb128 0x11 /* DW_TAG_compile_unit */
2049 + .byte 0x1 /* has_children */
2050 + .uleb128 0x25 /* DW_AT_producer */
2051 + .uleb128 0xe /* DW_FORM_strp */
2052 + .uleb128 0x13 /* DW_AT_language */
2053 + .uleb128 0xb /* DW_FORM_data1 */
2054 + .uleb128 0x11 /* DW_AT_low_pc */
2055 + .uleb128 0x1 /* DW_FORM_addr */
2056 + .uleb128 0x12 /* DW_AT_high_pc */
2057 + .uleb128 0xb /* DW_FORM_data1 */
2058 + .byte 0x0 /* Terminator */
2059 + .byte 0x0 /* Terminator */
2061 + .uleb128 2 /* Abbrev code */
2062 + .uleb128 0x1 /* TAG: DW_TAG_array_type */
2063 + .byte 0x1 /* DW_children_yes */
2064 + .uleb128 0x49 /* DW_AT_type */
2065 + .uleb128 0x13 /* DW_FORM_ref4 */
2066 + .byte 0x0 /* Terminator */
2067 + .byte 0x0 /* Terminator */
2069 + .uleb128 3 /* Abbrev code */
2070 + .uleb128 0x21 /* DW_TAG_subrange_type */
2071 + .byte 0x0 /* no children */
2072 + .uleb128 0x49 /* DW_AT_type */
2073 + .uleb128 0x13 /* DW_FORM_ref4 */
2074 + .uleb128 0x22 /* DW_AT_lower_bound */
2075 + .uleb128 0xb /* DW_FORM_data1 */
2076 + .uleb128 0x2f /* DW_AT_upper_bound */
2077 + .uleb128 0x13 /* DW_FORM_ref4 */
2078 + .byte 0x0 /* Terminator */
2079 + .byte 0x0 /* Terminator */
2081 + .uleb128 4 /* Abbrev code */
2082 + .uleb128 0x24 /* DW_TAG_base_type */
2083 + .byte 0x0 /* no_children */
2084 + .uleb128 0x3 /* DW_AT_name */
2085 + .uleb128 0xe /* DW_FORM_strp */
2086 + .uleb128 0xb /* DW_AT_byte_size */
2087 + .uleb128 0xb /* DW_FORM_data1 */
2088 + .uleb128 0x3e /* DW_AT_encoding */
2089 + .uleb128 0xb /* DW_FORM_data1 */
2090 + .byte 0x0 /* Terminator */
2091 + .byte 0x0 /* Terminator */
2093 + .uleb128 5 /* Abbrev code */
2094 + .uleb128 0x34 /* DW_TAG_variable */
2095 + .byte 0x0 /* no_children */
2096 + .uleb128 0x34 /* DW_AT_artificial */
2097 + .uleb128 0x0c /* DW_FORM_flag */
2098 + .uleb128 0x49 /* DW_AT_type */
2099 + .uleb128 0x13 /* DW_FORM_ref4 */
2100 + .uleb128 0x02 /* DW_AT_location */
2101 + .uleb128 0x06 /* DW_FORM_data4 */
2102 + .byte 0x0 /* Terminator */
2103 + .byte 0x0 /* Terminator */
2105 + .uleb128 6 /* Abbrev code */
2106 + .uleb128 0x34 /* DW_TAG_variable */
2107 + .byte 0x0 /* no_children */
2108 + .uleb128 0x3 /* DW_AT_name */
2109 + .uleb128 0x8 /* DW_FORM_string */
2110 + .uleb128 0x49 /* DW_AT_type */
2111 + .uleb128 0x13 /* DW_FORM_ref4 */
2112 + .uleb128 0x2 /* DW_AT_location */
2113 + .uleb128 0xa /* DW_FORM_block1 */
2114 + .byte 0x0 /* Terminator */
2115 + .byte 0x0 /* Terminator */
2117 + .uleb128 7 /* Abbrev code */
2118 + .uleb128 0x34 /* DW_TAG_variable */
2119 + .byte 0x0 /* no_children */
2120 + .uleb128 0x34 /* DW_AT_artificial */
2121 + .uleb128 0x0c /* DW_FORM_flag */
2122 + .uleb128 0x49 /* DW_AT_type */
2123 + .uleb128 0x13 /* DW_FORM_ref4 */
2124 + .byte 0x0 /* Terminator */
2125 + .byte 0x0 /* Terminator */
2127 + .uleb128 8 /* Abbrev code */
2128 + .uleb128 0x21 /* DW_TAG_subrange_type with block */
2129 + .byte 0x0 /* no children */
2130 + .uleb128 0x49 /* DW_AT_type */
2131 + .uleb128 0x13 /* DW_FORM_ref4 */
2132 + .uleb128 0x22 /* DW_AT_lower_bound */
2133 + .uleb128 0xb /* DW_FORM_data1 */
2134 + .uleb128 0x2f /* DW_AT_upper_bound */
2135 + .uleb128 0xa /* DW_FORM_block1 */
2136 + .byte 0x0 /* Terminator */
2137 + .byte 0x0 /* Terminator */
2139 + .byte 0x0 /* Terminator */
2142 + .section .debug_str
2144 + .string "GNU C 3.3.3"
2148 + .string "unsigned int"
2149 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp
2150 ===================================================================
2151 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2152 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp 2017-02-26 19:15:36.602882352 +0100
2154 +# Copyright 2010 Free Software Foundation, Inc.
2156 +# This program is free software; you can redistribute it and/or modify
2157 +# it under the terms of the GNU General Public License as published by
2158 +# the Free Software Foundation; either version 3 of the License, or
2159 +# (at your option) any later version.
2161 +# This program is distributed in the hope that it will be useful,
2162 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
2163 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2164 +# GNU General Public License for more details.
2166 +# You should have received a copy of the GNU General Public License
2167 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
2169 +# Test printing variable with dynamic bounds which reference a different
2170 +# (artificial in the GCC case) variable containing loclist as its location.
2171 +# This testcase uses value (not address) of the referenced variable:
2172 +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43762
2174 +# This test can only be run on targets which support DWARF-2 and use gas.
2175 +# For now pick a sampling of likely targets.
2176 +if {![istarget *-*-linux*]
2177 + && ![istarget *-*-gnu*]
2178 + && ![istarget *-*-elf*]
2179 + && ![istarget *-*-openbsd*]
2180 + && ![istarget arm-*-eabi*]
2181 + && ![istarget powerpc-*-eabi*]} {
2185 +set testfile dw2-bound-loclist
2186 +if { [prepare_for_testing ${testfile}.exp ${testfile} [list ${testfile}.S main.c] {}] } {
2190 +# Verify it behaves at least as an unbound array without inferior.
2192 +# FIXME: FSF GDB crashes due to !has_stack_frames ().
2193 +# But in practice that should not happen.
2194 +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43762
2195 +#set test "p a_string"
2196 +#gdb_test_multiple $test $test {
2197 +# -re " = 0x\[0-9a-f\]+ \"seennotseen\"\r\n$gdb_prompt $" {
2200 +# -re "No registers\\.\r\n$gdb_prompt $" {
2201 +# kfail "vlaregression" $test
2205 +#gdb_test "ptype a_string" {type = char \[variable length\]}
2207 +# Not runto_main as dw2-bound-loclist.S handles only the first byte of main.
2208 +if ![runto "*main"] {
2212 +gdb_test "p a_string" { = "seen"}
2213 +gdb_test "ptype a_string" {type = char \[4\]}
2215 +gdb_test "p b_string" { = (0x[0-9a-f]+ )?"seennotseen"}
2216 +gdb_test "ptype b_string" {type = char \[\]}
2218 +# The register contains unpredictable value - the array size.
2219 +gdb_test "ptype reg_string" {type = char \[-?[0-9]+\]}
2220 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.c
2221 ===================================================================
2222 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2223 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.c 2017-02-26 19:15:36.602882352 +0100
2225 +/* This testcase is part of GDB, the GNU debugger.
2227 + Copyright 2004 Free Software Foundation, Inc.
2229 + This program is free software; you can redistribute it and/or modify
2230 + it under the terms of the GNU General Public License as published by
2231 + the Free Software Foundation; either version 2 of the License, or
2232 + (at your option) any later version.
2234 + This program is distributed in the hope that it will be useful,
2235 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2236 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2237 + GNU General Public License for more details.
2239 + You should have received a copy of the GNU General Public License
2240 + along with this program; if not, write to the Free Software
2241 + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2245 +/* The function `func1' traced into must have debug info on offset > 0;
2246 + (DW_UNSND (attr)). This is the reason of `func0' existence. */
2249 +func0(int a, int b)
2253 +/* `func1' being traced into must have some arguments to dump. */
2256 +func1(int a, int b)
2267 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
2268 ===================================================================
2269 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2270 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp 2017-02-26 19:15:36.602882352 +0100
2272 +# Copyright 2006 Free Software Foundation, Inc.
2274 +# This program is free software; you can redistribute it and/or modify
2275 +# it under the terms of the GNU General Public License as published by
2276 +# the Free Software Foundation; either version 2 of the License, or
2277 +# (at your option) any later version.
2279 +# This program is distributed in the hope that it will be useful,
2280 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
2281 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2282 +# GNU General Public License for more details.
2284 +# You should have received a copy of the GNU General Public License
2285 +# along with this program; if not, write to the Free Software
2286 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2288 +# Minimal DWARF-2 unit test
2290 +# This test can only be run on targets which support DWARF-2.
2291 +# For now pick a sampling of likely targets.
2292 +if {![istarget *-*-linux*]
2293 + && ![istarget *-*-gnu*]
2294 + && ![istarget *-*-elf*]
2295 + && ![istarget *-*-openbsd*]
2296 + && ![istarget arm-*-eabi*]
2297 + && ![istarget powerpc-*-eabi*]} {
2301 +set testfile "dw2-stripped"
2302 +set srcfile ${testfile}.c
2303 +set binfile [standard_output_file ${testfile}.x]
2305 +remote_exec build "rm -f ${binfile}"
2307 +# get the value of gcc_compiled
2308 +if [get_compiler_info ${binfile}] {
2312 +# This test can only be run on gcc as we use additional_flags=FIXME
2313 +if {$gcc_compiled == 0} {
2317 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-ggdb3}] != "" } {
2321 +remote_exec build "objcopy -R .debug_loc ${binfile}"
2322 +set strip_output [remote_exec build "objdump -h ${binfile}"]
2324 +set test "stripping test file preservation"
2325 +if [ regexp ".debug_info " $strip_output] {
2326 + pass "$test (.debug_info preserved)"
2328 + fail "$test (.debug_info got also stripped)"
2331 +set test "stripping test file functionality"
2332 +if [ regexp ".debug_loc " $strip_output] {
2333 + fail "$test (.debug_loc still present)"
2335 + pass "$test (.debug_loc stripped)"
2340 +gdb_reinitialize_dir $srcdir/$subdir
2341 +gdb_load ${binfile}
2343 +# For C programs, "start" should stop in main().
2346 + ".*main \\(\\) at .*" \
2349 + "func.* \\(.*\\) at .*" \
2351 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S
2352 ===================================================================
2353 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2354 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S 2017-02-26 19:15:36.602882352 +0100
2356 +/* This testcase is part of GDB, the GNU debugger.
2358 + Copyright 2009 Free Software Foundation, Inc.
2360 + This program is free software; you can redistribute it and/or modify
2361 + it under the terms of the GNU General Public License as published by
2362 + the Free Software Foundation; either version 3 of the License, or
2363 + (at your option) any later version.
2365 + This program is distributed in the hope that it will be useful,
2366 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2367 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2368 + GNU General Public License for more details.
2370 + You should have received a copy of the GNU General Public License
2371 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
2373 +/* Debug information */
2375 + .section .debug_info
2378 + .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
2380 + .2byte 2 /* DWARF Version */
2381 + .4byte .Labbrev1_begin /* Offset into abbrev section */
2382 + .byte 4 /* Pointer size */
2385 + .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
2386 + .ascii "dw2-struct-member-data-location.c\0" /* DW_AT_name */
2387 + .ascii "GNU C 4.3.2\0" /* DW_AT_producer */
2388 + .byte 1 /* DW_AT_language (C) */
2391 + .uleb128 2 /* Abbrev: DW_TAG_structure_type */
2392 + .ascii "some_struct\0" /* DW_AT_name */
2394 + .uleb128 3 /* Abbrev: DW_TAG_member */
2395 + .ascii "field\0" /* DW_AT_name */
2396 + .byte 0 /* DW_AT_data_member_location */
2398 + .byte 0 /* End of children of some_struct */
2400 + .byte 0 /* End of children of CU */
2405 + .section .debug_abbrev
2407 + .uleb128 1 /* Abbrev code */
2408 + .uleb128 0x11 /* DW_TAG_compile_unit */
2409 + .byte 1 /* has_children */
2410 + .uleb128 0x3 /* DW_AT_name */
2411 + .uleb128 0x8 /* DW_FORM_string */
2412 + .uleb128 0x25 /* DW_AT_producer */
2413 + .uleb128 0x8 /* DW_FORM_string */
2414 + .uleb128 0x13 /* DW_AT_language */
2415 + .uleb128 0xb /* DW_FORM_data1 */
2416 + .byte 0x0 /* Terminator */
2417 + .byte 0x0 /* Terminator */
2419 + .uleb128 2 /* Abbrev code */
2420 + .uleb128 0x13 /* DW_TAG_structure_type */
2421 + .byte 1 /* has_children */
2422 + .uleb128 0x3 /* DW_AT_name */
2423 + .uleb128 0x8 /* DW_FORM_string */
2424 + .byte 0x0 /* Terminator */
2425 + .byte 0x0 /* Terminator */
2427 + .uleb128 3 /* Abbrev code */
2428 + .uleb128 0x0d /* DW_TAG_member */
2429 + .byte 0 /* has_children */
2430 + .uleb128 0x3 /* DW_AT_name */
2431 + .uleb128 0x8 /* DW_FORM_string */
2432 + .uleb128 0x38 /* DW_AT_data_member_location */
2433 + .uleb128 0x0b /* DW_FORM_data1 */
2434 + .byte 0x0 /* Terminator */
2435 + .byte 0x0 /* Terminator */
2437 + .byte 0x0 /* Terminator */
2438 + .byte 0x0 /* Terminator */
2439 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp
2440 ===================================================================
2441 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2442 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp 2017-02-26 19:15:36.602882352 +0100
2444 +# Copyright 2009 Free Software Foundation, Inc.
2446 +# This program is free software; you can redistribute it and/or modify
2447 +# it under the terms of the GNU General Public License as published by
2448 +# the Free Software Foundation; either version 3 of the License, or
2449 +# (at your option) any later version.
2451 +# This program is distributed in the hope that it will be useful,
2452 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
2453 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2454 +# GNU General Public License for more details.
2456 +# You should have received a copy of the GNU General Public License
2457 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
2459 +# This test can only be run on targets which support DWARF-2 and use gas.
2460 +# For now pick a sampling of likely targets.
2461 +if {![istarget *-*-linux*]
2462 + && ![istarget *-*-gnu*]
2463 + && ![istarget *-*-elf*]
2464 + && ![istarget *-*-openbsd*]
2465 + && ![istarget arm-*-eabi*]
2466 + && ![istarget powerpc-*-eabi*]} {
2470 +set testfile "dw2-struct-member-data-location"
2471 +set srcfile ${testfile}.S
2472 +set binfile ${testfile}.x
2474 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "[standard_output_file ${binfile}]" object {nodebug}] != "" } {
2478 +clean_restart $binfile
2480 +gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}"
2481 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S
2482 ===================================================================
2483 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2484 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S 2017-02-26 19:15:36.602882352 +0100
2486 +/* This testcase is part of GDB, the GNU debugger.
2488 + Copyright 2012 Free Software Foundation, Inc.
2490 + This program is free software; you can redistribute it and/or modify
2491 + it under the terms of the GNU General Public License as published by
2492 + the Free Software Foundation; either version 3 of the License, or
2493 + (at your option) any later version.
2495 + This program is distributed in the hope that it will be useful,
2496 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2497 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2498 + GNU General Public License for more details.
2500 + You should have received a copy of the GNU General Public License
2501 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
2503 +/* Debug information */
2512 + .section .debug_info
2514 + .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
2516 + .2byte 2 /* DWARF version number */
2517 + .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
2518 + .byte 4 /* Pointer Size (in bytes) */
2521 + .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
2522 + .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
2523 + .byte 2 /* DW_AT_language (C) - */
2526 + .uleb128 2 /* Abbrev: DW_TAG_array_type */
2527 + .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */
2529 + .uleb128 8 /* Abbrev: DW_TAG_subrange_type without DW_AT_type */
2530 + .byte 0 /* DW_AT_lower_bound */
2531 + .byte 128 /* DW_AT_upper_bound */
2533 + .byte 0 /* End of children of die */
2536 + .uleb128 4 /* Abbrev: DW_TAG_base_type */
2537 + .ascii "char\0" /* DW_AT_name */
2538 + .byte 1 /* DW_AT_byte_size */
2539 + .byte 6 /* DW_AT_encoding */
2541 + .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */
2542 + .ascii "notype_string\0" /* DW_AT_name */
2543 + .4byte .Larray_type-.Lcu1_begin /* DW_AT_type */
2544 + .byte 2f - 1f /* DW_AT_location */
2545 +1: .byte 3 /* DW_OP_addr */
2546 + .4byte vardata /* <addr> */
2549 + .byte 0 /* End of children of CU */
2552 + .section .debug_abbrev
2554 + .uleb128 1 /* Abbrev code */
2555 + .uleb128 0x11 /* DW_TAG_compile_unit */
2556 + .byte 0x1 /* has_children */
2557 + .uleb128 0x25 /* DW_AT_producer */
2558 + .uleb128 0x8 /* DW_FORM_string */
2559 + .uleb128 0x13 /* DW_AT_language */
2560 + .uleb128 0xb /* DW_FORM_data1 */
2561 + .byte 0x0 /* Terminator */
2562 + .byte 0x0 /* Terminator */
2564 + .uleb128 2 /* Abbrev code */
2565 + .uleb128 0x1 /* TAG: DW_TAG_array_type */
2566 + .byte 0x1 /* DW_children_yes */
2567 + .uleb128 0x49 /* DW_AT_type */
2568 + .uleb128 0x13 /* DW_FORM_ref4 */
2569 + .byte 0x0 /* Terminator */
2570 + .byte 0x0 /* Terminator */
2572 + .uleb128 4 /* Abbrev code */
2573 + .uleb128 0x24 /* DW_TAG_base_type */
2574 + .byte 0x0 /* no_children */
2575 + .uleb128 0x3 /* DW_AT_name */
2576 + .uleb128 0x8 /* DW_FORM_string */
2577 + .uleb128 0xb /* DW_AT_byte_size */
2578 + .uleb128 0xb /* DW_FORM_data1 */
2579 + .uleb128 0x3e /* DW_AT_encoding */
2580 + .uleb128 0xb /* DW_FORM_data1 */
2581 + .byte 0x0 /* Terminator */
2582 + .byte 0x0 /* Terminator */
2584 + .uleb128 6 /* Abbrev code */
2585 + .uleb128 0x34 /* DW_TAG_variable */
2586 + .byte 0x0 /* no_children */
2587 + .uleb128 0x3 /* DW_AT_name */
2588 + .uleb128 0x8 /* DW_FORM_string */
2589 + .uleb128 0x49 /* DW_AT_type */
2590 + .uleb128 0x13 /* DW_FORM_ref4 */
2591 + .uleb128 0x2 /* DW_AT_location */
2592 + .uleb128 0xa /* DW_FORM_block1 */
2593 + .byte 0x0 /* Terminator */
2594 + .byte 0x0 /* Terminator */
2596 + .uleb128 8 /* Abbrev code */
2597 + .uleb128 0x21 /* DW_TAG_subrange_type without DW_AT_type */
2598 + .byte 0x0 /* no children */
2599 + .uleb128 0x22 /* DW_AT_lower_bound */
2600 + .uleb128 0xb /* DW_FORM_data1 */
2601 + .uleb128 0x2f /* DW_AT_upper_bound */
2602 + .uleb128 0xb /* DW_FORM_data1 */
2603 + .byte 0x0 /* Terminator */
2604 + .byte 0x0 /* Terminator */
2606 + .byte 0x0 /* Terminator */
2607 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp
2608 ===================================================================
2609 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2610 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp 2017-02-26 19:15:36.603882359 +0100
2612 +# Copyright 2012 Free Software Foundation, Inc.
2614 +# This program is free software; you can redistribute it and/or modify
2615 +# it under the terms of the GNU General Public License as published by
2616 +# the Free Software Foundation; either version 3 of the License, or
2617 +# (at your option) any later version.
2619 +# This program is distributed in the hope that it will be useful,
2620 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
2621 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2622 +# GNU General Public License for more details.
2624 +# You should have received a copy of the GNU General Public License
2625 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
2628 +# https://bugzilla.redhat.com/show_bug.cgi?id=806920
2629 +# read_subrange_type <TYPE_CODE (base_type) == TYPE_CODE_VOID> reinitialization
2630 +# of BASE_TYPE was done too late, it affects DW_TAG_subrange_type without
2631 +# specified DW_AT_type, present only in XLF produced code.
2633 +# This test can only be run on targets which support DWARF-2 and use gas.
2634 +if {![dwarf2_support]} {
2638 +set testfile dw2-subrange-no-type
2639 +set srcfile ${testfile}.S
2640 +set executable ${testfile}.x
2641 +set binfile [standard_output_file ${executable}]
2643 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } {
2647 +clean_restart $executable
2649 +gdb_test "ptype notype_string" {type = char \[129\]}
2650 +gdb_test "p notype_string" " = 'x' <repeats 129 times>"
2651 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.exp
2652 ===================================================================
2653 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2654 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2017-02-26 19:15:36.603882359 +0100
2656 +# Copyright 2009 Free Software Foundation, Inc.
2658 +# This program is free software; you can redistribute it and/or modify
2659 +# it under the terms of the GNU General Public License as published by
2660 +# the Free Software Foundation; either version 2 of the License, or
2661 +# (at your option) any later version.
2663 +# This program is distributed in the hope that it will be useful,
2664 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
2665 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2666 +# GNU General Public License for more details.
2668 +# You should have received a copy of the GNU General Public License
2669 +# along with this program; if not, write to the Free Software
2670 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2672 +# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
2674 +# This file is part of the gdb testsuite. Array element stride must not be
2675 +# specified in the number of elements but in a number of bytes instead.
2676 +# Original problem:
2678 +# $1 = '0-hello', ' ' <repeats 33 times>
2680 +# warning: Fortran array stride not divisible by the element size
2682 +set testfile dwarf-stride
2683 +set srcfile ${testfile}.f90
2685 +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
2689 +if ![runto MAIN__] then {
2690 + perror "couldn't run to breakpoint MAIN__"
2694 +gdb_breakpoint [gdb_get_line_number "break-here"]
2695 +gdb_continue_to_breakpoint "break-here" ".*break-here.*"
2696 +gdb_test "p c40pt(1)" " = '0-hello.*"
2697 +gdb_test "p c40pt(2)" " = '1-hello.*"
2698 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.f90
2699 ===================================================================
2700 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2701 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.f90 2017-02-26 19:15:36.603882359 +0100
2703 +! Copyright 2009 Free Software Foundation, Inc.
2705 +! This program is free software; you can redistribute it and/or modify
2706 +! it under the terms of the GNU General Public License as published by
2707 +! the Free Software Foundation; either version 2 of the License, or
2708 +! (at your option) any later version.
2710 +! This program is distributed in the hope that it will be useful,
2711 +! but WITHOUT ANY WARRANTY; without even the implied warranty of
2712 +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2713 +! GNU General Public License for more details.
2715 +! You should have received a copy of the GNU General Public License
2716 +! along with this program; if not, write to the Free Software
2717 +! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2719 +! File written by Alan Matsuoka.
2724 + character*40 long_string
2726 + end type small_stride
2728 + type(small_stride), dimension (20), target :: unpleasant
2729 + character*40, pointer, dimension(:):: c40pt
2734 + unpleasant(i+1)%small_pad = i+1
2735 + unpleasant(i+1)%long_string = char (ichar('0') + i) // '-hello'
2738 + c40pt => unpleasant%long_string
2740 + print *, c40pt ! break-here
2743 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.exp
2744 ===================================================================
2745 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2746 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.exp 2017-02-26 19:15:36.603882359 +0100
2748 +# Copyright 2007 Free Software Foundation, Inc.
2750 +# This program is free software; you can redistribute it and/or modify
2751 +# it under the terms of the GNU General Public License as published by
2752 +# the Free Software Foundation; either version 2 of the License, or
2753 +# (at your option) any later version.
2755 +# This program is distributed in the hope that it will be useful,
2756 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
2757 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2758 +# GNU General Public License for more details.
2760 +# You should have received a copy of the GNU General Public License
2761 +# along with this program; if not, write to the Free Software
2762 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2764 +# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
2766 +# This file is part of the gdb testsuite. It contains tests for dynamically
2767 +# allocated Fortran arrays.
2768 +# It depends on the GCC dynamic Fortran arrays DWARF support:
2769 +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22244
2771 +set testfile "dynamic"
2772 +set srcfile ${testfile}.f90
2773 +set binfile [standard_output_file ${testfile}]
2775 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } {
2776 + untested "Couldn't compile ${srcfile}"
2782 +gdb_reinitialize_dir $srcdir/$subdir
2783 +gdb_load ${binfile}
2785 +if ![runto MAIN__] then {
2786 + perror "couldn't run to breakpoint MAIN__"
2790 +gdb_breakpoint [gdb_get_line_number "varx-init"]
2791 +gdb_continue_to_breakpoint "varx-init"
2793 +# http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html#5
2794 +# Do not: gdb_test "p varx" "\\$\[0-9\]* = <not allocated>" "p varx unallocated"
2795 +# Do not: gdb_test "ptype varx" {type = real\(kind=4\) \(:,:,:\)} "ptype varx unallocated"
2796 +# Do not: gdb_test "p varx(1,5,17)" {no such vector element \(vector not allocated\)} "p varx(1,5,17) unallocated"
2797 +# Do not: gdb_test "p varx(1,5,17)=1" {no such vector element \(vector not allocated\)} "p varx(1,5,17)=1 unallocated"
2798 +# Do not: gdb_test "ptype varx(1,5,17)" {no such vector element \(vector not allocated\)} "ptype varx(1,5,17) unallocated"
2800 +gdb_breakpoint [gdb_get_line_number "varx-allocated"]
2801 +gdb_continue_to_breakpoint "varx-allocated"
2802 +# $1 = (( ( 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0) --- , 0) ) ( ( 0, 0, ...) ...) ...)
2803 +gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx allocated"
2804 +# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1.
2805 +gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varx allocated"
2807 +gdb_breakpoint [gdb_get_line_number "varx-filled"]
2808 +gdb_continue_to_breakpoint "varx-filled"
2809 +gdb_test "p varx(2, 5, 17)" "\\$\[0-9\]* = 6"
2810 +gdb_test "p varx(1, 5, 17)" "\\$\[0-9\]* = 7"
2811 +gdb_test "p varx(2, 6, 18)" "\\$\[0-9\]* = 8"
2812 +gdb_test "p varx(6, 15, 28)" "\\$\[0-9\]* = 9"
2813 +# http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html#5
2814 +# Do not: gdb_test "p varv" "\\$\[0-9\]* = <not associated>" "p varv unassociated"
2815 +# Do not: gdb_test "ptype varv" {type = real\(kind=4\) \(:,:,:\)} "ptype varv unassociated"
2817 +set test "output varx"
2818 +gdb_test_multiple $test $test {
2819 + -re "^output varx\r\n\[() ,6789.\]*$gdb_prompt $" {
2824 +gdb_breakpoint [gdb_get_line_number "varv-associated"]
2825 +gdb_continue_to_breakpoint "varv-associated"
2826 +gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 6" "p varx(3, 7, 19) with varv associated"
2827 +gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 6" "p varv(3, 7, 19) associated"
2828 +# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1.
2829 +gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varv associated"
2830 +gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx with varv associated"
2831 +# Intel Fortran Compiler 10.1.008 uses the pointer type.
2832 +gdb_test "ptype varv" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)\\)?" "ptype varv associated"
2834 +gdb_breakpoint [gdb_get_line_number "varv-filled"]
2835 +gdb_continue_to_breakpoint "varv-filled"
2836 +gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 10" "p varx(3, 7, 19) with varv filled"
2837 +gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 10" "p varv(3, 7, 19) filled"
2839 +gdb_breakpoint [gdb_get_line_number "varv-deassociated"]
2840 +gdb_continue_to_breakpoint "varv-deassociated"
2841 +# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type.
2842 +gdb_test "p varv" "\\$\[0-9\]* = (<not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "p varv deassociated"
2843 +gdb_test "ptype varv" {type = real\(kind=4\) \(:,:,:\)} "ptype varv deassociated"
2844 +gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varv deassociated"
2845 +gdb_test "p varv(1,5,17)" {no such vector element \(vector not associated\)}
2846 +gdb_test "ptype varv(1,5,17)" {no such vector element \(vector not associated\)}
2848 +gdb_breakpoint [gdb_get_line_number "varx-deallocated"]
2849 +gdb_continue_to_breakpoint "varx-deallocated"
2850 +gdb_test "p varx" "\\$\[0-9\]* = <not allocated>" "p varx deallocated"
2851 +gdb_test "ptype varx" {type = real\(kind=4\) \(:,:,:\)} "ptype varx deallocated"
2852 +gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varx deallocated"
2853 +gdb_test "p varx(1,5,17)" {no such vector element \(vector not allocated\)} "p varx(1,5,17) deallocated"
2854 +gdb_test "ptype varx(1,5,17)" {no such vector element \(vector not allocated\)} "ptype varx(1,5,17) deallocated"
2856 +gdb_breakpoint [gdb_get_line_number "vary-passed"]
2857 +gdb_continue_to_breakpoint "vary-passed"
2858 +# $1 = (( ( 1, 1, 1, 1, 1, 1) ( 1, 1, 1, 1, 1, 1) --- , 1) ) ( ( 1, 1, ...) ...) ...)
2859 +gdb_test "p vary" "\\$\[0-9\]* = \\(\[()1, .\]*\\)"
2861 +gdb_breakpoint [gdb_get_line_number "vary-filled"]
2862 +gdb_continue_to_breakpoint "vary-filled"
2863 +gdb_test "ptype vary" "type = real(\\(kind=4\\)|\\*4) \\(10,10\\)"
2864 +gdb_test "p vary(1, 1)" "\\$\[0-9\]* = 8"
2865 +gdb_test "p vary(2, 2)" "\\$\[0-9\]* = 9"
2866 +gdb_test "p vary(1, 3)" "\\$\[0-9\]* = 10"
2867 +# $1 = (( ( 3, 3, 3, 3, 3, 3) ( 3, 3, 3, 3, 3, 3) --- , 3) ) ( ( 3, 3, ...) ...) ...)
2868 +gdb_test "p varw" "\\$\[0-9\]* = \\(\[()3, .\]*\\)"
2870 +gdb_breakpoint [gdb_get_line_number "varw-almostfilled"]
2871 +gdb_continue_to_breakpoint "varw-almostfilled"
2872 +gdb_test "ptype varw" "type = real(\\(kind=4\\)|\\*4) \\(5,4,3\\)"
2873 +gdb_test "p varw(3,1,1)=1" "\\$\[0-9\]* = 1"
2874 +# $1 = (( ( 6, 5, 1, 5, 5, 5) ( 5, 5, 5, 5, 5, 5) --- , 5) ) ( ( 5, 5, ...) ...) ...)
2875 +gdb_test "p varw" "\\$\[0-9\]* = \\( *\\( *\\( *6, *5, *1,\[()5, .\]*\\)" "p varw filled"
2876 +# "up" works with GCC but other Fortran compilers may copy the values into the
2877 +# outer function only on the exit of the inner function.
2878 +# We need both variants as depending on the arch we optionally may still be
2879 +# executing the caller line or not after `finish'.
2880 +gdb_test "finish" ".*(call bar \\(y, x\\)|call foo \\(x, z\\(2:6, 4:7, 6:8\\)\\))"
2881 +gdb_test "p z(2,4,5)" "\\$\[0-9\]* = 3"
2882 +gdb_test "p z(2,4,6)" "\\$\[0-9\]* = 6"
2883 +gdb_test "p z(2,4,7)" "\\$\[0-9\]* = 5"
2884 +gdb_test "p z(4,4,6)" "\\$\[0-9\]* = 1"
2886 +gdb_breakpoint [gdb_get_line_number "varz-almostfilled"]
2887 +gdb_continue_to_breakpoint "varz-almostfilled"
2888 +# GCC uses the pointer type here, Intel Fortran Compiler 10.1.008 does not.
2889 +gdb_test "ptype varz" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(\\*\\)\\)?"
2890 +# Intel Fortran Compiler 10.1.008 has a bug here - (2:11,7:7)
2891 +# as it produces DW_AT_lower_bound == DW_AT_upper_bound == 7.
2892 +gdb_test "ptype vart" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(2:11,7:\\*\\)\\)?"
2893 +gdb_test "p varz" "\\$\[0-9\]* = \\(\\)"
2894 +gdb_test "p vart" "\\$\[0-9\]* = \\(\\)"
2895 +gdb_test "p varz(3)" "\\$\[0-9\]* = 4"
2896 +# maps to foo::vary(1,1)
2897 +gdb_test "p vart(2,7)" "\\$\[0-9\]* = 8"
2898 +# maps to foo::vary(2,2)
2899 +gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9"
2900 +# maps to foo::vary(1,3)
2901 +gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10"
2902 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.f90
2903 ===================================================================
2904 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2905 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.f90 2017-02-26 19:15:36.603882359 +0100
2907 +! Copyright 2007 Free Software Foundation, Inc.
2909 +! This program is free software; you can redistribute it and/or modify
2910 +! it under the terms of the GNU General Public License as published by
2911 +! the Free Software Foundation; either version 2 of the License, or
2912 +! (at your option) any later version.
2914 +! This program is distributed in the hope that it will be useful,
2915 +! but WITHOUT ANY WARRANTY; without even the implied warranty of
2916 +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2917 +! GNU General Public License for more details.
2919 +! You should have received a copy of the GNU General Public License
2920 +! along with this program; if not, write to the Free Software
2921 +! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2923 +! Ihis file is the Fortran source file for dynamic.exp.
2924 +! Original file written by Jakub Jelinek <jakub@redhat.com>.
2925 +! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
2928 + real, target, allocatable :: varx (:, :, :)
2929 + real, pointer :: varv (:, :, :)
2930 + real, target :: varu (1, 2, 3)
2932 + allocate (varx (1:6, 5:15, 17:28)) ! varx-init
2933 + l = allocated (varx)
2934 + varx(:, :, :) = 6 ! varx-allocated
2935 + varx(1, 5, 17) = 7
2936 + varx(2, 6, 18) = 8
2937 + varx(6, 15, 28) = 9
2938 + varv => varx ! varx-filled
2939 + l = associated (varv)
2940 + varv(3, 7, 19) = 10 ! varv-associated
2941 + varv => null () ! varv-filled
2942 + l = associated (varv)
2943 + deallocate (varx) ! varv-deassociated
2944 + l = allocated (varx)
2945 + varu(:, :, :) = 10 ! varx-deallocated
2946 + allocate (varv (1:6, 5:15, 17:28))
2947 + l = associated (varv)
2949 + varv(1, 5, 17) = 7
2950 + varv(2, 6, 18) = 8
2951 + varv(6, 15, 28) = 9
2953 + l = associated (varv)
2957 + l = associated (varv)
2959 +subroutine foo (vary, varw)
2960 + real :: vary (:, :)
2961 + real :: varw (:, :, :)
2962 + vary(:, :) = 4 ! vary-passed
2966 + varw(:, :, :) = 5 ! vary-filled
2968 + varw(2, 2, 2) = 7 ! varw-almostfilled
2970 +subroutine bar (varz, vart)
2972 + real :: vart (2:11, 7:*)
2974 + varz(2) = 5 ! varz-almostfilled
2975 + vart(2,7) = vart(2,7)
2979 + subroutine foo (vary, varw)
2980 + real :: vary (:, :)
2981 + real :: varw (:, :, :)
2985 + subroutine bar (varz, vart)
2987 + real :: vart (2:11, 7:*)
2990 + real :: x (10, 10), y (5), z(8, 8, 8)
2995 + call foo (x, z(2:6, 4:7, 6:8))
2997 + if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
2998 + if (x (1, 3) .ne. 10) call abort
2999 + if (z (2, 4, 6) .ne. 6 .or. z (3, 5, 7) .ne. 7 .or. z (2, 4, 7) .ne. 5) call abort
3000 + if (any (y .ne. (/4, 5, 4, 2, 2/))) call abort
3001 + call foo (transpose (x), z)
3002 + if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
3003 + if (x (3, 1) .ne. 10) call abort
3005 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.exp
3006 ===================================================================
3007 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3008 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.exp 2017-02-26 19:15:36.604882366 +0100
3010 +# Copyright 2008 Free Software Foundation, Inc.
3012 +# This program is free software; you can redistribute it and/or modify
3013 +# it under the terms of the GNU General Public License as published by
3014 +# the Free Software Foundation; either version 2 of the License, or
3015 +# (at your option) any later version.
3017 +# This program is distributed in the hope that it will be useful,
3018 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
3019 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3020 +# GNU General Public License for more details.
3022 +# You should have received a copy of the GNU General Public License
3023 +# along with this program; if not, write to the Free Software
3024 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3026 +# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
3028 +# This file is part of the gdb testsuite. It contains tests for Fortran
3029 +# strings with dynamic length.
3031 +set testfile "string"
3032 +set srcfile ${testfile}.f90
3033 +set binfile [standard_output_file ${testfile}]
3035 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } {
3036 + untested "Couldn't compile ${srcfile}"
3042 +gdb_reinitialize_dir $srcdir/$subdir
3043 +gdb_load ${binfile}
3045 +if ![runto MAIN__] then {
3046 + perror "couldn't run to breakpoint MAIN__"
3050 +gdb_breakpoint [gdb_get_line_number "var-init"]
3051 +gdb_continue_to_breakpoint "var-init"
3052 +gdb_test "ptype c" "type = character(\\(kind=1\\)|\\*1)"
3053 +gdb_test "ptype d" "type = character(\\(kind=8\\)|\\*8)"
3054 +gdb_test "ptype e" "type = character(\\(kind=4\\)|\\*4)"
3055 +gdb_test "ptype f" "type = character(\\(kind=4\\)|\\*4) \\(7,8:10\\)"
3056 +gdb_test "ptype *e" "Attempt to take contents of a non-pointer value."
3057 +gdb_test "ptype *f" "type = character(\\(kind=4\\)|\\*4) \\(7\\)"
3058 +gdb_test "p c" "\\$\[0-9\]* = 'c'"
3059 +gdb_test "p d" "\\$\[0-9\]* = 'd '"
3060 +gdb_test "p e" "\\$\[0-9\]* = 'g '"
3061 +gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\)"
3062 +gdb_test "p *e" "Attempt to take contents of a non-pointer value."
3063 +gdb_test "p *f" "Attempt to take contents of a non-pointer value."
3065 +gdb_breakpoint [gdb_get_line_number "var-finish"]
3066 +gdb_continue_to_breakpoint "var-finish"
3067 +gdb_test "p e" "\\$\[0-9\]* = 'e '" "p e re-set"
3068 +gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f2 ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\)" "p *f re-set"
3069 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.f90
3070 ===================================================================
3071 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3072 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.f90 2017-02-26 19:15:36.604882366 +0100
3074 +! Copyright 2008 Free Software Foundation, Inc.
3076 +! This program is free software; you can redistribute it and/or modify
3077 +! it under the terms of the GNU General Public License as published by
3078 +! the Free Software Foundation; either version 2 of the License, or
3079 +! (at your option) any later version.
3081 +! This program is distributed in the hope that it will be useful,
3082 +! but WITHOUT ANY WARRANTY; without even the implied warranty of
3083 +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3084 +! GNU General Public License for more details.
3086 +! You should have received a copy of the GNU General Public License
3087 +! along with this program; if not, write to the Free Software
3088 +! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3090 +! Ihis file is the Fortran source file for dynamic.exp.
3091 +! Original file written by Jakub Jelinek <jakub@redhat.com>.
3092 +! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
3094 +subroutine foo (e, f)
3095 + character (len=1) :: c
3096 + character (len=8) :: d
3097 + character (len=*) :: e
3098 + character (len=*) :: f (1:7, 8:10)
3101 + e = 'e' ! var-init
3104 + c = 'c' ! var-finish
3106 + character (len=4) :: g, h (1:7, 8:10)
3111 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.exp
3112 ===================================================================
3113 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3114 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.exp 2017-02-26 19:15:36.604882366 +0100
3116 +# Copyright 2011 Free Software Foundation, Inc.
3118 +# This program is free software; you can redistribute it and/or modify
3119 +# it under the terms of the GNU General Public License as published by
3120 +# the Free Software Foundation; either version 3 of the License, or
3121 +# (at your option) any later version.
3123 +# This program is distributed in the hope that it will be useful,
3124 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
3125 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3126 +# GNU General Public License for more details.
3128 +# You should have received a copy of the GNU General Public License
3129 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
3131 +if { [skip_fortran_tests] } { return -1 }
3133 +set testfile "subrange"
3134 +set srcfile ${testfile}.f90
3135 +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
3139 +if ![runto MAIN__] {
3140 + perror "Couldn't run to MAIN__"
3144 +# Depending on the compiler version being used, the name of the 4-byte integer
3145 +# and real types can be printed differently. For instance, gfortran-4.1 uses
3146 +# "int4" whereas gfortran-4.3 uses "int(kind=4)".
3147 +set int4 "(int4|integer\\(kind=4\\))"
3149 +gdb_breakpoint [gdb_get_line_number "break-static"]
3150 +gdb_continue_to_breakpoint "break-static" ".*break-static.*"
3152 +foreach var {a alloc ptr} {
3154 + set old_prefix $pf_prefix
3155 + lappend pf_prefix "$var:"
3157 + setup_kfail "*-*-*" "vlaregression/9999"
3158 + gdb_test "p $var (2, 2:3)" { = \(22, 32\)}
3159 + setup_kfail "*-*-*" "vlaregression/9999"
3160 + gdb_test "p $var (2:3, 3)" { = \(32, 33\)}
3161 + setup_kfail "*-*-*" "vlaregression/9999"
3162 + gdb_test "p $var (1, 2:)" { = \(21, 31\)}
3163 + setup_kfail "*-*-*" "vlaregression/9999"
3164 + gdb_test "p $var (2, :2)" { = \(12, 22\)}
3165 + setup_kfail "*-*-*" "vlaregression/9999"
3166 + gdb_test "p $var (3, 2:2)" { = \(23\)}
3167 + setup_kfail "*-*-*" "vlaregression/9999"
3168 + gdb_test "ptype $var (3, 2:2)" " = $int4 \\(2:2\\)"
3169 + setup_kfail "*-*-*" "vlaregression/9999"
3170 + gdb_test "p $var (4, :)" { = \(14, 24, 34\)}
3171 + setup_kfail "*-*-*" "vlaregression/9999"
3172 + gdb_test "p $var (:, :)" { = \(\( *11, 12, 13, 14\) \( *21, 22, 23, 24\) \( *31, 32, 33, 34\) *\)}
3173 + setup_kfail "*-*-*" "vlaregression/9999"
3174 + gdb_test "ptype $var (:, :)" " = $int4 \\(4,3\\)"
3175 + setup_kfail "*-*-*" "vlaregression/9999"
3176 + gdb_test "p $var (:)" "Wrong number of subscripts"
3177 + setup_kfail "*-*-*" "vlaregression/9999"
3178 + gdb_test "p $var (:, :, :)" "Wrong number of subscripts"
3180 + set pf_prefix $old_prefix
3183 +gdb_test_no_output {set $a=a}
3186 +setup_kfail "*-*-*" "vlaregression/9999"
3187 +gdb_test {p $a (3, 2:2)} { = \(23\)}
3188 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.f90
3189 ===================================================================
3190 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3191 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.f90 2017-02-26 19:15:36.604882366 +0100
3193 +! Copyright 2011 Free Software Foundation, Inc.
3195 +! This program is free software; you can redistribute it and/or modify
3196 +! it under the terms of the GNU General Public License as published by
3197 +! the Free Software Foundation; either version 3 of the License, or
3198 +! (at your option) any later version.
3200 +! This program is distributed in the hope that it will be useful,
3201 +! but WITHOUT ANY WARRANTY; without even the implied warranty of
3202 +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3203 +! GNU General Public License for more details.
3205 +! You should have received a copy of the GNU General Public License
3206 +! along with this program. If not, see <http://www.gnu.org/licenses/>.
3209 + integer, target :: a (4, 3)
3210 + integer, allocatable :: alloc (:, :)
3211 + integer, pointer :: ptr (:, :)
3214 + a (i, j) = j * 10 + i
3216 + allocate (alloc (4, 3))
3219 + write (*,*) a ! break-static
3221 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.c
3222 ===================================================================
3223 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3224 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.c 2017-02-26 19:15:36.604882366 +0100
3226 +/* Copyright 2011 Free Software Foundation, Inc.
3228 + This file is part of GDB.
3230 + This program is free software; you can redistribute it and/or modify
3231 + it under the terms of the GNU General Public License as published by
3232 + the Free Software Foundation; either version 3 of the License, or
3233 + (at your option) any later version.
3235 + This program is distributed in the hope that it will be useful,
3236 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3237 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3238 + GNU General Public License for more details.
3240 + You should have received a copy of the GNU General Public License
3241 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
3244 +main (int argc, char **argv)
3248 + vla[0] = 0; /* break-here */
3252 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp
3253 ===================================================================
3254 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3255 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp 2017-02-26 19:15:36.604882366 +0100
3257 +# Copyright 2011 Free Software Foundation, Inc.
3259 +# This program is free software; you can redistribute it and/or modify
3260 +# it under the terms of the GNU General Public License as published by
3261 +# the Free Software Foundation; either version 3 of the License, or
3262 +# (at your option) any later version.
3264 +# This program is distributed in the hope that it will be useful,
3265 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
3266 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3267 +# GNU General Public License for more details.
3269 +# You should have received a copy of the GNU General Public License
3270 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
3272 +load_lib mi-support.exp
3273 +set MIFLAGS "-i=mi2"
3276 +if [mi_gdb_start] {
3280 +set testfile "mi2-var-stale-type"
3281 +set srcfile ${testfile}.c
3282 +set binfile [standard_output_file ${testfile}]
3283 +if {[build_executable ${testfile}.exp $testfile $srcfile] == -1} {
3287 +mi_delete_breakpoints
3288 +mi_gdb_reinitialize_dir $srcdir/$subdir
3289 +mi_gdb_load ${binfile}
3291 +mi_gdb_test {-interpreter-exec console "maintenance set internal-error quit yes"} \
3293 + "maintenance set internal-error quit yes"
3295 +mi_gdb_test {-interpreter-exec console "maintenance set internal-error corefile yes"} \
3297 + "maintenance set internal-error corefile yes"
3299 +set line [gdb_get_line_number "break-here"]
3302 +mi_gdb_test "-break-insert -t $srcfile:$line" \
3303 + "\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",fullname=\".*\",line=\"$line\",\[^\r\n\]*,original-location=\".*\"\}" \
3304 + "breakpoint at $func"
3306 +if { [mi_run_cmd] < 0 } {
3309 +mi_expect_stop "breakpoint-hit" $func ".*" ".*" "\[0-9\]+" { "" "disp=\"del\"" } "stop after initializing vla"
3311 +mi_create_varobj "vla" "vla" "create local variable vla"
3313 +mi_gdb_test "-var-update *" "\\^done,changelist=.*" "-var-update *"
3314 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register-func.c
3315 ===================================================================
3316 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3317 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register-func.c 2017-02-26 19:15:36.604882366 +0100
3319 +/* This file is part of GDB, the GNU debugger.
3321 + Copyright 2009 Free Software Foundation, Inc.
3323 + This program is free software; you can redistribute it and/or modify
3324 + it under the terms of the GNU General Public License as published by
3325 + the Free Software Foundation; either version 3 of the License, or
3326 + (at your option) any later version.
3328 + This program is distributed in the hope that it will be useful,
3329 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3330 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3331 + GNU General Public License for more details.
3333 + You should have received a copy of the GNU General Public License
3334 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
3341 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.c
3342 ===================================================================
3343 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3344 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.c 2017-02-26 19:15:36.605882373 +0100
3346 +/* This file is part of GDB, the GNU debugger.
3348 + Copyright 2009 Free Software Foundation, Inc.
3350 + This program is free software; you can redistribute it and/or modify
3351 + it under the terms of the GNU General Public License as published by
3352 + the Free Software Foundation; either version 3 of the License, or
3353 + (at your option) any later version.
3355 + This program is distributed in the hope that it will be useful,
3356 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3357 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3358 + GNU General Public License for more details.
3360 + You should have received a copy of the GNU General Public License
3361 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
3363 +extern int func (int *arr);
3368 + int arr[] = { 42 };
3374 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.exp
3375 ===================================================================
3376 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3377 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.exp 2017-02-26 19:15:36.605882373 +0100
3379 +# Copyright 2009 Free Software Foundation, Inc.
3381 +# This program is free software; you can redistribute it and/or modify
3382 +# it under the terms of the GNU General Public License as published by
3383 +# the Free Software Foundation; either version 2 of the License, or
3384 +# (at your option) any later version.
3386 +# This program is distributed in the hope that it will be useful,
3387 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
3388 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3389 +# GNU General Public License for more details.
3391 +# You should have received a copy of the GNU General Public License
3392 +# along with this program; if not, write to the Free Software
3393 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3395 +# This file is part of the gdb testsuite.
3397 +if { [prepare_for_testing array-from-register.exp "array-from-register" \
3398 + {array-from-register.c array-from-register-func.c} \
3399 + {debug optimize=-O2}] } {
3403 +if ![runto func] then {
3407 +gdb_test "p arr" "\\$\[0-9\]+ = \\(int \\*\\) *0x\[0-9a-f\]+"
3410 +# Address requested for identifier "arr" which is in register $rdi
3411 +gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42"
3412 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.exp
3413 ===================================================================
3414 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3415 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.exp 2017-02-26 19:15:36.605882373 +0100
3417 +# Copyright 2009 Free Software Foundation, Inc.
3419 +# This program is free software; you can redistribute it and/or modify
3420 +# it under the terms of the GNU General Public License as published by
3421 +# the Free Software Foundation; either version 2 of the License, or
3422 +# (at your option) any later version.
3424 +# This program is distributed in the hope that it will be useful,
3425 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
3426 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3427 +# GNU General Public License for more details.
3429 +# You should have received a copy of the GNU General Public License
3430 +# along with this program; if not, write to the Free Software
3431 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3433 +# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
3435 +# Test GDB can cope with Fortran strings having their length present in a CPU
3436 +# register. With -O0 the string length is passed on the stack. To make this
3437 +# test meaningful the follow assertion should pass. It is not being checked
3438 +# here as the "_s" symbol is compiler dependent:
3439 +# (gdb) info address _s
3440 +# Symbol "_s" is a variable in register XX.
3442 +set test fortran-string
3443 +set srcfile ${test}.f90
3444 +if { [prepare_for_testing ${test}.exp ${test} ${srcfile} {debug f90 additional_flags=-O2}] } {
3448 +if ![runto $srcfile:[gdb_get_line_number "s = s"]] then {
3449 + perror "couldn't run to breakpoint MAIN__"
3453 +gdb_test "frame" ".*s='foo'.*"
3454 +gdb_test "ptype s" "type = character\\*3"
3455 +gdb_test "p s" "\\$\[0-9\]* = 'foo'"
3456 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.f90
3457 ===================================================================
3458 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3459 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.f90 2017-02-26 19:15:36.605882373 +0100
3461 +! Copyright 2009 Free Software Foundation, Inc.
3463 +! This program is free software; you can redistribute it and/or modify
3464 +! it under the terms of the GNU General Public License as published by
3465 +! the Free Software Foundation; either version 2 of the License, or
3466 +! (at your option) any later version.
3468 +! This program is distributed in the hope that it will be useful,
3469 +! but WITHOUT ANY WARRANTY; without even the implied warranty of
3470 +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3471 +! GNU General Public License for more details.
3473 +! You should have received a copy of the GNU General Public License
3474 +! along with this program; if not, write to the Free Software
3475 +! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3477 +! Ihis file is the Fortran source file for dynamic.exp.
3478 +! Original file written by Jakub Jelinek <jakub@redhat.com>.
3479 +! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
3489 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.exp
3490 ===================================================================
3491 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3492 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.exp 2017-02-26 19:15:36.605882373 +0100
3494 +# Copyright 2008, 2009 Free Software Foundation, Inc.
3496 +# This program is free software; you can redistribute it and/or modify
3497 +# it under the terms of the GNU General Public License as published by
3498 +# the Free Software Foundation; either version 3 of the License, or
3499 +# (at your option) any later version.
3501 +# This program is distributed in the hope that it will be useful,
3502 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
3503 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3504 +# GNU General Public License for more details.
3506 +# You should have received a copy of the GNU General Public License
3507 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
3509 +if $tracelevel then {
3510 + strace $tracelevel
3513 +load_lib "pascal.exp"
3515 +set testfile "arrays"
3516 +set srcfile ${testfile}.pas
3517 +set binfile [standard_output_file ${testfile}$EXEEXT]
3519 +# These tests only work with fpc, using the -gw3 compile-option
3521 +if { $pascal_compiler_is_fpc != 1 } {
3525 +# Detect if the fpc version is below 2.3.0
3526 +set fpc_generates_dwarf_for_dynamic_arrays 1
3527 +if { ($fpcversion_major < 2) || ( ($fpcversion_major == 2) && ($fpcversion_minor < 3))} {
3528 + set fpc_generates_dwarf_for_dynamic_arrays 0
3532 +if {[gdb_compile_pascal "-gw3 ${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } {
3538 +gdb_reinitialize_dir $srcdir/$subdir
3539 +gdb_load ${binfile}
3540 +set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
3541 +set bp_location2 [gdb_get_line_number "set breakpoint 2 here"]
3544 +if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
3545 + pass "setting breakpoint 1"
3547 +if { [gdb_breakpoint ${srcfile}:${bp_location2}] } {
3548 + pass "setting breakpoint 2"
3551 +# Verify that "start" lands inside the right procedure.
3552 +if { [gdb_start_cmd] < 0 } {
3557 +gdb_test "" ".* at .*${srcfile}.*" "start"
3559 +gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint"
3561 +gdb_test "print StatArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer type"
3562 +gdb_test "print StatArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer"
3564 +gdb_test "cont" "Breakpoint .*:${bp_location2}.*" "Going to second breakpoint"
3566 +gdb_test "print StatArrChar" ".* = 'abcdefghijkl'" "Print static array of char"
3567 +gdb_test "print Stat2dArrInt" ".* = \\{\\{0, 1, 2, 3, 4\\}, \\{1, 2, 3, 4, 5\\}, \\{2, 3, 4, 5, 6\\}, \\{3, 4, 5, 6, 7\\}, \\{4, 5, 6, 7, 8\\}, \\{5, 6, 7, 8, 9\\}, \\{6, 7, 8, 9, 10\\}, \\{7, 8, 9, 10, 11\\}, \\{8, 9, 10, 11, 12\\}, \\{9, 10, 11, 12, 13\\}, \\{10, 11, 12, 13, 14\\}, \\{11, 12, 13, 14, 15\\}\\}" "Print static 2-dimensional array of integer"
3569 +if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
3570 + setup_xfail "*-*-*"
3572 +gdb_test "print DynArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer type"
3573 +if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
3574 + setup_xfail "*-*-*"
3576 +gdb_test "print DynArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer"
3578 +if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
3579 + setup_xfail "*-*-*"
3581 +gdb_test "print s" ".* = 'test'#0'string'" "Print string containing null-char"
3583 +if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
3584 + setup_xfail "*-*-*"
3586 +gdb_test "print DynArrStr" ".* = \\{'dstr0', 'dstr1', 'dstr2', 'dstr3', 'dstr4', 'dstr5', 'dstr6', 'dstr7', 'dstr8', 'dstr9', 'dstr10', 'dstr11', 'dstr12'\\}" "Print dynamic array of string"
3588 +if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
3589 + setup_xfail "*-*-*"
3591 +gdb_test "print StatArrStr" ".* = \\{'str0', 'str1', 'str2', 'str3', 'str4', 'str5', 'str6', 'str7', 'str8', 'str9', 'str10', 'str11', 'str12'\\}" "Print static array of string"
3593 +if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
3594 + setup_xfail "*-*-*"
3596 +gdb_test "print DynArrChar" ".* = 'abcdefghijklm'" "Print dynamic array of char"
3598 Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.pas
3599 ===================================================================
3600 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3601 +++ gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.pas 2017-02-26 19:15:36.605882373 +0100
3604 + Copyright 2008, 2009 Free Software Foundation, Inc.
3606 + This program is free software; you can redistribute it and/or modify
3607 + it under the terms of the GNU General Public License as published by
3608 + the Free Software Foundation; either version 3 of the License, or
3609 + (at your option) any later version.
3611 + This program is distributed in the hope that it will be useful,
3612 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3613 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3614 + GNU General Public License for more details.
3616 + You should have received a copy of the GNU General Public License
3617 + along with this program. If not, see <http://www.gnu.org/licenses/>.
3622 +{$mode objfpc}{$h+}
3626 +type TStatArrInt= array[0..11] of integer;
3627 + TDynArrInt= array of integer;
3628 + TStatArrStr= array[0..12] of string;
3629 + TDynArrStr= array of string;
3630 + TDynArrChar = array of char;
3631 + TStatArrChar = array [0..11] of char;
3633 + TStat2dArrInt = array[0..11,0..4] of integer;
3635 +var StatArrInt: TStatArrInt;
3636 + StatArrInt_: Array[0..11] of integer;
3637 + DynArrInt: TDynArrInt;
3638 + DynArrInt_: Array of integer;
3639 + StatArrStr: TStatArrStr;
3640 + DynArrStr: TDynArrStr;
3641 + StatArrChar: TStatArrChar;
3642 + DynArrChar: TDynArrChar;
3644 + Stat2dArrInt: TStat2dArrInt;
3651 + for i := 0 to 11 do
3653 + StatArrInt[i]:= i+50;
3654 + StatArrInt_[i]:= i+50;
3655 + StatArrChar[i]:= chr(ord('a')+i);
3656 + for j := 0 to 4 do
3657 + Stat2dArrInt[i,j]:=i+j;
3659 + writeln(StatArrInt_[0]);
3660 + writeln(StatArrInt[0]); { set breakpoint 1 here }
3661 + writeln(StatArrChar[0]);
3662 + writeln(Stat2dArrInt[0,0]);
3664 + setlength(DynArrInt,13);
3665 + setlength(DynArrInt_,13);
3666 + setlength(DynArrStr,13);
3667 + setlength(DynArrChar,13);
3668 + for i := 0 to 12 do
3670 + DynArrInt[i]:= i+50;
3671 + DynArrInt_[i]:= i+50;
3672 + DynArrChar[i]:= chr(ord('a')+i);
3673 + StatArrStr[i]:='str'+inttostr(i);
3674 + DynArrStr[i]:='dstr'+inttostr(i);
3676 + writeln(DynArrInt_[1]);
3677 + writeln(DynArrInt[1]);
3678 + writeln(DynArrStr[1]);
3679 + writeln(StatArrStr[1]);
3680 + writeln(DynArrChar[1]);
3682 + s := 'test'#0'string';
3683 + writeln(s); { set breakpoint 2 here }
3685 Index: gdb-7.12.50.20170207/gdb/testsuite/lib/gdb.exp
3686 ===================================================================
3687 --- gdb-7.12.50.20170207.orig/gdb/testsuite/lib/gdb.exp 2017-02-26 19:15:28.564824836 +0100
3688 +++ gdb-7.12.50.20170207/gdb/testsuite/lib/gdb.exp 2017-02-26 19:15:36.607882387 +0100
3689 @@ -178,6 +178,11 @@
3693 + -re "A program is being debugged already..*Are you sure you want to change the file.*y or n. $"\
3695 + verbose "\t\tUnloading symbols for program being debugged"
3698 -re "Discard symbol table from .*y or n.*$" {
3701 Index: gdb-7.12.50.20170207/gdb/testsuite/lib/pascal.exp
3702 ===================================================================
3703 --- gdb-7.12.50.20170207.orig/gdb/testsuite/lib/pascal.exp 2017-02-26 19:15:28.565824844 +0100
3704 +++ gdb-7.12.50.20170207/gdb/testsuite/lib/pascal.exp 2017-02-26 19:15:36.607882387 +0100
3706 global pascal_compiler_is_fpc
3709 + global fpcversion_major
3710 + global fpcversion_minor
3711 + global fpcversion_release
3714 if { $pascal_init_done == 1 } {
3716 set pascal_compiler_is_fpc 1
3717 verbose -log "Free Pascal compiler found"
3720 + # Detect the fpc-version
3721 + if { $pascal_compiler_is_fpc == 1 } {
3722 + set fpcversion_major 1
3723 + set fpcversion_minor 0
3724 + set fpcversion_release 0
3725 + set fpcversion [ remote_exec host $fpc_compiler "-iV" ]
3726 + if [regexp {.*([0-9]+)\.([0-9]+)\.([0-9]+).?} $fpcversion] {
3727 + regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\1} fpcversion_major
3728 + regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\2} fpcversion_minor
3729 + regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\3} fpcversion_release
3731 + verbose -log "Freepascal version: $fpcversion_major.$fpcversion_minor.$fpcversion_release"
3734 set pascal_init_done 1