Blame SOURCES/gdb-archer-vla-tests.patch

f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.ada/packed_array.exp
f9426a
===================================================================
f9426a
--- gdb-7.7.90.20140613.orig/gdb/testsuite/gdb.ada/packed_array.exp	2014-06-13 03:59:37.000000000 +0200
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.ada/packed_array.exp	2014-06-16 23:30:30.107940483 +0200
f9426a
@@ -56,5 +56,11 @@ gdb_test_multiple "$test" "$test" {
f9426a
         # are.  Observed with (FSF GNU Ada 4.5.3 20110124).
f9426a
         xfail $test
f9426a
     }
f9426a
+    -re "= \\(\\)\[\r\n\]+$gdb_prompt $" {
f9426a
+	# archer-jankratochvil-vla resolves it as a dynamic type resolved as an
f9426a
+	# empty array [0..-1].
f9426a
+	# DW_AT_upper_bound : (DW_OP_fbreg: -48; DW_OP_deref)
f9426a
+        xfail $test
f9426a
+    }
f9426a
 }
f9426a
 
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S	2014-06-16 23:30:30.108940484 +0200
f9426a
@@ -0,0 +1,455 @@
f9426a
+	.file	"x86_64-vla-typedef.c"
f9426a
+	.section	.debug_abbrev,"",@progbits
f9426a
+.Ldebug_abbrev0:
f9426a
+	.section	.debug_info,"",@progbits
f9426a
+.Ldebug_info0:
f9426a
+	.section	.debug_line,"",@progbits
f9426a
+.Ldebug_line0:
f9426a
+	.text
f9426a
+.Ltext0:
f9426a
+.globl foo
f9426a
+	.type	foo, @function
f9426a
+foo:
f9426a
+.LFB2:
f9426a
+	.file 1 "x86_64-vla-typedef.c"
f9426a
+	.loc 1 22 0
f9426a
+	pushq	%rbp
f9426a
+.LCFI0:
f9426a
+	movq	%rsp, %rbp
f9426a
+.LCFI1:
f9426a
+	subq	$64, %rsp
f9426a
+.LCFI2:
f9426a
+	movl	%edi, -36(%rbp)
f9426a
+	.loc 1 22 0
f9426a
+	movq	%rsp, %rax
f9426a
+	movq	%rax, -48(%rbp)
f9426a
+	.loc 1 23 0
f9426a
+	movl	-36(%rbp), %edx
f9426a
+	movslq	%edx,%rax
f9426a
+	subq	$1, %rax
f9426a
+	movq	%rax, -24(%rbp)
f9426a
+	.loc 1 24 0
f9426a
+	movslq	%edx,%rax
f9426a
+	addq	$15, %rax
f9426a
+	addq	$15, %rax
f9426a
+	shrq	$4, %rax
f9426a
+	salq	$4, %rax
f9426a
+	subq	%rax, %rsp
f9426a
+	movq	%rsp, -56(%rbp)
f9426a
+	movq	-56(%rbp), %rax
f9426a
+	addq	$15, %rax
f9426a
+	shrq	$4, %rax
f9426a
+	salq	$4, %rax
f9426a
+	movq	%rax, -56(%rbp)
f9426a
+	movq	-56(%rbp), %rax
f9426a
+	movq	%rax, -16(%rbp)
f9426a
+	.loc 1 27 0
f9426a
+	movl	$0, -4(%rbp)
f9426a
+	jmp	.L2
f9426a
+.L3:
f9426a
+	.loc 1 28 0
f9426a
+	movl	-4(%rbp), %esi
f9426a
+	movl	-4(%rbp), %eax
f9426a
+	movl	%eax, %ecx
f9426a
+	movq	-16(%rbp), %rdx
f9426a
+	movslq	%esi,%rax
f9426a
+	movb	%cl, (%rdx,%rax)
f9426a
+	.loc 1 27 0
f9426a
+	addl	$1, -4(%rbp)
f9426a
+.L2:
f9426a
+	movl	-4(%rbp), %eax
f9426a
+	cmpl	-36(%rbp), %eax
f9426a
+	jl	.L3
f9426a
+	.loc 1 30 0
f9426a
+	.globl	break_here
f9426a
+break_here:
f9426a
+	movq	-16(%rbp), %rax
f9426a
+	movb	$0, (%rax)
f9426a
+	movq	-48(%rbp), %rsp
f9426a
+	.loc 1 31 0
f9426a
+	leave
f9426a
+	ret
f9426a
+.LFE2:
f9426a
+	.size	foo, .-foo
f9426a
+	.section	.debug_frame,"",@progbits
f9426a
+.Lframe0:
f9426a
+	.long	.LECIE0-.LSCIE0
f9426a
+.LSCIE0:
f9426a
+	.long	0xffffffff
f9426a
+	.byte	0x1
f9426a
+	.string	""
f9426a
+	.uleb128 0x1
f9426a
+	.sleb128 -8
f9426a
+	.byte	0x10
f9426a
+	.byte	0xc
f9426a
+	.uleb128 0x7
f9426a
+	.uleb128 0x8
f9426a
+	.byte	0x90
f9426a
+	.uleb128 0x1
f9426a
+	.align 8
f9426a
+.LECIE0:
f9426a
+.LSFDE0:
f9426a
+	.long	.LEFDE0-.LASFDE0
f9426a
+.LASFDE0:
f9426a
+	.long	.Lframe0
f9426a
+	.quad	.LFB2
f9426a
+	.quad	.LFE2-.LFB2
f9426a
+	.byte	0x4
f9426a
+	.long	.LCFI0-.LFB2
f9426a
+	.byte	0xe
f9426a
+	.uleb128 0x10
f9426a
+	.byte	0x86
f9426a
+	.uleb128 0x2
f9426a
+	.byte	0x4
f9426a
+	.long	.LCFI1-.LCFI0
f9426a
+	.byte	0xd
f9426a
+	.uleb128 0x6
f9426a
+	.align 8
f9426a
+.LEFDE0:
f9426a
+	.section	.eh_frame,"a",@progbits
f9426a
+.Lframe1:
f9426a
+	.long	.LECIE1-.LSCIE1
f9426a
+.LSCIE1:
f9426a
+	.long	0x0
f9426a
+	.byte	0x1
f9426a
+	.string	"zR"
f9426a
+	.uleb128 0x1
f9426a
+	.sleb128 -8
f9426a
+	.byte	0x10
f9426a
+	.uleb128 0x1
f9426a
+	.byte	0x3
f9426a
+	.byte	0xc
f9426a
+	.uleb128 0x7
f9426a
+	.uleb128 0x8
f9426a
+	.byte	0x90
f9426a
+	.uleb128 0x1
f9426a
+	.align 8
f9426a
+.LECIE1:
f9426a
+.LSFDE1:
f9426a
+	.long	.LEFDE1-.LASFDE1
f9426a
+.LASFDE1:
f9426a
+	.long	.LASFDE1-.Lframe1
f9426a
+	.long	.LFB2
f9426a
+	.long	.LFE2-.LFB2
f9426a
+	.uleb128 0x0
f9426a
+	.byte	0x4
f9426a
+	.long	.LCFI0-.LFB2
f9426a
+	.byte	0xe
f9426a
+	.uleb128 0x10
f9426a
+	.byte	0x86
f9426a
+	.uleb128 0x2
f9426a
+	.byte	0x4
f9426a
+	.long	.LCFI1-.LCFI0
f9426a
+	.byte	0xd
f9426a
+	.uleb128 0x6
f9426a
+	.align 8
f9426a
+.LEFDE1:
f9426a
+	.text
f9426a
+.Letext0:
f9426a
+	.section	.debug_loc,"",@progbits
f9426a
+.Ldebug_loc0:
f9426a
+.LLST0:
f9426a
+	.quad	.LFB2-.Ltext0
f9426a
+	.quad	.LCFI0-.Ltext0
f9426a
+	.value	0x2
f9426a
+	.byte	0x77
f9426a
+	.sleb128 8
f9426a
+	.quad	.LCFI0-.Ltext0
f9426a
+	.quad	.LCFI1-.Ltext0
f9426a
+	.value	0x2
f9426a
+	.byte	0x77
f9426a
+	.sleb128 16
f9426a
+	.quad	.LCFI1-.Ltext0
f9426a
+	.quad	.LFE2-.Ltext0
f9426a
+	.value	0x2
f9426a
+	.byte	0x76
f9426a
+	.sleb128 16
f9426a
+	.quad	0x0
f9426a
+	.quad	0x0
f9426a
+	.section	.debug_info
f9426a
+	.long	.Ldebug_end - .Ldebug_start
f9426a
+.Ldebug_start:
f9426a
+	.value	0x2
f9426a
+	.long	.Ldebug_abbrev0
f9426a
+	.byte	0x8
f9426a
+	.uleb128 0x1
f9426a
+	.long	.LASF2
f9426a
+	.byte	0x1
f9426a
+	.long	.LASF3
f9426a
+	.long	.LASF4
f9426a
+	.quad	.Ltext0
f9426a
+	.quad	.Letext0
f9426a
+	.long	.Ldebug_line0
f9426a
+	.uleb128 0x2
f9426a
+	.byte	0x1
f9426a
+	.string	"foo"
f9426a
+	.byte	0x1
f9426a
+	.byte	0x16
f9426a
+	.byte	0x1
f9426a
+	.quad	.LFB2
f9426a
+	.quad	.LFE2
f9426a
+	.long	.LLST0
f9426a
+	.long	0x83
f9426a
+	.uleb128 0x3
f9426a
+	.long	.LASF5
f9426a
+	.byte	0x1
f9426a
+	.byte	0x15
f9426a
+	.long	0x83
f9426a
+	.byte	0x2
f9426a
+	.byte	0x91
f9426a
+	.sleb128 -52
f9426a
+.Ltag_typedef:
f9426a
+	.uleb128 0x4
f9426a
+	.long	.LASF6
f9426a
+	.byte	0x1
f9426a
+	.byte	0x17
f9426a
+	.long	.Ltag_array_type - .debug_info
f9426a
+	.uleb128 0x5	/* Abbrev Number: 5 (DW_TAG_variable) */
f9426a
+	.long	.LASF0
f9426a
+	.byte	0x1
f9426a
+	.byte	0x18
f9426a
+#if 1
f9426a
+	.long	.Ltag_typedef - .debug_info
f9426a
+#else
f9426a
+	/* Debugging only: Skip the typedef indirection.  */
f9426a
+	.long	.Ltag_array_type - .debug_info
f9426a
+#endif
f9426a
+	/* DW_AT_location: DW_FORM_block1: start */
f9426a
+	.byte	0x3
f9426a
+	.byte	0x91
f9426a
+	.sleb128 -32
f9426a
+#if 0
f9426a
+	.byte	0x6	/* DW_OP_deref */
f9426a
+#else
f9426a
+	.byte	0x96	/* DW_OP_nop */
f9426a
+#endif
f9426a
+	/* DW_AT_location: DW_FORM_block1: end */
f9426a
+	.uleb128 0x6
f9426a
+	.string	"i"
f9426a
+	.byte	0x1
f9426a
+	.byte	0x19
f9426a
+	.long	0x83
f9426a
+	.byte	0x2
f9426a
+	.byte	0x91
f9426a
+	.sleb128 -20
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x7
f9426a
+	.byte	0x4
f9426a
+	.byte	0x5
f9426a
+	.string	"int"
f9426a
+.Ltag_array_type:
f9426a
+	.uleb128 0x8	/* Abbrev Number: 8 (DW_TAG_array_type) */
f9426a
+	.long	0xa0 + (2f - 1f)	/* DW_AT_type: DW_FORM_ref4 */
f9426a
+	.long	0x9d + (2f - 1f)	/* DW_AT_sibling: DW_FORM_ref4 */
f9426a
+1:	/* DW_AT_data_location: DW_FORM_block1: start */
f9426a
+	.byte	2f - 3f	/* length */
f9426a
+3:
f9426a
+	.byte	0x97	/* DW_OP_push_object_address */
f9426a
+	.byte	0x6	/* DW_OP_deref */
f9426a
+2:	/* DW_AT_data_location: DW_FORM_block1: end */
f9426a
+	.uleb128 0x9
f9426a
+	.long	0x9d + (2b - 1b)	/* DW_AT_type: DW_FORM_ref4 */
f9426a
+	.byte	0x3
f9426a
+	.byte	0x91
f9426a
+	.sleb128 -40
f9426a
+	.byte	0x6
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0xa
f9426a
+	.byte	0x8
f9426a
+	.byte	0x7
f9426a
+	.uleb128 0xb
f9426a
+	.byte	0x1
f9426a
+	.byte	0x6
f9426a
+	.long	.LASF1
f9426a
+	.byte	0x0
f9426a
+.Ldebug_end:
f9426a
+	.section	.debug_abbrev
f9426a
+	.uleb128 0x1
f9426a
+	.uleb128 0x11
f9426a
+	.byte	0x1
f9426a
+	.uleb128 0x25
f9426a
+	.uleb128 0xe
f9426a
+	.uleb128 0x13
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x3
f9426a
+	.uleb128 0xe
f9426a
+	.uleb128 0x1b
f9426a
+	.uleb128 0xe
f9426a
+	.uleb128 0x11
f9426a
+	.uleb128 0x1
f9426a
+	.uleb128 0x12
f9426a
+	.uleb128 0x1
f9426a
+	.uleb128 0x10
f9426a
+	.uleb128 0x6
f9426a
+	.byte	0x0
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x2
f9426a
+	.uleb128 0x2e
f9426a
+	.byte	0x1
f9426a
+	.uleb128 0x3f
f9426a
+	.uleb128 0xc
f9426a
+	.uleb128 0x3
f9426a
+	.uleb128 0x8
f9426a
+	.uleb128 0x3a
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x3b
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x27
f9426a
+	.uleb128 0xc
f9426a
+	.uleb128 0x11
f9426a
+	.uleb128 0x1
f9426a
+	.uleb128 0x12
f9426a
+	.uleb128 0x1
f9426a
+	.uleb128 0x40
f9426a
+	.uleb128 0x6
f9426a
+	.uleb128 0x1
f9426a
+	.uleb128 0x13
f9426a
+	.byte	0x0
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x3
f9426a
+	.uleb128 0x5
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x3
f9426a
+	.uleb128 0xe
f9426a
+	.uleb128 0x3a
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x3b
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x49
f9426a
+	.uleb128 0x13
f9426a
+	.uleb128 0x2
f9426a
+	.uleb128 0xa
f9426a
+	.byte	0x0
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x4
f9426a
+	.uleb128 0x16
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x3
f9426a
+	.uleb128 0xe
f9426a
+	.uleb128 0x3a
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x3b
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x49
f9426a
+	.uleb128 0x13
f9426a
+	.byte	0x0
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x5
f9426a
+	.uleb128 0x34
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x3
f9426a
+	.uleb128 0xe
f9426a
+	.uleb128 0x3a
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x3b
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x49
f9426a
+	.uleb128 0x13
f9426a
+	.uleb128 0x2
f9426a
+	.uleb128 0xa
f9426a
+	.byte	0x0
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x6
f9426a
+	.uleb128 0x34
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x3
f9426a
+	.uleb128 0x8
f9426a
+	.uleb128 0x3a
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x3b
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x49
f9426a
+	.uleb128 0x13
f9426a
+	.uleb128 0x2
f9426a
+	.uleb128 0xa
f9426a
+	.byte	0x0
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x7
f9426a
+	.uleb128 0x24
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x3e
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x3
f9426a
+	.uleb128 0x8
f9426a
+	.byte	0x0
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x8	/* Abbrev Number: 8 (DW_TAG_array_type) */
f9426a
+	.uleb128 0x1
f9426a
+	.byte	0x1
f9426a
+	.uleb128 0x49	/* DW_AT_type */
f9426a
+	.uleb128 0x13	/* DW_FORM_ref4 */
f9426a
+	.uleb128 0x1	/* DW_AT_sibling */
f9426a
+	.uleb128 0x13	/* DW_FORM_ref4 */
f9426a
+	.uleb128 0x50	/* DW_AT_data_location */
f9426a
+	.uleb128 0xa	/* DW_FORM_block1 */
f9426a
+	.byte	0x0
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x9
f9426a
+	.uleb128 0x21
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0x49	/* DW_AT_type */
f9426a
+	.uleb128 0x13	/* DW_FORM_ref4 */
f9426a
+	.uleb128 0x2f
f9426a
+	.uleb128 0xa
f9426a
+	.byte	0x0
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0xa
f9426a
+	.uleb128 0x24
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x3e
f9426a
+	.uleb128 0xb
f9426a
+	.byte	0x0
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x24
f9426a
+	.byte	0x0
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x3e
f9426a
+	.uleb128 0xb
f9426a
+	.uleb128 0x3
f9426a
+	.uleb128 0xe
f9426a
+	.byte	0x0
f9426a
+	.byte	0x0
f9426a
+	.byte	0x0
f9426a
+	.section	.debug_pubnames,"",@progbits
f9426a
+	.long	0x16
f9426a
+	.value	0x2
f9426a
+	.long	.Ldebug_info0
f9426a
+	.long	0xa8
f9426a
+	.long	0x2d
f9426a
+	.string	"foo"
f9426a
+	.long	0x0
f9426a
+	.section	.debug_aranges,"",@progbits
f9426a
+	.long	0x2c
f9426a
+	.value	0x2
f9426a
+	.long	.Ldebug_info0
f9426a
+	.byte	0x8
f9426a
+	.byte	0x0
f9426a
+	.value	0x0
f9426a
+	.value	0x0
f9426a
+	.quad	.Ltext0
f9426a
+	.quad	.Letext0-.Ltext0
f9426a
+	.quad	0x0
f9426a
+	.quad	0x0
f9426a
+	.section	.debug_str,"MS",@progbits,1
f9426a
+.LASF0:
f9426a
+	.string	"array"
f9426a
+.LASF5:
f9426a
+	.string	"size"
f9426a
+.LASF3:
f9426a
+	.string	"x86_64-vla-typedef.c"
f9426a
+.LASF6:
f9426a
+	.string	"array_t"
f9426a
+.LASF1:
f9426a
+	.string	"char"
f9426a
+.LASF4:
f9426a
+	.string	"gdb.arch"
f9426a
+.LASF2:
f9426a
+	.string	"GNU C 4.3.2 20081105 (Red Hat 4.3.2-7)"
f9426a
+	.ident	"GCC: (GNU) 4.3.2 20081105 (Red Hat 4.3.2-7)"
f9426a
+	.section	.note.GNU-stack,"",@progbits
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c	2014-06-16 23:30:30.109940484 +0200
f9426a
@@ -0,0 +1,43 @@
f9426a
+/* This testcase is part of GDB, the GNU debugger.
f9426a
+
f9426a
+   Copyright 2008 Free Software Foundation, Inc.
f9426a
+
f9426a
+   This program is free software; you can redistribute it and/or modify
f9426a
+   it under the terms of the GNU General Public License as published by
f9426a
+   the Free Software Foundation; either version 3 of the License, or
f9426a
+   (at your option) any later version.
f9426a
+
f9426a
+   This program is distributed in the hope that it will be useful,
f9426a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+   GNU General Public License for more details.
f9426a
+
f9426a
+   You should have received a copy of the GNU General Public License
f9426a
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
f9426a
+
f9426a
+#if 0
f9426a
+
f9426a
+void
f9426a
+foo (int size)
f9426a
+{
f9426a
+  typedef char array_t[size];
f9426a
+  array_t array;
f9426a
+  int i;
f9426a
+
f9426a
+  for (i = 0; i < size; i++)
f9426a
+    array[i] = i;
f9426a
+
f9426a
+  array[0] = 0;	/* break-here */
f9426a
+}
f9426a
+
f9426a
+#else
f9426a
+
f9426a
+int
f9426a
+main (void)
f9426a
+{
f9426a
+  foo (26);
f9426a
+  foo (78);
f9426a
+  return 0;
f9426a
+}
f9426a
+
f9426a
+#endif
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp	2014-06-16 23:30:30.109940484 +0200
f9426a
@@ -0,0 +1,64 @@
f9426a
+# Copyright 2009 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 3 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+#
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+#
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
f9426a
+
f9426a
+# Test DW_AT_data_location accessed through DW_TAG_typedef intermediate.
f9426a
+
f9426a
+if ![istarget "x86_64-*-*"] then {
f9426a
+    verbose "Skipping over gdb.arch/x86_64-vla-typedef.exp test made only for x86_64."
f9426a
+    return
f9426a
+}
f9426a
+
f9426a
+set testfile x86_64-vla-typedef
f9426a
+set srcasmfile ${testfile}-foo.S
f9426a
+set srcfile ${testfile}.c
f9426a
+set binfile ${objdir}/${subdir}/${testfile}
f9426a
+set binobjfile ${objdir}/${subdir}/${testfile}-foo.o
f9426a
+if  { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } {
f9426a
+    untested "Couldn't compile test program"
f9426a
+    return -1
f9426a
+}
f9426a
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {debug}] != "" } {
f9426a
+    untested "Couldn't compile test program"
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+gdb_exit
f9426a
+gdb_start
f9426a
+gdb_reinitialize_dir $srcdir/$subdir
f9426a
+gdb_load ${binfile}
f9426a
+
f9426a
+if ![runto_main] {
f9426a
+    untested x86_64-vla-typedef
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+gdb_breakpoint "break_here"
f9426a
+
f9426a
+gdb_continue_to_breakpoint "break_here"
f9426a
+
f9426a
+gdb_test "whatis array" "type = array_t" "first: whatis array"
f9426a
+
f9426a
+gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array"
f9426a
+
f9426a
+gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'"
f9426a
+gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'"
f9426a
+gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'"
f9426a
+gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'"
f9426a
+
f9426a
+gdb_continue_to_breakpoint "break_here"
f9426a
+
f9426a
+gdb_test "whatis array" "type = array_t" "second: whatis array"
f9426a
+
f9426a
+gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/arrayidx.c
f9426a
===================================================================
f9426a
--- gdb-7.7.90.20140613.orig/gdb/testsuite/gdb.base/arrayidx.c	2014-06-13 03:59:37.000000000 +0200
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/arrayidx.c	2014-06-16 23:30:30.109940484 +0200
f9426a
@@ -17,6 +17,13 @@
f9426a
 
f9426a
 int array[] = {1, 2, 3, 4};
f9426a
 
f9426a
+#ifdef __GNUC__
f9426a
+struct
f9426a
+  {
f9426a
+    int a[0];
f9426a
+  } unbound;
f9426a
+#endif
f9426a
+
f9426a
 int
f9426a
 main (void)
f9426a
 {
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/arrayidx.exp
f9426a
===================================================================
f9426a
--- gdb-7.7.90.20140613.orig/gdb/testsuite/gdb.base/arrayidx.exp	2014-06-13 03:59:37.000000000 +0200
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/arrayidx.exp	2014-06-16 23:30:30.109940484 +0200
f9426a
@@ -49,4 +49,12 @@ gdb_test "print array" \
f9426a
          "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \
f9426a
          "Print array with array-indexes on"
f9426a
 
f9426a
-
f9426a
+set test "p unbound.a == &unbound.a\[0\]"
f9426a
+gdb_test_multiple $test $test {
f9426a
+    -re " = 1\r\n$gdb_prompt $" {
f9426a
+	pass $test
f9426a
+    }
f9426a
+    -re "No symbol \"unbound\" in current context.\r\n$gdb_prompt $" {
f9426a
+	unsupported "$test (no GCC)"
f9426a
+    }
f9426a
+}
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/internal-var-field-address.c
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/internal-var-field-address.c	2014-06-16 23:30:30.109940484 +0200
f9426a
@@ -0,0 +1,20 @@
f9426a
+/* This testcase is part of GDB, the GNU debugger.
f9426a
+
f9426a
+   Copyright 2009 Free Software Foundation, Inc.
f9426a
+
f9426a
+   This program is free software; you can redistribute it and/or modify
f9426a
+   it under the terms of the GNU General Public License as published by
f9426a
+   the Free Software Foundation; either version 3 of the License, or
f9426a
+   (at your option) any later version.
f9426a
+
f9426a
+   This program is distributed in the hope that it will be useful,
f9426a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+   GNU General Public License for more details.
f9426a
+
f9426a
+   You should have received a copy of the GNU General Public License
f9426a
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
f9426a
+
f9426a
+struct {
f9426a
+  int field;
f9426a
+} staticstruct = { 1 };
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/internal-var-field-address.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/internal-var-field-address.exp	2014-06-16 23:30:30.109940484 +0200
f9426a
@@ -0,0 +1,26 @@
f9426a
+# Copyright 2009 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 3 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+#
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+#
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
f9426a
+
f9426a
+set test internal-var-field-address
f9426a
+set binfile ${test}.x
f9426a
+if  { [gdb_compile "${srcdir}/${subdir}/${test}.c" "[standard_output_file ${binfile}]" object {debug}] != "" } {
f9426a
+    untested "Couldn't compile test program"
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+clean_restart $binfile
f9426a
+
f9426a
+gdb_test {set $varstruct = staticstruct}
f9426a
+gdb_test {p $varstruct.field} " = 1"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-frame.c
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-frame.c	2014-06-16 23:30:30.110940485 +0200
f9426a
@@ -0,0 +1,31 @@
f9426a
+/* This testcase is part of GDB, the GNU debugger.
f9426a
+
f9426a
+   Copyright 2011 Free Software Foundation, Inc.
f9426a
+
f9426a
+   This program is free software; you can redistribute it and/or modify
f9426a
+   it under the terms of the GNU General Public License as published by
f9426a
+   the Free Software Foundation; either version 3 of the License, or
f9426a
+   (at your option) any later version.
f9426a
+
f9426a
+   This program is distributed in the hope that it will be useful,
f9426a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+   GNU General Public License for more details.
f9426a
+
f9426a
+   You should have received a copy of the GNU General Public License
f9426a
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
f9426a
+
f9426a
+#include <string.h>
f9426a
+
f9426a
+int
f9426a
+main (int argc, char **argv)
f9426a
+{
f9426a
+  char s[2 + argc];
f9426a
+  void (*f) (char *) = 0;
f9426a
+
f9426a
+  memset (s, 0, sizeof (s));
f9426a
+  s[0] = 'X';
f9426a
+
f9426a
+  f (s);
f9426a
+  return 0;
f9426a
+}
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-frame.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-frame.exp	2014-06-16 23:30:30.110940485 +0200
f9426a
@@ -0,0 +1,38 @@
f9426a
+# Copyright 2011 Free Software Foundation, Inc.
f9426a
+#
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 3 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+#
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+#
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
f9426a
+
f9426a
+set testfile vla-frame
f9426a
+set executable ${testfile}
f9426a
+
f9426a
+if { [prepare_for_testing ${testfile}.exp ${executable}] } {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+if ![runto_main] {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+set test "continue"
f9426a
+gdb_test_multiple $test $test {
f9426a
+    -re "Continuing\\.\r\n\r\nProgram received signal SIGSEGV, Segmentation fault\\.\r\n0x0+ in \\?\\? \\(\\)\r\n$gdb_prompt $" {
f9426a
+	pass $test
f9426a
+    }
f9426a
+    -re "\r\n$gdb_prompt $" {
f9426a
+	untested ${testfile}.exp
f9426a
+	return
f9426a
+    }
f9426a
+}
f9426a
+
f9426a
+gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-overflow.c
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-overflow.c	2014-06-16 23:30:30.110940485 +0200
f9426a
@@ -0,0 +1,30 @@
f9426a
+/* This testcase is part of GDB, the GNU debugger.
f9426a
+
f9426a
+   Copyright 2008 Free Software Foundation, Inc.
f9426a
+
f9426a
+   This program is free software; you can redistribute it and/or modify
f9426a
+   it under the terms of the GNU General Public License as published by
f9426a
+   the Free Software Foundation; either version 3 of the License, or
f9426a
+   (at your option) any later version.
f9426a
+
f9426a
+   This program is distributed in the hope that it will be useful,
f9426a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+   GNU General Public License for more details.
f9426a
+
f9426a
+   You should have received a copy of the GNU General Public License
f9426a
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
f9426a
+
f9426a
+#include <stdlib.h>
f9426a
+
f9426a
+int
f9426a
+main (int argc, char **argv)
f9426a
+{
f9426a
+  int array[argc];
f9426a
+
f9426a
+  array[0] = array[0];
f9426a
+
f9426a
+  abort ();
f9426a
+
f9426a
+  return 0;
f9426a
+}
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-overflow.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-overflow.exp	2014-06-16 23:30:30.110940485 +0200
f9426a
@@ -0,0 +1,109 @@
f9426a
+# Copyright 2008 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 3 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+#
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+#
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
f9426a
+
f9426a
+# We could crash in:
f9426a
+# #0  block_linkage_function (bl=0x0) at ../../gdb/block.c:69
f9426a
+# #1  in dwarf_block_get_frame_base (...) at ../../gdb/dwarf2block.c:97
f9426a
+#   97	  framefunc = block_linkage_function (get_frame_block (frame, NULL));
f9426a
+# #2  in execute_stack_op (...) at ../../gdb/dwarf2expr.c:496
f9426a
+# #3  in dwarf_block_exec_core () at ../../gdb/dwarf2block.c:156
f9426a
+# #4  dwarf_block_exec (...) at ../../gdb/dwarf2block.c:206
f9426a
+# #5  in range_type_count_bound_internal (...) at ../../gdb/gdbtypes.c:1430
f9426a
+# #6  in create_array_type (...) at ../../gdb/gdbtypes.c:840
f9426a
+# ...
f9426a
+# #21 in psymtab_to_symtab (...) at ../../gdb/symfile.c:292
f9426a
+# ...
f9426a
+# #29 in backtrace_command_1 () at ../../gdb/stack.c:1273
f9426a
+
f9426a
+set testfile vla-overflow
f9426a
+set shfile ${objdir}/${subdir}/${testfile}-gdb.sh
f9426a
+set srcfile ${testfile}.c
f9426a
+set binfile ${objdir}/${subdir}/${testfile}
f9426a
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
f9426a
+    untested "Couldn't compile test program"
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+set f [open "|getconf PAGESIZE" "r"]
f9426a
+gets $f pagesize
f9426a
+close $f
f9426a
+
f9426a
+gdb_exit
f9426a
+gdb_start
f9426a
+gdb_reinitialize_dir $srcdir/$subdir
f9426a
+gdb_load ${binfile}
f9426a
+
f9426a
+set pid_of_gdb [exp_pid -i [board_info host fileid]]
f9426a
+
f9426a
+if { [runto_main] < 0 } {
f9426a
+    untested vla-overflow
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+# Get the GDB memory size when we stay at main.
f9426a
+
f9426a
+proc memory_v_pages_get {} {
f9426a
+    global pid_of_gdb pagesize
f9426a
+    set fd [open "/proc/$pid_of_gdb/statm"]
f9426a
+    gets $fd line
f9426a
+    close $fd
f9426a
+    # number of pages of virtual memory
f9426a
+    scan $line "%d" drs
f9426a
+    return $drs
f9426a
+}
f9426a
+
f9426a
+set pages_found [memory_v_pages_get]
f9426a
+
f9426a
+# s390x with glibc-debuginfo.s390x installed used approx. 16MB.
f9426a
+set mb_reserve 40
f9426a
+verbose -log "pages_found = $pages_found, mb_reserve = $mb_reserve"
f9426a
+set kb_found [expr $pages_found * $pagesize / 1024]
f9426a
+set kb_permit [expr $kb_found + 1 * 1024 + $mb_reserve * 1024]
f9426a
+verbose -log "kb_found = $kb_found, kb_permit = $kb_permit"
f9426a
+
f9426a
+# Create the ulimit wrapper.
f9426a
+set f [open $shfile "w"]
f9426a
+puts $f "#! /bin/sh"
f9426a
+puts $f "ulimit -v $kb_permit"
f9426a
+puts $f "exec $GDB \"\$@\""
f9426a
+close $f
f9426a
+remote_exec host "chmod +x $shfile"
f9426a
+
f9426a
+gdb_exit
f9426a
+set GDBold $GDB
f9426a
+set GDB "$shfile"
f9426a
+gdb_start
f9426a
+set GDB $GDBold
f9426a
+
f9426a
+gdb_reinitialize_dir $srcdir/$subdir
f9426a
+gdb_load ${binfile}
f9426a
+
f9426a
+set pid_of_gdb [exp_pid -i [board_info host fileid]]
f9426a
+
f9426a
+# Check the size again after the second run.
f9426a
+# We must not stop in main as it would cache `array' and never crash later.
f9426a
+
f9426a
+gdb_run_cmd
f9426a
+
f9426a
+verbose -log "kb_found before abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
f9426a
+
f9426a
+gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()"
f9426a
+
f9426a
+verbose -log "kb_found in abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
f9426a
+
f9426a
+# `abort' can get expressed as `*__GI_abort'.
f9426a
+gdb_test "bt" "in \[^ \]*abort \\(.* in main \\(.*" "Backtrace after abort()"
f9426a
+
f9426a
+verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla.c
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla.c	2014-06-16 23:30:30.110940485 +0200
f9426a
@@ -0,0 +1,55 @@
f9426a
+/* This testcase is part of GDB, the GNU debugger.
f9426a
+
f9426a
+   Copyright 2008 Free Software Foundation, Inc.
f9426a
+
f9426a
+   This program is free software; you can redistribute it and/or modify
f9426a
+   it under the terms of the GNU General Public License as published by
f9426a
+   the Free Software Foundation; either version 3 of the License, or
f9426a
+   (at your option) any later version.
f9426a
+
f9426a
+   This program is distributed in the hope that it will be useful,
f9426a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+   GNU General Public License for more details.
f9426a
+
f9426a
+   You should have received a copy of the GNU General Public License
f9426a
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
f9426a
+
f9426a
+#include <string.h>
f9426a
+
f9426a
+void
f9426a
+marker (void)
f9426a
+{
f9426a
+}
f9426a
+
f9426a
+void
f9426a
+bar (char *a, char *b, char *c, int size)
f9426a
+{
f9426a
+  memset (a, '1', size);
f9426a
+  memset (b, '2', size);
f9426a
+  memset (c, '3', 48);
f9426a
+}
f9426a
+
f9426a
+void
f9426a
+foo (int size)
f9426a
+{
f9426a
+  char temp1[size];
f9426a
+  char temp3[48];
f9426a
+
f9426a
+  temp1[size - 1] = '\0';
f9426a
+  {
f9426a
+    char temp2[size];
f9426a
+
f9426a
+    bar (temp1, temp2, temp3, size);
f9426a
+
f9426a
+    marker ();	/* break-here */
f9426a
+  }
f9426a
+}
f9426a
+
f9426a
+int
f9426a
+main (void)
f9426a
+{
f9426a
+  foo (26);
f9426a
+  foo (78);
f9426a
+  return 0;
f9426a
+}
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla.exp	2014-06-16 23:30:30.110940485 +0200
f9426a
@@ -0,0 +1,62 @@
f9426a
+# Copyright 2008 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 3 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+#
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+#
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
f9426a
+
f9426a
+set testfile vla
f9426a
+set srcfile ${testfile}.c
f9426a
+set binfile ${objdir}/${subdir}/${testfile}
f9426a
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
f9426a
+    untested "Couldn't compile test program"
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+gdb_exit
f9426a
+gdb_start
f9426a
+gdb_reinitialize_dir $srcdir/$subdir
f9426a
+gdb_load ${binfile}
f9426a
+
f9426a
+if ![runto_main] {
f9426a
+    untested vla
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "break-here"]
f9426a
+
f9426a
+gdb_continue_to_breakpoint "break-here"
f9426a
+
f9426a
+gdb_test "whatis temp1" "type = char \\\[26\\\]" "first: whatis temp1"
f9426a
+gdb_test "whatis temp2" "type = char \\\[26\\\]" "first: whatis temp2"
f9426a
+gdb_test "whatis temp3" "type = char \\\[48\\\]" "first: whatis temp3"
f9426a
+
f9426a
+gdb_test "ptype temp1" "type = char \\\[26\\\]" "first: ptype temp1"
f9426a
+gdb_test "ptype temp2" "type = char \\\[26\\\]" "first: ptype temp2"
f9426a
+gdb_test "ptype temp3" "type = char \\\[48\\\]" "first: ptype temp3"
f9426a
+
f9426a
+gdb_test "p temp1" " = '1' <repeats 26 times>" "first: print temp1"
f9426a
+gdb_test "p temp2" " = '2' <repeats 26 times>" "first: print temp2"
f9426a
+gdb_test "p temp3" " = '3' <repeats 48 times>" "first: print temp3"
f9426a
+
f9426a
+gdb_continue_to_breakpoint "break-here"
f9426a
+
f9426a
+gdb_test "whatis temp1" "type = char \\\[78\\\]" "second: whatis temp1"
f9426a
+gdb_test "whatis temp2" "type = char \\\[78\\\]" "second: whatis temp2"
f9426a
+gdb_test "whatis temp3" "type = char \\\[48\\\]" "second: whatis temp3"
f9426a
+
f9426a
+gdb_test "ptype temp1" "type = char \\\[78\\\]" "second: ptype temp1"
f9426a
+gdb_test "ptype temp2" "type = char \\\[78\\\]" "second: ptype temp2"
f9426a
+gdb_test "ptype temp3" "type = char \\\[48\\\]" "second: ptype temp3"
f9426a
+
f9426a
+gdb_test "p temp1" " = '1' <repeats 78 times>" "second: print temp1"
f9426a
+gdb_test "p temp2" " = '2' <repeats 78 times>" "second: print temp2"
f9426a
+gdb_test "p temp3" " = '3' <repeats 48 times>" "second: print temp3"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S	2014-06-16 23:30:30.111940487 +0200
f9426a
@@ -0,0 +1,246 @@
f9426a
+/* This testcase is part of GDB, the GNU debugger.
f9426a
+
f9426a
+   Copyright 2010 Free Software Foundation, Inc.
f9426a
+
f9426a
+   This program is free software; you can redistribute it and/or modify
f9426a
+   it under the terms of the GNU General Public License as published by
f9426a
+   the Free Software Foundation; either version 3 of the License, or
f9426a
+   (at your option) any later version.
f9426a
+
f9426a
+   This program is distributed in the hope that it will be useful,
f9426a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+   GNU General Public License for more details.
f9426a
+
f9426a
+   You should have received a copy of the GNU General Public License
f9426a
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
f9426a
+
f9426a
+/* Debug information */
f9426a
+
f9426a
+/* We will `break *main' at the very first instruction.  */
f9426a
+#define main_length 1
f9426a
+
f9426a
+	.section	.data
f9426a
+vardata:
f9426a
+	/* See DW_OP_lit3 + 1 (0-based).  */
f9426a
+	.string		"seennotseen"
f9426a
+
f9426a
+	.section	.debug_info
f9426a
+.Lcu1_begin:
f9426a
+	.4byte		.Lcu1_end - .Lcu1_start	/* Length of Compilation Unit */
f9426a
+.Lcu1_start:
f9426a
+	.2byte		2			/* DWARF version number */
f9426a
+	.4byte		.Ldebug_abbrev0		/* Offset Into Abbrev. Section */
f9426a
+	.byte		4			/* Pointer Size (in bytes) */
f9426a
+
f9426a
+	/* CU die */
f9426a
+	.uleb128	1			/* Abbrev: DW_TAG_compile_unit */
f9426a
+	.4byte		.Lproducer		/* DW_AT_producer */
f9426a
+	/* Use C++ to exploit a bug in parsing DW_AT_name "".  */
f9426a
+	.byte		4			/* DW_AT_language (C++) -  */
f9426a
+	.4byte		main			/* DW_AT_low_pc */
f9426a
+	.byte		main_length		/* DW_AT_high_pc */
f9426a
+
f9426a
+.Larray_type:
f9426a
+	.uleb128	2			/* Abbrev: DW_TAG_array_type */
f9426a
+	.4byte		.Lchar_type-.Lcu1_begin	/* DW_AT_type */
f9426a
+
f9426a
+	.uleb128	3			/* Abbrev: DW_TAG_subrange_type */
f9426a
+	.4byte		.Luint_type-.Lcu1_begin	/* DW_AT_type */
f9426a
+	.byte		0			/* DW_AT_lower_bound */
f9426a
+	.4byte		.Llen_var-.Lcu1_begin	/* DW_AT_upper_bound */
f9426a
+	.byte		0			/* End of children of die */
f9426a
+
f9426a
+	/* DW_AT_upper_bound is referencing an optimized-out variable.  */
f9426a
+.Larrayb_type:
f9426a
+	.uleb128	2			/* Abbrev: DW_TAG_array_type */
f9426a
+	.4byte		.Lchar_type-.Lcu1_begin	/* DW_AT_type */
f9426a
+
f9426a
+	.uleb128	3			/* Abbrev: DW_TAG_subrange_type */
f9426a
+	.4byte		.Luint_type-.Lcu1_begin	/* DW_AT_type */
f9426a
+	.byte		0			/* DW_AT_lower_bound */
f9426a
+	.4byte		.Llenb_var-.Lcu1_begin	/* DW_AT_upper_bound */
f9426a
+	.byte		0			/* End of children of die */
f9426a
+
f9426a
+	/* DW_AT_upper_bound is referencing register.  */
f9426a
+.Larrayreg_type:
f9426a
+	.uleb128	2			/* Abbrev: DW_TAG_array_type */
f9426a
+	.4byte		.Lchar_type-.Lcu1_begin	/* DW_AT_type */
f9426a
+
f9426a
+	.uleb128	8			/* Abbrev: DW_TAG_subrange_type with block */
f9426a
+	.4byte		.Luint_type-.Lcu1_begin	/* DW_AT_type */
f9426a
+	.byte		0			/* DW_AT_lower_bound */
f9426a
+	.byte		2f - 1f			/* DW_AT_upper_bound */
f9426a
+1:	.byte		0x50			/* DW_OP_reg0 */
f9426a
+2:
f9426a
+	.byte		0			/* End of children of die */
f9426a
+
f9426a
+.Luint_type:
f9426a
+	.uleb128	4			/* Abbrev: DW_TAG_base_type */
f9426a
+	.4byte		.Luint_str		/* DW_AT_name */
f9426a
+	.byte		4			/* DW_AT_byte_size */
f9426a
+	.byte		7			/* DW_AT_encoding */
f9426a
+
f9426a
+.Lchar_type:
f9426a
+	.uleb128	4			/* Abbrev: DW_TAG_base_type */
f9426a
+	.4byte		.Lchar_str		/* DW_AT_name */
f9426a
+	.byte		1			/* DW_AT_byte_size */
f9426a
+	.byte		6			/* DW_AT_encoding */
f9426a
+
f9426a
+.Llen_var:
f9426a
+	.uleb128	5			/* Abbrev: DW_TAG_variable artificial */
f9426a
+	.byte		1			/* DW_AT_artificial */
f9426a
+	.4byte		.Luint_type-.Lcu1_begin	/* DW_AT_type */
f9426a
+	.4byte		.Llen_loclist-.Lloclist	/* DW_AT_location */
f9426a
+
f9426a
+	/* optimized-out variable for b_string.  */
f9426a
+.Llenb_var:
f9426a
+	.uleb128	7			/* Abbrev: DW_TAG_variable artificial no DW_AT_location */
f9426a
+	.byte		1			/* DW_AT_artificial */
f9426a
+	.4byte		.Luint_type-.Lcu1_begin	/* DW_AT_type */
f9426a
+
f9426a
+	.uleb128	6			/* Abbrev: DW_TAG_variable DW_FORM_string */
f9426a
+	.string		"a_string"		/* DW_AT_name */
f9426a
+	.4byte		.Larray_type-.Lcu1_begin /* DW_AT_type */
f9426a
+	.byte		2f - 1f			/* DW_AT_location */
f9426a
+1:	.byte		3			/*   DW_OP_addr */
f9426a
+	.4byte		vardata			/*   <addr> */
f9426a
+2:
f9426a
+
f9426a
+	/* DW_AT_upper_bound is referencing an optimized-out variable.  */
f9426a
+	.uleb128	6			/* Abbrev: DW_TAG_variable DW_FORM_string */
f9426a
+	.string		"b_string"		/* DW_AT_name */
f9426a
+	.4byte		.Larrayb_type-.Lcu1_begin /* DW_AT_type */
f9426a
+	.byte		2f - 1f			/* DW_AT_location */
f9426a
+1:	.byte		3			/*   DW_OP_addr */
f9426a
+	.4byte		vardata			/*   <addr> */
f9426a
+2:
f9426a
+
f9426a
+	/* DW_AT_upper_bound is referencing register.  */
f9426a
+	.uleb128	6			/* Abbrev: DW_TAG_variable DW_FORM_string */
f9426a
+	.string		"reg_string"		/* DW_AT_name */
f9426a
+	.4byte		.Larrayreg_type-.Lcu1_begin /* DW_AT_type */
f9426a
+	.byte		2f - 1f			/* DW_AT_location */
f9426a
+1:	.byte		3			/*   DW_OP_addr */
f9426a
+	.4byte		vardata			/*   <addr> */
f9426a
+2:
f9426a
+
f9426a
+	.byte		0			/* End of children of CU */
f9426a
+.Lcu1_end:
f9426a
+
f9426a
+	.section	.debug_loc
f9426a
+.Lloclist:
f9426a
+.Llen_loclist:
f9426a
+	.4byte	0			# Location list begin address
f9426a
+	.4byte	main_length		# Location list end address
f9426a
+	.value	2f-1f	# Location expression size
f9426a
+1:	.byte	0x33	# DW_OP_lit3
f9426a
+	.byte	0x9f	# DW_OP_stack_value
f9426a
+2:
f9426a
+	.quad	0x0	# Location list terminator begin (*.LLST2)
f9426a
+	.quad	0x0	# Location list terminator end (*.LLST2)
f9426a
+
f9426a
+	.section .debug_abbrev
f9426a
+.Ldebug_abbrev0:
f9426a
+	.uleb128	1			/* Abbrev code */
f9426a
+	.uleb128	0x11			/* DW_TAG_compile_unit */
f9426a
+	.byte		0x1			/* has_children */
f9426a
+	.uleb128	0x25			/* DW_AT_producer */
f9426a
+	.uleb128	0xe			/* DW_FORM_strp */
f9426a
+	.uleb128	0x13			/* DW_AT_language */
f9426a
+	.uleb128	0xb			/* DW_FORM_data1 */
f9426a
+	.uleb128	0x11			/* DW_AT_low_pc */
f9426a
+	.uleb128	0x1			/* DW_FORM_addr */
f9426a
+	.uleb128	0x12			/* DW_AT_high_pc */
f9426a
+	.uleb128	0xb			/* DW_FORM_data1 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.uleb128	2			/* Abbrev code */
f9426a
+	.uleb128	0x1			/* TAG: DW_TAG_array_type */
f9426a
+	.byte		0x1			/* DW_children_yes */
f9426a
+	.uleb128	0x49			/* DW_AT_type */
f9426a
+	.uleb128	0x13			/* DW_FORM_ref4 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.uleb128	3			/* Abbrev code */
f9426a
+	.uleb128	0x21			/* DW_TAG_subrange_type */
f9426a
+	.byte		0x0			/* no children */
f9426a
+	.uleb128	0x49			/* DW_AT_type */
f9426a
+	.uleb128	0x13			/* DW_FORM_ref4 */
f9426a
+	.uleb128	0x22			/* DW_AT_lower_bound */
f9426a
+	.uleb128	0xb			/* DW_FORM_data1 */
f9426a
+	.uleb128	0x2f			/* DW_AT_upper_bound */
f9426a
+	.uleb128	0x13			/* DW_FORM_ref4 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.uleb128	4			/* Abbrev code */
f9426a
+	.uleb128	0x24			/* DW_TAG_base_type */
f9426a
+	.byte		0x0			/* no_children */
f9426a
+	.uleb128	0x3			/* DW_AT_name */
f9426a
+	.uleb128	0xe			/* DW_FORM_strp */
f9426a
+	.uleb128	0xb			/* DW_AT_byte_size */
f9426a
+	.uleb128	0xb			/* DW_FORM_data1 */
f9426a
+	.uleb128	0x3e			/* DW_AT_encoding */
f9426a
+	.uleb128	0xb			/* DW_FORM_data1 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.uleb128	5			/* Abbrev code */
f9426a
+	.uleb128	0x34			/* DW_TAG_variable */
f9426a
+	.byte		0x0			/* no_children */
f9426a
+	.uleb128	0x34			/* DW_AT_artificial */
f9426a
+	.uleb128	0x0c			/* DW_FORM_flag */
f9426a
+	.uleb128	0x49			/* DW_AT_type */
f9426a
+	.uleb128	0x13			/* DW_FORM_ref4 */
f9426a
+	.uleb128	0x02			/* DW_AT_location */
f9426a
+	.uleb128	0x06			/* DW_FORM_data4 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.uleb128	6			/* Abbrev code */
f9426a
+	.uleb128	0x34			/* DW_TAG_variable */
f9426a
+	.byte		0x0			/* no_children */
f9426a
+	.uleb128	0x3			/* DW_AT_name */
f9426a
+	.uleb128	0x8			/* DW_FORM_string */
f9426a
+	.uleb128	0x49			/* DW_AT_type */
f9426a
+	.uleb128	0x13			/* DW_FORM_ref4 */
f9426a
+	.uleb128	0x2			/* DW_AT_location */
f9426a
+	.uleb128	0xa			/* DW_FORM_block1 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.uleb128	7			/* Abbrev code */
f9426a
+	.uleb128	0x34			/* DW_TAG_variable */
f9426a
+	.byte		0x0			/* no_children */
f9426a
+	.uleb128	0x34			/* DW_AT_artificial */
f9426a
+	.uleb128	0x0c			/* DW_FORM_flag */
f9426a
+	.uleb128	0x49			/* DW_AT_type */
f9426a
+	.uleb128	0x13			/* DW_FORM_ref4 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.uleb128	8			/* Abbrev code */
f9426a
+	.uleb128	0x21			/* DW_TAG_subrange_type with block */
f9426a
+	.byte		0x0			/* no children */
f9426a
+	.uleb128	0x49			/* DW_AT_type */
f9426a
+	.uleb128	0x13			/* DW_FORM_ref4 */
f9426a
+	.uleb128	0x22			/* DW_AT_lower_bound */
f9426a
+	.uleb128	0xb			/* DW_FORM_data1 */
f9426a
+	.uleb128	0x2f			/* DW_AT_upper_bound */
f9426a
+	.uleb128	0xa			/* DW_FORM_block1 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+/* String table */
f9426a
+	.section .debug_str
f9426a
+.Lproducer:
f9426a
+	.string		"GNU C 3.3.3"
f9426a
+.Lchar_str:
f9426a
+	.string		"char"
f9426a
+.Luint_str:
f9426a
+	.string		"unsigned int"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp	2014-06-16 23:30:30.111940487 +0200
f9426a
@@ -0,0 +1,63 @@
f9426a
+# Copyright 2010 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 3 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+#
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+#
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
f9426a
+
f9426a
+# Test printing variable with dynamic bounds which reference a different
f9426a
+# (artificial in the GCC case) variable containing loclist as its location.
f9426a
+# This testcase uses value (not address) of the referenced variable:
f9426a
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43762
f9426a
+
f9426a
+# This test can only be run on targets which support DWARF-2 and use gas.
f9426a
+# For now pick a sampling of likely targets.
f9426a
+if {![istarget *-*-linux*]
f9426a
+    && ![istarget *-*-gnu*]
f9426a
+    && ![istarget *-*-elf*]
f9426a
+    && ![istarget *-*-openbsd*]
f9426a
+    && ![istarget arm-*-eabi*]
f9426a
+    && ![istarget powerpc-*-eabi*]} {
f9426a
+    return 0
f9426a
+}
f9426a
+
f9426a
+set testfile dw2-bound-loclist
f9426a
+if { [prepare_for_testing ${testfile}.exp ${testfile} [list ${testfile}.S main.c] {}] } {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+# Verify it behaves at least as an unbound array without inferior.
f9426a
+
f9426a
+set test "p a_string"
f9426a
+gdb_test_multiple $test $test {
f9426a
+    -re " = 0x\[0-9a-f\]+ \"seennotseen\"\r\n$gdb_prompt $" {
f9426a
+	pass $test
f9426a
+    }
f9426a
+    -re "No registers\\.\r\n$gdb_prompt $" {
f9426a
+	kfail "vlaregression" $test
f9426a
+    }
f9426a
+}
f9426a
+
f9426a
+gdb_test "ptype a_string" {type = char \[variable length\]}
f9426a
+
f9426a
+# Not runto_main as dw2-bound-loclist.S handles only the first byte of main.
f9426a
+if ![runto "*main"] {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+gdb_test "p a_string" { = "seen"}
f9426a
+gdb_test "ptype a_string" {type = char \[4\]}
f9426a
+
f9426a
+gdb_test "p b_string" { = (0x[0-9a-f]+ )?"seennotseen"}
f9426a
+gdb_test "ptype b_string" {type = char \[\]}
f9426a
+
f9426a
+# The register contains unpredictable value - the array size.
f9426a
+gdb_test "ptype reg_string" {type = char \[-?[0-9]+\]}
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-stripped.c
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-stripped.c	2014-06-16 23:30:30.111940487 +0200
f9426a
@@ -0,0 +1,42 @@
f9426a
+/* This testcase is part of GDB, the GNU debugger.
f9426a
+
f9426a
+   Copyright 2004 Free Software Foundation, Inc.
f9426a
+
f9426a
+   This program is free software; you can redistribute it and/or modify
f9426a
+   it under the terms of the GNU General Public License as published by
f9426a
+   the Free Software Foundation; either version 2 of the License, or
f9426a
+   (at your option) any later version.
f9426a
+
f9426a
+   This program is distributed in the hope that it will be useful,
f9426a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+   GNU General Public License for more details.
f9426a
+ 
f9426a
+   You should have received a copy of the GNU General Public License
f9426a
+   along with this program; if not, write to the Free Software
f9426a
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
f9426a
+   USA.  */
f9426a
+
f9426a
+
f9426a
+/* The function `func1' traced into must have debug info on offset > 0;
f9426a
+   (DW_UNSND (attr)).  This is the reason of `func0' existence.  */
f9426a
+
f9426a
+void
f9426a
+func0(int a, int b)
f9426a
+{
f9426a
+}
f9426a
+
f9426a
+/* `func1' being traced into must have some arguments to dump.  */
f9426a
+
f9426a
+void
f9426a
+func1(int a, int b)
f9426a
+{
f9426a
+  func0 (a,b);
f9426a
+}
f9426a
+
f9426a
+int
f9426a
+main(void)
f9426a
+{
f9426a
+  func1 (1, 2);
f9426a
+  return 0;
f9426a
+}
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp	2014-06-16 23:30:30.111940487 +0200
f9426a
@@ -0,0 +1,79 @@
f9426a
+# Copyright 2006 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 2 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+# 
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+# 
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program; if not, write to the Free Software
f9426a
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
f9426a
+
f9426a
+# Minimal DWARF-2 unit test
f9426a
+
f9426a
+# This test can only be run on targets which support DWARF-2.
f9426a
+# For now pick a sampling of likely targets.
f9426a
+if {![istarget *-*-linux*]
f9426a
+    && ![istarget *-*-gnu*]
f9426a
+    && ![istarget *-*-elf*]
f9426a
+    && ![istarget *-*-openbsd*]
f9426a
+    && ![istarget arm-*-eabi*]
f9426a
+    && ![istarget powerpc-*-eabi*]} {
f9426a
+    return 0  
f9426a
+}
f9426a
+
f9426a
+set testfile "dw2-stripped"
f9426a
+set srcfile ${testfile}.c
f9426a
+set binfile ${objdir}/${subdir}/${testfile}.x
f9426a
+
f9426a
+remote_exec build "rm -f ${binfile}"
f9426a
+
f9426a
+# get the value of gcc_compiled
f9426a
+if [get_compiler_info ${binfile}] {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+# This test can only be run on gcc as we use additional_flags=FIXME
f9426a
+if {$gcc_compiled == 0} {
f9426a
+    return 0
f9426a
+}
f9426a
+
f9426a
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-ggdb3}] != "" } {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+remote_exec build "objcopy -R .debug_loc ${binfile}"
f9426a
+set strip_output [remote_exec build "objdump -h ${binfile}"]
f9426a
+
f9426a
+set test "stripping test file preservation"
f9426a
+if [ regexp ".debug_info " $strip_output]  {
f9426a
+    pass "$test (.debug_info preserved)"
f9426a
+} else {
f9426a
+    fail "$test (.debug_info got also stripped)"
f9426a
+}
f9426a
+
f9426a
+set test "stripping test file functionality"
f9426a
+if [ regexp ".debug_loc " $strip_output]  {
f9426a
+    fail "$test (.debug_loc still present)"
f9426a
+} else {
f9426a
+    pass "$test (.debug_loc stripped)"
f9426a
+}
f9426a
+
f9426a
+gdb_exit
f9426a
+gdb_start
f9426a
+gdb_reinitialize_dir $srcdir/$subdir
f9426a
+gdb_load ${binfile}
f9426a
+
f9426a
+# For C programs, "start" should stop in main().
f9426a
+
f9426a
+gdb_test "start" \
f9426a
+         ".*main \\(\\) at .*" \
f9426a
+         "start"
f9426a
+gdb_test "step" \
f9426a
+         "func.* \\(.*\\) at .*" \
f9426a
+         "step"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S	2014-06-16 23:30:30.112940488 +0200
f9426a
@@ -0,0 +1,83 @@
f9426a
+/* This testcase is part of GDB, the GNU debugger.
f9426a
+
f9426a
+   Copyright 2009 Free Software Foundation, Inc.
f9426a
+
f9426a
+   This program is free software; you can redistribute it and/or modify
f9426a
+   it under the terms of the GNU General Public License as published by
f9426a
+   the Free Software Foundation; either version 3 of the License, or
f9426a
+   (at your option) any later version.
f9426a
+
f9426a
+   This program is distributed in the hope that it will be useful,
f9426a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+   GNU General Public License for more details.
f9426a
+
f9426a
+   You should have received a copy of the GNU General Public License
f9426a
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
f9426a
+
f9426a
+/* Debug information */
f9426a
+
f9426a
+	.section .debug_info
f9426a
+.Lcu1_begin:
f9426a
+	/* CU header */
f9426a
+	.4byte	.Lcu1_end - .Lcu1_start		/* Length of Compilation Unit */
f9426a
+.Lcu1_start:
f9426a
+	.2byte	2				/* DWARF Version */
f9426a
+	.4byte	.Labbrev1_begin			/* Offset into abbrev section */
f9426a
+	.byte	4				/* Pointer size */
f9426a
+
f9426a
+	/* CU die */
f9426a
+	.uleb128 1				/* Abbrev: DW_TAG_compile_unit */
f9426a
+	.ascii	"dw2-struct-member-data-location.c\0"	/* DW_AT_name */
f9426a
+	.ascii	"GNU C 4.3.2\0"			/* DW_AT_producer */
f9426a
+	.byte	1				/* DW_AT_language (C) */
f9426a
+
f9426a
+.Ltype_uchar:
f9426a
+	.uleb128	2			/* Abbrev: DW_TAG_structure_type */
f9426a
+	.ascii		"some_struct\0"		/* DW_AT_name */
f9426a
+
f9426a
+	.uleb128	3			/* Abbrev: DW_TAG_member */
f9426a
+	.ascii		"field\0"		/* DW_AT_name */
f9426a
+	.byte		0			/* DW_AT_data_member_location */
f9426a
+
f9426a
+	.byte		0			/* End of children of some_struct */
f9426a
+
f9426a
+	.byte		0			/* End of children of CU */
f9426a
+
f9426a
+.Lcu1_end:
f9426a
+
f9426a
+/* Abbrev table */
f9426a
+	.section .debug_abbrev
f9426a
+.Labbrev1_begin:
f9426a
+	.uleb128	1			/* Abbrev code */
f9426a
+	.uleb128	0x11			/* DW_TAG_compile_unit */
f9426a
+	.byte		1			/* has_children */
f9426a
+	.uleb128	0x3			/* DW_AT_name */
f9426a
+	.uleb128	0x8			/* DW_FORM_string */
f9426a
+	.uleb128	0x25			/* DW_AT_producer */
f9426a
+	.uleb128	0x8			/* DW_FORM_string */
f9426a
+	.uleb128	0x13			/* DW_AT_language */
f9426a
+	.uleb128	0xb			/* DW_FORM_data1 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.uleb128	2			/* Abbrev code */
f9426a
+	.uleb128	0x13			/* DW_TAG_structure_type */
f9426a
+	.byte		1			/* has_children */
f9426a
+	.uleb128	0x3			/* DW_AT_name */
f9426a
+	.uleb128	0x8			/* DW_FORM_string */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.uleb128	3			/* Abbrev code */
f9426a
+	.uleb128	0x0d			/* DW_TAG_member */
f9426a
+	.byte		0			/* has_children */
f9426a
+	.uleb128	0x3			/* DW_AT_name */
f9426a
+	.uleb128	0x8			/* DW_FORM_string */
f9426a
+	.uleb128	0x38			/* DW_AT_data_member_location */
f9426a
+	.uleb128	0x0b			/* DW_FORM_data1 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp	2014-06-16 23:30:30.112940488 +0200
f9426a
@@ -0,0 +1,37 @@
f9426a
+# Copyright 2009 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 3 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+#
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+#
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
f9426a
+
f9426a
+# This test can only be run on targets which support DWARF-2 and use gas.
f9426a
+# For now pick a sampling of likely targets.
f9426a
+if {![istarget *-*-linux*]
f9426a
+    && ![istarget *-*-gnu*]
f9426a
+    && ![istarget *-*-elf*]
f9426a
+    && ![istarget *-*-openbsd*]
f9426a
+    && ![istarget arm-*-eabi*]
f9426a
+    && ![istarget powerpc-*-eabi*]} {
f9426a
+    return 0  
f9426a
+}
f9426a
+
f9426a
+set testfile "dw2-struct-member-data-location"
f9426a
+set srcfile ${testfile}.S
f9426a
+set binfile ${testfile}.x
f9426a
+
f9426a
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "[standard_output_file ${binfile}]" object {nodebug}] != "" } {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+clean_restart $binfile
f9426a
+
f9426a
+gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S	2014-06-16 23:30:30.112940488 +0200
f9426a
@@ -0,0 +1,121 @@
f9426a
+/* This testcase is part of GDB, the GNU debugger.
f9426a
+
f9426a
+   Copyright 2012 Free Software Foundation, Inc.
f9426a
+
f9426a
+   This program is free software; you can redistribute it and/or modify
f9426a
+   it under the terms of the GNU General Public License as published by
f9426a
+   the Free Software Foundation; either version 3 of the License, or
f9426a
+   (at your option) any later version.
f9426a
+
f9426a
+   This program is distributed in the hope that it will be useful,
f9426a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+   GNU General Public License for more details.
f9426a
+
f9426a
+   You should have received a copy of the GNU General Public License
f9426a
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
f9426a
+
f9426a
+/* Debug information */
f9426a
+
f9426a
+	.section	.data
f9426a
+vardata:
f9426a
+	.rept		129
f9426a
+	.ascii		"x"
f9426a
+	.endr
f9426a
+	.ascii		"UNSEEN\0"
f9426a
+
f9426a
+	.section	.debug_info
f9426a
+.Lcu1_begin:
f9426a
+	.4byte		.Lcu1_end - .Lcu1_start	/* Length of Compilation Unit */
f9426a
+.Lcu1_start:
f9426a
+	.2byte		2			/* DWARF version number */
f9426a
+	.4byte		.Ldebug_abbrev0		/* Offset Into Abbrev. Section */
f9426a
+	.byte		4			/* Pointer Size (in bytes) */
f9426a
+
f9426a
+	/* CU die */
f9426a
+	.uleb128	1			/* Abbrev: DW_TAG_compile_unit */
f9426a
+	.ascii		"GNU C 3.3.3\0"		/* DW_AT_producer */
f9426a
+	.byte		2			/* DW_AT_language (C) -  */
f9426a
+
f9426a
+.Larray_type:
f9426a
+	.uleb128	2			/* Abbrev: DW_TAG_array_type */
f9426a
+	.4byte		.Lchar_type-.Lcu1_begin	/* DW_AT_type */
f9426a
+
f9426a
+	.uleb128	8			/* Abbrev: DW_TAG_subrange_type without DW_AT_type */
f9426a
+	.byte		0			/* DW_AT_lower_bound */
f9426a
+	.byte		128			/* DW_AT_upper_bound */
f9426a
+
f9426a
+	.byte		0			/* End of children of die */
f9426a
+
f9426a
+.Lchar_type:
f9426a
+	.uleb128	4			/* Abbrev: DW_TAG_base_type */
f9426a
+	.ascii		"char\0"		/* DW_AT_name */
f9426a
+	.byte		1			/* DW_AT_byte_size */
f9426a
+	.byte		6			/* DW_AT_encoding */
f9426a
+
f9426a
+	.uleb128	6			/* Abbrev: DW_TAG_variable DW_FORM_string */
f9426a
+	.ascii		"notype_string\0"	/* DW_AT_name */
f9426a
+	.4byte		.Larray_type-.Lcu1_begin /* DW_AT_type */
f9426a
+	.byte		2f - 1f			/* DW_AT_location */
f9426a
+1:	.byte		3			/*   DW_OP_addr */
f9426a
+	.4byte		vardata			/*   <addr> */
f9426a
+2:
f9426a
+
f9426a
+	.byte		0			/* End of children of CU */
f9426a
+.Lcu1_end:
f9426a
+
f9426a
+	.section .debug_abbrev
f9426a
+.Ldebug_abbrev0:
f9426a
+	.uleb128	1			/* Abbrev code */
f9426a
+	.uleb128	0x11			/* DW_TAG_compile_unit */
f9426a
+	.byte		0x1			/* has_children */
f9426a
+	.uleb128	0x25			/* DW_AT_producer */
f9426a
+	.uleb128	0x8			/* DW_FORM_string */
f9426a
+	.uleb128	0x13			/* DW_AT_language */
f9426a
+	.uleb128	0xb			/* DW_FORM_data1 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.uleb128	2			/* Abbrev code */
f9426a
+	.uleb128	0x1			/* TAG: DW_TAG_array_type */
f9426a
+	.byte		0x1			/* DW_children_yes */
f9426a
+	.uleb128	0x49			/* DW_AT_type */
f9426a
+	.uleb128	0x13			/* DW_FORM_ref4 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.uleb128	4			/* Abbrev code */
f9426a
+	.uleb128	0x24			/* DW_TAG_base_type */
f9426a
+	.byte		0x0			/* no_children */
f9426a
+	.uleb128	0x3			/* DW_AT_name */
f9426a
+	.uleb128	0x8			/* DW_FORM_string */
f9426a
+	.uleb128	0xb			/* DW_AT_byte_size */
f9426a
+	.uleb128	0xb			/* DW_FORM_data1 */
f9426a
+	.uleb128	0x3e			/* DW_AT_encoding */
f9426a
+	.uleb128	0xb			/* DW_FORM_data1 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.uleb128	6			/* Abbrev code */
f9426a
+	.uleb128	0x34			/* DW_TAG_variable */
f9426a
+	.byte		0x0			/* no_children */
f9426a
+	.uleb128	0x3			/* DW_AT_name */
f9426a
+	.uleb128	0x8			/* DW_FORM_string */
f9426a
+	.uleb128	0x49			/* DW_AT_type */
f9426a
+	.uleb128	0x13			/* DW_FORM_ref4 */
f9426a
+	.uleb128	0x2			/* DW_AT_location */
f9426a
+	.uleb128	0xa			/* DW_FORM_block1 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.uleb128	8			/* Abbrev code */
f9426a
+	.uleb128	0x21			/* DW_TAG_subrange_type without DW_AT_type */
f9426a
+	.byte		0x0			/* no children */
f9426a
+	.uleb128	0x22			/* DW_AT_lower_bound */
f9426a
+	.uleb128	0xb			/* DW_FORM_data1 */
f9426a
+	.uleb128	0x2f			/* DW_AT_upper_bound */
f9426a
+	.uleb128	0xb			/* DW_FORM_data1 */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+	.byte		0x0			/* Terminator */
f9426a
+
f9426a
+	.byte		0x0			/* Terminator */
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp	2014-06-16 23:30:30.112940488 +0200
f9426a
@@ -0,0 +1,39 @@
f9426a
+# Copyright 2012 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 3 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+#
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+#
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
f9426a
+load_lib dwarf.exp
f9426a
+
f9426a
+# https://bugzilla.redhat.com/show_bug.cgi?id=806920
f9426a
+# read_subrange_type <TYPE_CODE (base_type) == TYPE_CODE_VOID> reinitialization
f9426a
+# of BASE_TYPE was done too late, it affects DW_TAG_subrange_type without
f9426a
+# specified DW_AT_type, present only in XLF produced code.
f9426a
+
f9426a
+# This test can only be run on targets which support DWARF-2 and use gas.
f9426a
+if {![dwarf2_support]} {
f9426a
+    return 0  
f9426a
+}
f9426a
+
f9426a
+set testfile dw2-subrange-no-type
f9426a
+set srcfile ${testfile}.S
f9426a
+set executable ${testfile}.x
f9426a
+set binfile [standard_output_file ${executable}]
f9426a
+
f9426a
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+clean_restart $executable
f9426a
+
f9426a
+gdb_test "ptype notype_string" {type = char \[129\]}
f9426a
+gdb_test "p notype_string" " = 'x' <repeats 129 times>"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dwarf-stride.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dwarf-stride.exp	2014-06-16 23:30:30.112940488 +0200
f9426a
@@ -0,0 +1,42 @@
f9426a
+# Copyright 2009 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 2 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+# 
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+# 
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program; if not, write to the Free Software
f9426a
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
f9426a
+
f9426a
+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
f9426a
+
f9426a
+# This file is part of the gdb testsuite.  Array element stride must not be
f9426a
+# specified in the number of elements but in a number of bytes instead.
f9426a
+# Original problem:
f9426a
+# (gdb) p c40pt(1)
f9426a
+# $1 = '0-hello', ' ' <repeats 33 times>
f9426a
+# (gdb) p c40pt(2)
f9426a
+# warning: Fortran array stride not divisible by the element size
f9426a
+
f9426a
+set testfile dwarf-stride
f9426a
+set srcfile ${testfile}.f90
f9426a
+
f9426a
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+if ![runto MAIN__] then {
f9426a
+    perror "couldn't run to breakpoint MAIN__"
f9426a
+    continue
f9426a
+}
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "break-here"]
f9426a
+gdb_continue_to_breakpoint "break-here" ".*break-here.*"
f9426a
+gdb_test "p c40pt(1)" " = '0-hello.*"
f9426a
+gdb_test "p c40pt(2)" " = '1-hello.*"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dwarf-stride.f90
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dwarf-stride.f90	2014-06-16 23:30:30.112940488 +0200
f9426a
@@ -0,0 +1,40 @@
f9426a
+! Copyright 2009 Free Software Foundation, Inc.
f9426a
+!
f9426a
+! This program is free software; you can redistribute it and/or modify
f9426a
+! it under the terms of the GNU General Public License as published by
f9426a
+! the Free Software Foundation; either version 2 of the License, or
f9426a
+! (at your option) any later version.
f9426a
+!
f9426a
+! This program is distributed in the hope that it will be useful,
f9426a
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+! GNU General Public License for more details.
f9426a
+!
f9426a
+! You should have received a copy of the GNU General Public License
f9426a
+! along with this program; if not, write to the Free Software
f9426a
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
f9426a
+!
f9426a
+! File written by Alan Matsuoka.
f9426a
+
f9426a
+program repro
f9426a
+
f9426a
+  type small_stride
f9426a
+     character*40 long_string
f9426a
+     integer      small_pad
f9426a
+  end type small_stride
f9426a
+
f9426a
+  type(small_stride), dimension (20), target :: unpleasant
f9426a
+  character*40, pointer, dimension(:):: c40pt
f9426a
+
f9426a
+  integer i
f9426a
+
f9426a
+  do i = 0,19
f9426a
+     unpleasant(i+1)%small_pad = i+1
f9426a
+     unpleasant(i+1)%long_string = char (ichar('0') + i) // '-hello'
f9426a
+  end do
f9426a
+
f9426a
+  c40pt => unpleasant%long_string
f9426a
+
f9426a
+  print *, c40pt  ! break-here
f9426a
+
f9426a
+end program repro
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.exp	2014-06-16 23:37:45.568362563 +0200
f9426a
@@ -0,0 +1,151 @@
f9426a
+# Copyright 2007 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 2 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+# 
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+# 
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program; if not, write to the Free Software
f9426a
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
f9426a
+
f9426a
+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
f9426a
+
f9426a
+# This file is part of the gdb testsuite.  It contains tests for dynamically
f9426a
+# allocated Fortran arrays.
f9426a
+# It depends on the GCC dynamic Fortran arrays DWARF support:
f9426a
+# 	http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22244
f9426a
+
f9426a
+set testfile "dynamic"
f9426a
+set srcfile ${testfile}.f90
f9426a
+set binfile ${objdir}/${subdir}/${testfile}
f9426a
+
f9426a
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } {
f9426a
+    untested "Couldn't compile ${srcfile}"
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+gdb_exit
f9426a
+gdb_start
f9426a
+gdb_reinitialize_dir $srcdir/$subdir
f9426a
+gdb_load ${binfile}
f9426a
+
f9426a
+if ![runto MAIN__] then {
f9426a
+    perror "couldn't run to breakpoint MAIN__"
f9426a
+    continue
f9426a
+}
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "varx-init"]
f9426a
+gdb_continue_to_breakpoint "varx-init"
f9426a
+gdb_test "p varx" "\\$\[0-9\]* = <not allocated>" "p varx unallocated"
f9426a
+gdb_test "ptype varx" "type = <not allocated>" "ptype varx unallocated"
f9426a
+gdb_test "p varx(1,5,17)" "no such vector element because not allocated" "p varx(1,5,17) unallocated"
f9426a
+gdb_test "p varx(1,5,17)=1" "no such vector element because not allocated" "p varx(1,5,17)=1 unallocated"
f9426a
+gdb_test "ptype varx(1,5,17)" "no such vector element because not allocated" "ptype varx(1,5,17) unallocated"
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "varx-allocated"]
f9426a
+gdb_continue_to_breakpoint "varx-allocated"
f9426a
+# $1 = (( ( 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0) --- , 0) ) ( ( 0, 0, ...) ...) ...)
f9426a
+gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx allocated"
f9426a
+# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1.
f9426a
+gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varx allocated"
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "varx-filled"]
f9426a
+gdb_continue_to_breakpoint "varx-filled"
f9426a
+gdb_test "p varx(2, 5, 17)" "\\$\[0-9\]* = 6"
f9426a
+gdb_test "p varx(1, 5, 17)" "\\$\[0-9\]* = 7"
f9426a
+gdb_test "p varx(2, 6, 18)" "\\$\[0-9\]* = 8"
f9426a
+gdb_test "p varx(6, 15, 28)" "\\$\[0-9\]* = 9"
f9426a
+gdb_test "p varv" "\\$\[0-9\]* = <not associated>" "p varv unassociated"
f9426a
+gdb_test "ptype varv" "type = <not associated>" "ptype varv unassociated"
f9426a
+
f9426a
+set test "output varx"
f9426a
+gdb_test_multiple $test $test {
f9426a
+    -re "^output varx\r\n\[() ,6789.\]*$gdb_prompt $" {
f9426a
+	pass $test
f9426a
+    }
f9426a
+}
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "varv-associated"]
f9426a
+gdb_continue_to_breakpoint "varv-associated"
f9426a
+gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 6" "p varx(3, 7, 19) with varv associated"
f9426a
+gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 6" "p varv(3, 7, 19) associated"
f9426a
+# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1.
f9426a
+gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varv associated"
f9426a
+gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx with varv associated"
f9426a
+# Intel Fortran Compiler 10.1.008 uses the pointer type.
f9426a
+gdb_test "ptype varv" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)\\)?" "ptype varv associated"
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "varv-filled"]
f9426a
+gdb_continue_to_breakpoint "varv-filled"
f9426a
+gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 10" "p varx(3, 7, 19) with varv filled"
f9426a
+gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 10" "p varv(3, 7, 19) filled"
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "varv-deassociated"]
f9426a
+gdb_continue_to_breakpoint "varv-deassociated"
f9426a
+# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type.
f9426a
+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"
f9426a
+gdb_test "ptype varv" "type = (<not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "ptype varv deassociated"
f9426a
+gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varv deassociated"
f9426a
+gdb_test "p varv(1,5,17)" "no such vector element because not associated"
f9426a
+gdb_test "ptype varv(1,5,17)" "no such vector element because not associated"
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "varx-deallocated"]
f9426a
+gdb_continue_to_breakpoint "varx-deallocated"
f9426a
+gdb_test "p varx" "\\$\[0-9\]* = <not allocated>" "p varx deallocated"
f9426a
+gdb_test "ptype varx" "type = <not allocated>" "ptype varx deallocated"
f9426a
+gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varx deallocated"
f9426a
+gdb_test "p varx(1,5,17)" "no such vector element because not allocated" "p varx(1,5,17) deallocated"
f9426a
+gdb_test "ptype varx(1,5,17)" "no such vector element because not allocated" "ptype varx(1,5,17) deallocated"
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "vary-passed"]
f9426a
+gdb_continue_to_breakpoint "vary-passed"
f9426a
+# $1 = (( ( 1, 1, 1, 1, 1, 1) ( 1, 1, 1, 1, 1, 1) --- , 1) ) ( ( 1, 1, ...) ...) ...)
f9426a
+gdb_test "p vary" "\\$\[0-9\]* = \\(\[()1, .\]*\\)"
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "vary-filled"]
f9426a
+gdb_continue_to_breakpoint "vary-filled"
f9426a
+gdb_test "ptype vary" "type = real(\\(kind=4\\)|\\*4) \\(10,10\\)"
f9426a
+gdb_test "p vary(1, 1)" "\\$\[0-9\]* = 8"
f9426a
+gdb_test "p vary(2, 2)" "\\$\[0-9\]* = 9"
f9426a
+gdb_test "p vary(1, 3)" "\\$\[0-9\]* = 10"
f9426a
+# $1 = (( ( 3, 3, 3, 3, 3, 3) ( 3, 3, 3, 3, 3, 3) --- , 3) ) ( ( 3, 3, ...) ...) ...)
f9426a
+gdb_test "p varw" "\\$\[0-9\]* = \\(\[()3, .\]*\\)"
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "varw-almostfilled"]
f9426a
+gdb_continue_to_breakpoint "varw-almostfilled"
f9426a
+gdb_test "ptype varw" "type = real(\\(kind=4\\)|\\*4) \\(5,4,3\\)"
f9426a
+gdb_test "p varw(3,1,1)=1" "\\$\[0-9\]* = 1"
f9426a
+# $1 = (( ( 6, 5, 1, 5, 5, 5) ( 5, 5, 5, 5, 5, 5) --- , 5) ) ( ( 5, 5, ...) ...) ...)
f9426a
+gdb_test "p varw" "\\$\[0-9\]* = \\( *\\( *\\( *6, *5, *1,\[()5, .\]*\\)" "p varw filled"
f9426a
+# "up" works with GCC but other Fortran compilers may copy the values into the
f9426a
+# outer function only on the exit of the inner function.
f9426a
+# We need both variants as depending on the arch we optionally may still be
f9426a
+# executing the caller line or not after `finish'.
f9426a
+gdb_test "finish" ".*(call bar \\(y, x\\)|call foo \\(x, z\\(2:6, 4:7, 6:8\\)\\))"
f9426a
+gdb_test "p z(2,4,5)" "\\$\[0-9\]* = 3"
f9426a
+gdb_test "p z(2,4,6)" "\\$\[0-9\]* = 6"
f9426a
+gdb_test "p z(2,4,7)" "\\$\[0-9\]* = 5"
f9426a
+gdb_test "p z(4,4,6)" "\\$\[0-9\]* = 1"
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "varz-almostfilled"]
f9426a
+gdb_continue_to_breakpoint "varz-almostfilled"
f9426a
+# GCC uses the pointer type here, Intel Fortran Compiler 10.1.008 does not.
f9426a
+gdb_test "ptype varz" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(\\*\\)\\)?"
f9426a
+# Intel Fortran Compiler 10.1.008 has a bug here - (2:11,7:7)
f9426a
+# as it produces DW_AT_lower_bound == DW_AT_upper_bound == 7.
f9426a
+gdb_test "ptype vart" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(2:11,7:\\*\\)\\)?"
f9426a
+gdb_test "p varz" "\\$\[0-9\]* = \\(\\)"
f9426a
+gdb_test "p vart" "\\$\[0-9\]* = \\(\\)"
f9426a
+gdb_test "p varz(3)" "\\$\[0-9\]* = 4"
f9426a
+# maps to foo::vary(1,1)
f9426a
+gdb_test "p vart(2,7)" "\\$\[0-9\]* = 8"
f9426a
+# maps to foo::vary(2,2)
f9426a
+gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9"
f9426a
+# maps to foo::vary(1,3)
f9426a
+gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.f90
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.f90	2014-06-16 23:30:30.113940488 +0200
f9426a
@@ -0,0 +1,98 @@
f9426a
+! Copyright 2007 Free Software Foundation, Inc.
f9426a
+!
f9426a
+! This program is free software; you can redistribute it and/or modify
f9426a
+! it under the terms of the GNU General Public License as published by
f9426a
+! the Free Software Foundation; either version 2 of the License, or
f9426a
+! (at your option) any later version.
f9426a
+!
f9426a
+! This program is distributed in the hope that it will be useful,
f9426a
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+! GNU General Public License for more details.
f9426a
+!
f9426a
+! You should have received a copy of the GNU General Public License
f9426a
+! along with this program; if not, write to the Free Software
f9426a
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
f9426a
+!
f9426a
+! Ihis file is the Fortran source file for dynamic.exp.
f9426a
+! Original file written by Jakub Jelinek <jakub@redhat.com>.
f9426a
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
f9426a
+
f9426a
+subroutine baz
f9426a
+  real, target, allocatable :: varx (:, :, :)
f9426a
+  real, pointer :: varv (:, :, :)
f9426a
+  real, target :: varu (1, 2, 3)
f9426a
+  logical :: l
f9426a
+  allocate (varx (1:6, 5:15, 17:28))            ! varx-init
f9426a
+  l = allocated (varx)
f9426a
+  varx(:, :, :) = 6                             ! varx-allocated
f9426a
+  varx(1, 5, 17) = 7
f9426a
+  varx(2, 6, 18) = 8
f9426a
+  varx(6, 15, 28) = 9
f9426a
+  varv => varx                                  ! varx-filled
f9426a
+  l = associated (varv)
f9426a
+  varv(3, 7, 19) = 10                           ! varv-associated
f9426a
+  varv => null ()                               ! varv-filled
f9426a
+  l = associated (varv)
f9426a
+  deallocate (varx)                             ! varv-deassociated
f9426a
+  l = allocated (varx)
f9426a
+  varu(:, :, :) = 10                            ! varx-deallocated
f9426a
+  allocate (varv (1:6, 5:15, 17:28))
f9426a
+  l = associated (varv)
f9426a
+  varv(:, :, :) = 6
f9426a
+  varv(1, 5, 17) = 7
f9426a
+  varv(2, 6, 18) = 8
f9426a
+  varv(6, 15, 28) = 9
f9426a
+  deallocate (varv)
f9426a
+  l = associated (varv)
f9426a
+  varv => varu
f9426a
+  varv(1, 1, 1) = 6
f9426a
+  varv(1, 2, 3) = 7
f9426a
+  l = associated (varv)
f9426a
+end subroutine baz
f9426a
+subroutine foo (vary, varw)
f9426a
+  real :: vary (:, :)
f9426a
+  real :: varw (:, :, :)
f9426a
+  vary(:, :) = 4                                ! vary-passed
f9426a
+  vary(1, 1) = 8
f9426a
+  vary(2, 2) = 9
f9426a
+  vary(1, 3) = 10
f9426a
+  varw(:, :, :) = 5                             ! vary-filled
f9426a
+  varw(1, 1, 1) = 6
f9426a
+  varw(2, 2, 2) = 7                             ! varw-almostfilled
f9426a
+end subroutine foo
f9426a
+subroutine bar (varz, vart)
f9426a
+  real :: varz (*)
f9426a
+  real :: vart (2:11, 7:*)
f9426a
+  varz(1:3) = 4
f9426a
+  varz(2) = 5                                   ! varz-almostfilled
f9426a
+  vart(2,7) = vart(2,7)
f9426a
+end subroutine bar
f9426a
+program test
f9426a
+  interface
f9426a
+    subroutine foo (vary, varw)
f9426a
+    real :: vary (:, :)
f9426a
+    real :: varw (:, :, :)
f9426a
+    end subroutine
f9426a
+  end interface
f9426a
+  interface
f9426a
+    subroutine bar (varz, vart)
f9426a
+    real :: varz (*)
f9426a
+    real :: vart (2:11, 7:*)
f9426a
+    end subroutine
f9426a
+  end interface
f9426a
+  real :: x (10, 10), y (5), z(8, 8, 8)
f9426a
+  x(:,:) = 1
f9426a
+  y(:) = 2
f9426a
+  z(:,:,:) = 3
f9426a
+  call baz
f9426a
+  call foo (x, z(2:6, 4:7, 6:8))
f9426a
+  call bar (y, x)
f9426a
+  if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
f9426a
+  if (x (1, 3) .ne. 10) call abort
f9426a
+  if (z (2, 4, 6) .ne. 6 .or. z (3, 5, 7) .ne. 7 .or. z (2, 4, 7) .ne. 5) call abort
f9426a
+  if (any (y .ne. (/4, 5, 4, 2, 2/))) call abort
f9426a
+  call foo (transpose (x), z)
f9426a
+  if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
f9426a
+  if (x (3, 1) .ne. 10) call abort
f9426a
+end
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/string.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/string.exp	2014-06-16 23:30:30.114940489 +0200
f9426a
@@ -0,0 +1,59 @@
f9426a
+# Copyright 2008 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 2 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+# 
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+# 
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program; if not, write to the Free Software
f9426a
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
f9426a
+
f9426a
+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
f9426a
+
f9426a
+# This file is part of the gdb testsuite.  It contains tests for Fortran
f9426a
+# strings with dynamic length.
f9426a
+
f9426a
+set testfile "string"
f9426a
+set srcfile ${testfile}.f90
f9426a
+set binfile ${objdir}/${subdir}/${testfile}
f9426a
+
f9426a
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } {
f9426a
+    untested "Couldn't compile ${srcfile}"
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+gdb_exit
f9426a
+gdb_start
f9426a
+gdb_reinitialize_dir $srcdir/$subdir
f9426a
+gdb_load ${binfile}
f9426a
+
f9426a
+if ![runto MAIN__] then {
f9426a
+    perror "couldn't run to breakpoint MAIN__"
f9426a
+    continue
f9426a
+}
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "var-init"]
f9426a
+gdb_continue_to_breakpoint "var-init"
f9426a
+gdb_test "ptype c" "type = character(\\(kind=1\\)|\\*1)"
f9426a
+gdb_test "ptype d" "type = character(\\(kind=8\\)|\\*8)"
f9426a
+gdb_test "ptype e" "type = character(\\(kind=4\\)|\\*4)"
f9426a
+gdb_test "ptype f" "type = character(\\(kind=4\\)|\\*4) \\(7,8:10\\)"
f9426a
+gdb_test "ptype *e" "Attempt to take contents of a non-pointer value."
f9426a
+gdb_test "ptype *f" "type = character(\\(kind=4\\)|\\*4) \\(7\\)"
f9426a
+gdb_test "p c" "\\$\[0-9\]* = 'c'"
f9426a
+gdb_test "p d" "\\$\[0-9\]* = 'd       '"
f9426a
+gdb_test "p e" "\\$\[0-9\]* = 'g   '"
f9426a
+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   '\\) \\)"
f9426a
+gdb_test "p *e" "Attempt to take contents of a non-pointer value."
f9426a
+gdb_test "p *f" "Attempt to take contents of a non-pointer value."
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "var-finish"]
f9426a
+gdb_continue_to_breakpoint "var-finish"
f9426a
+gdb_test "p e" "\\$\[0-9\]* = 'e   '" "p e re-set"
f9426a
+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"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/string.f90
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/string.f90	2014-06-16 23:30:30.114940489 +0200
f9426a
@@ -0,0 +1,37 @@
f9426a
+! Copyright 2008 Free Software Foundation, Inc.
f9426a
+!
f9426a
+! This program is free software; you can redistribute it and/or modify
f9426a
+! it under the terms of the GNU General Public License as published by
f9426a
+! the Free Software Foundation; either version 2 of the License, or
f9426a
+! (at your option) any later version.
f9426a
+!
f9426a
+! This program is distributed in the hope that it will be useful,
f9426a
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+! GNU General Public License for more details.
f9426a
+!
f9426a
+! You should have received a copy of the GNU General Public License
f9426a
+! along with this program; if not, write to the Free Software
f9426a
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
f9426a
+!
f9426a
+! Ihis file is the Fortran source file for dynamic.exp.
f9426a
+! Original file written by Jakub Jelinek <jakub@redhat.com>.
f9426a
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
f9426a
+
f9426a
+subroutine foo (e, f)
f9426a
+  character (len=1) :: c
f9426a
+  character (len=8) :: d
f9426a
+  character (len=*) :: e
f9426a
+  character (len=*) :: f (1:7, 8:10)
f9426a
+  c = 'c'
f9426a
+  d = 'd'
f9426a
+  e = 'e'                                       ! var-init
f9426a
+  f = 'f'
f9426a
+  f(1,9) = 'f2'
f9426a
+  c = 'c'                                       ! var-finish
f9426a
+end subroutine foo
f9426a
+  character (len=4) :: g, h (1:7, 8:10)
f9426a
+  g = 'g'
f9426a
+  h = 'h'
f9426a
+  call foo (g, h)
f9426a
+end
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/subrange.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/subrange.exp	2014-06-16 23:30:30.114940489 +0200
f9426a
@@ -0,0 +1,72 @@
f9426a
+# Copyright 2011 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 3 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+#
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+#
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
f9426a
+
f9426a
+if { [skip_fortran_tests] } { return -1 }
f9426a
+
f9426a
+set testfile "subrange"
f9426a
+set srcfile ${testfile}.f90
f9426a
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+if ![runto MAIN__] {
f9426a
+    perror "Couldn't run to MAIN__"
f9426a
+    continue
f9426a
+}
f9426a
+
f9426a
+# Depending on the compiler version being used, the name of the 4-byte integer
f9426a
+# and real types can be printed differently.  For instance, gfortran-4.1 uses
f9426a
+# "int4" whereas gfortran-4.3 uses "int(kind=4)".
f9426a
+set int4 "(int4|integer\\(kind=4\\))"
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "break-static"]
f9426a
+gdb_continue_to_breakpoint "break-static" ".*break-static.*"
f9426a
+
f9426a
+foreach var {a alloc ptr} {
f9426a
+    global pf_prefix
f9426a
+    set old_prefix $pf_prefix
f9426a
+    lappend pf_prefix "$var:"
f9426a
+
f9426a
+    setup_kfail "*-*-*" "vlaregression/9999"
f9426a
+    gdb_test "p $var (2, 2:3)" { = \(22, 32\)}
f9426a
+    setup_kfail "*-*-*" "vlaregression/9999"
f9426a
+    gdb_test "p $var (2:3, 3)" { = \(32, 33\)}
f9426a
+    setup_kfail "*-*-*" "vlaregression/9999"
f9426a
+    gdb_test "p $var (1, 2:)" { = \(21, 31\)}
f9426a
+    setup_kfail "*-*-*" "vlaregression/9999"
f9426a
+    gdb_test "p $var (2, :2)" { = \(12, 22\)}
f9426a
+    setup_kfail "*-*-*" "vlaregression/9999"
f9426a
+    gdb_test "p $var (3, 2:2)" { = \(23\)}
f9426a
+    setup_kfail "*-*-*" "vlaregression/9999"
f9426a
+    gdb_test "ptype $var (3, 2:2)" " = $int4 \\(2:2\\)"
f9426a
+    setup_kfail "*-*-*" "vlaregression/9999"
f9426a
+    gdb_test "p $var (4, :)" { = \(14, 24, 34\)}
f9426a
+    setup_kfail "*-*-*" "vlaregression/9999"
f9426a
+    gdb_test "p $var (:, :)" { = \(\( *11, 12, 13, 14\) \( *21, 22, 23, 24\) \( *31, 32, 33, 34\) *\)}
f9426a
+    setup_kfail "*-*-*" "vlaregression/9999"
f9426a
+    gdb_test "ptype $var (:, :)" " = $int4 \\(4,3\\)"
f9426a
+    setup_kfail "*-*-*" "vlaregression/9999"
f9426a
+    gdb_test "p $var (:)" "Wrong number of subscripts"
f9426a
+    setup_kfail "*-*-*" "vlaregression/9999"
f9426a
+    gdb_test "p $var (:, :, :)" "Wrong number of subscripts"
f9426a
+
f9426a
+    set pf_prefix $old_prefix
f9426a
+}
f9426a
+
f9426a
+gdb_test_no_output {set $a=a}
f9426a
+delete_breakpoints
f9426a
+gdb_unload
f9426a
+setup_kfail "*-*-*" "vlaregression/9999"
f9426a
+gdb_test {p $a (3, 2:2)} { = \(23\)}
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/subrange.f90
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/subrange.f90	2014-06-16 23:30:30.114940489 +0200
f9426a
@@ -0,0 +1,28 @@
f9426a
+! Copyright 2011 Free Software Foundation, Inc.
f9426a
+!
f9426a
+! This program is free software; you can redistribute it and/or modify
f9426a
+! it under the terms of the GNU General Public License as published by
f9426a
+! the Free Software Foundation; either version 3 of the License, or
f9426a
+! (at your option) any later version.
f9426a
+! 
f9426a
+! This program is distributed in the hope that it will be useful,
f9426a
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+! GNU General Public License for more details.
f9426a
+! 
f9426a
+! You should have received a copy of the GNU General Public License
f9426a
+! along with this program.  If not, see <http://www.gnu.org/licenses/>.
f9426a
+
f9426a
+program test
f9426a
+  integer, target :: a (4, 3)
f9426a
+  integer, allocatable :: alloc (:, :)
f9426a
+  integer, pointer :: ptr (:, :)
f9426a
+  do 1 i = 1, 4
f9426a
+  do 1 j = 1, 3
f9426a
+    a (i, j) = j * 10 + i
f9426a
+1 continue
f9426a
+  allocate (alloc (4, 3))
f9426a
+  alloc = a
f9426a
+  ptr => a
f9426a
+  write (*,*) a                 ! break-static
f9426a
+end
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.mi/mi2-var-stale-type.c
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.mi/mi2-var-stale-type.c	2014-06-16 23:30:30.114940489 +0200
f9426a
@@ -0,0 +1,26 @@
f9426a
+/* Copyright 2011 Free Software Foundation, Inc.
f9426a
+
f9426a
+   This file is part of GDB.
f9426a
+
f9426a
+   This program is free software; you can redistribute it and/or modify
f9426a
+   it under the terms of the GNU General Public License as published by
f9426a
+   the Free Software Foundation; either version 3 of the License, or
f9426a
+   (at your option) any later version.
f9426a
+
f9426a
+   This program is distributed in the hope that it will be useful,
f9426a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+   GNU General Public License for more details.
f9426a
+
f9426a
+   You should have received a copy of the GNU General Public License
f9426a
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
f9426a
+
f9426a
+int
f9426a
+main (int argc, char **argv)
f9426a
+{
f9426a
+  char vla[argc];
f9426a
+
f9426a
+  vla[0] = 0;	/* break-here */
f9426a
+
f9426a
+  return 0;
f9426a
+}
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp	2014-06-16 23:30:30.114940489 +0200
f9426a
@@ -0,0 +1,57 @@
f9426a
+# Copyright 2011 Free Software Foundation, Inc.
f9426a
+#
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 3 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+#
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+#
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
f9426a
+
f9426a
+load_lib mi-support.exp
f9426a
+set MIFLAGS "-i=mi2"
f9426a
+
f9426a
+gdb_exit
f9426a
+if [mi_gdb_start] {
f9426a
+    continue
f9426a
+}
f9426a
+
f9426a
+set testfile "mi2-var-stale-type"
f9426a
+set srcfile ${testfile}.c
f9426a
+set binfile [standard_output_file ${testfile}]
f9426a
+if {[build_executable ${testfile}.exp $testfile $srcfile] == -1} {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+mi_delete_breakpoints
f9426a
+mi_gdb_reinitialize_dir $srcdir/$subdir
f9426a
+mi_gdb_load ${binfile}
f9426a
+
f9426a
+mi_gdb_test {-interpreter-exec console "maintenance set internal-error quit yes"} \
f9426a
+  {\^done} \
f9426a
+  "maintenance set internal-error quit yes"
f9426a
+
f9426a
+mi_gdb_test {-interpreter-exec console "maintenance set internal-error corefile yes"} \
f9426a
+  {\^done} \
f9426a
+  "maintenance set internal-error corefile yes"
f9426a
+
f9426a
+set line [gdb_get_line_number "break-here"]
f9426a
+set func "main"
f9426a
+
f9426a
+mi_gdb_test "-break-insert -t $srcfile:$line" \
f9426a
+  "\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",fullname=\".*\",line=\"$line\",\[^\r\n\]*,original-location=\".*\"\}" \
f9426a
+  "breakpoint at $func"
f9426a
+
f9426a
+if { [mi_run_cmd] < 0 } {
f9426a
+    return -1
f9426a
+}
f9426a
+mi_expect_stop "breakpoint-hit" $func ".*" ".*" "\[0-9\]+" { "" "disp=\"del\"" } "stop after initializing vla"
f9426a
+
f9426a
+mi_create_varobj "vla" "vla" "create local variable vla"
f9426a
+
f9426a
+mi_gdb_test "-var-update *" "\\^done,changelist=.*" "-var-update *"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register-func.c
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register-func.c	2014-06-16 23:30:30.115940490 +0200
f9426a
@@ -0,0 +1,22 @@
f9426a
+/* This file is part of GDB, the GNU debugger.
f9426a
+
f9426a
+   Copyright 2009 Free Software Foundation, Inc.
f9426a
+
f9426a
+   This program is free software; you can redistribute it and/or modify
f9426a
+   it under the terms of the GNU General Public License as published by
f9426a
+   the Free Software Foundation; either version 3 of the License, or
f9426a
+   (at your option) any later version.
f9426a
+
f9426a
+   This program is distributed in the hope that it will be useful,
f9426a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+   GNU General Public License for more details.
f9426a
+
f9426a
+   You should have received a copy of the GNU General Public License
f9426a
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
f9426a
+
f9426a
+int
f9426a
+func (int *arr)
f9426a
+{
f9426a
+  return arr[0];
f9426a
+}
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register.c
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register.c	2014-06-16 23:30:30.115940490 +0200
f9426a
@@ -0,0 +1,28 @@
f9426a
+/* This file is part of GDB, the GNU debugger.
f9426a
+
f9426a
+   Copyright 2009 Free Software Foundation, Inc.
f9426a
+
f9426a
+   This program is free software; you can redistribute it and/or modify
f9426a
+   it under the terms of the GNU General Public License as published by
f9426a
+   the Free Software Foundation; either version 3 of the License, or
f9426a
+   (at your option) any later version.
f9426a
+
f9426a
+   This program is distributed in the hope that it will be useful,
f9426a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+   GNU General Public License for more details.
f9426a
+
f9426a
+   You should have received a copy of the GNU General Public License
f9426a
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
f9426a
+
f9426a
+extern int func (int *arr);
f9426a
+
f9426a
+int
f9426a
+main (void)
f9426a
+{
f9426a
+  int arr[] = { 42 };
f9426a
+
f9426a
+  func (arr);
f9426a
+
f9426a
+  return 0;
f9426a
+}
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register.exp	2014-06-16 23:30:30.115940490 +0200
f9426a
@@ -0,0 +1,33 @@
f9426a
+# Copyright 2009 Free Software Foundation, Inc.
f9426a
+#
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 2 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+#
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+#
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program; if not, write to the Free Software
f9426a
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
f9426a
+#
f9426a
+# This file is part of the gdb testsuite.
f9426a
+
f9426a
+if { [prepare_for_testing array-from-register.exp "array-from-register"      \
f9426a
+			  {array-from-register.c array-from-register-func.c} \
f9426a
+			  {debug optimize=-O2}] } {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+if ![runto func] then {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+gdb_test "p arr" "\\$\[0-9\]+ = \\(int \\*\\) *0x\[0-9a-f\]+"
f9426a
+
f9426a
+# Seen regression:
f9426a
+# Address requested for identifier "arr" which is in register $rdi
f9426a
+gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42"
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.pascal/arrays.exp
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.pascal/arrays.exp	2014-06-16 23:30:30.115940490 +0200
f9426a
@@ -0,0 +1,104 @@
f9426a
+# Copyright 2008, 2009 Free Software Foundation, Inc.
f9426a
+#
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 3 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+#
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+#
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
f9426a
+
f9426a
+if $tracelevel then {
f9426a
+    strace $tracelevel
f9426a
+}
f9426a
+
f9426a
+load_lib "pascal.exp"
f9426a
+
f9426a
+set testfile "arrays"
f9426a
+set srcfile ${testfile}.pas
f9426a
+set binfile ${objdir}/${subdir}/${testfile}$EXEEXT
f9426a
+
f9426a
+# These tests only work with fpc, using the -gw3 compile-option
f9426a
+pascal_init
f9426a
+if { $pascal_compiler_is_fpc != 1 } {
f9426a
+  return -1
f9426a
+}
f9426a
+
f9426a
+# Detect if the fpc version is below 2.3.0
f9426a
+set fpc_generates_dwarf_for_dynamic_arrays 1
f9426a
+if { ($fpcversion_major < 2) || ( ($fpcversion_major == 2) && ($fpcversion_minor < 3))}  {
f9426a
+  set fpc_generates_dwarf_for_dynamic_arrays 0
f9426a
+}
f9426a
+
f9426a
+
f9426a
+if {[gdb_compile_pascal "-gw3 ${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } {
f9426a
+  return -1
f9426a
+}
f9426a
+
f9426a
+gdb_exit
f9426a
+gdb_start
f9426a
+gdb_reinitialize_dir $srcdir/$subdir
f9426a
+gdb_load ${binfile}
f9426a
+set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
f9426a
+set bp_location2 [gdb_get_line_number "set breakpoint 2 here"]
f9426a
+
f9426a
+
f9426a
+if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
f9426a
+    pass "setting breakpoint 1"
f9426a
+}
f9426a
+if { [gdb_breakpoint ${srcfile}:${bp_location2}] } {
f9426a
+    pass "setting breakpoint 2"
f9426a
+}
f9426a
+
f9426a
+# Verify that "start" lands inside the right procedure.
f9426a
+if { [gdb_start_cmd] < 0 } {
f9426a
+    untested start
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+gdb_test "" ".* at .*${srcfile}.*" "start"
f9426a
+
f9426a
+gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint"
f9426a
+
f9426a
+gdb_test "print StatArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer type"
f9426a
+gdb_test "print StatArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer"
f9426a
+
f9426a
+gdb_test "cont" "Breakpoint .*:${bp_location2}.*" "Going to second breakpoint"
f9426a
+
f9426a
+gdb_test "print StatArrChar" ".* = 'abcdefghijkl'" "Print static array of char"
f9426a
+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"
f9426a
+
f9426a
+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
f9426a
+  setup_xfail "*-*-*"
f9426a
+}
f9426a
+gdb_test "print DynArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer type"
f9426a
+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
f9426a
+  setup_xfail "*-*-*"
f9426a
+}
f9426a
+gdb_test "print DynArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer"
f9426a
+
f9426a
+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
f9426a
+  setup_xfail "*-*-*"
f9426a
+}
f9426a
+gdb_test "print s" ".* = 'test'#0'string'" "Print string containing null-char"
f9426a
+
f9426a
+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
f9426a
+  setup_xfail "*-*-*"
f9426a
+}
f9426a
+gdb_test "print DynArrStr" ".* = \\{'dstr0', 'dstr1', 'dstr2', 'dstr3', 'dstr4', 'dstr5', 'dstr6', 'dstr7', 'dstr8', 'dstr9', 'dstr10', 'dstr11', 'dstr12'\\}" "Print dynamic array of string"
f9426a
+
f9426a
+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
f9426a
+  setup_xfail "*-*-*"
f9426a
+}
f9426a
+gdb_test "print StatArrStr" ".* = \\{'str0', 'str1', 'str2', 'str3', 'str4', 'str5', 'str6', 'str7', 'str8', 'str9', 'str10', 'str11', 'str12'\\}" "Print static array of string"
f9426a
+
f9426a
+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
f9426a
+  setup_xfail "*-*-*"
f9426a
+}
f9426a
+gdb_test "print DynArrChar" ".* = 'abcdefghijklm'" "Print dynamic array of char"
f9426a
+
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.pascal/arrays.pas
f9426a
===================================================================
f9426a
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.pascal/arrays.pas	2014-06-16 23:30:30.115940490 +0200
f9426a
@@ -0,0 +1,82 @@
f9426a
+{
f9426a
+ Copyright 2008, 2009 Free Software Foundation, Inc.
f9426a
+
f9426a
+ This program is free software; you can redistribute it and/or modify
f9426a
+ it under the terms of the GNU General Public License as published by
f9426a
+ the Free Software Foundation; either version 3 of the License, or
f9426a
+ (at your option) any later version.
f9426a
+
f9426a
+ This program is distributed in the hope that it will be useful,
f9426a
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+ GNU General Public License for more details.
f9426a
+
f9426a
+ You should have received a copy of the GNU General Public License
f9426a
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
f9426a
+}
f9426a
+
f9426a
+program arrays;
f9426a
+
f9426a
+{$mode objfpc}{$h+}
f9426a
+
f9426a
+uses sysutils;
f9426a
+
f9426a
+type TStatArrInt= array[0..11] of integer;
f9426a
+     TDynArrInt= array of integer;
f9426a
+     TStatArrStr= array[0..12] of string;
f9426a
+     TDynArrStr= array of string;
f9426a
+     TDynArrChar = array of char;
f9426a
+     TStatArrChar = array [0..11] of char;
f9426a
+
f9426a
+     TStat2dArrInt = array[0..11,0..4] of integer;
f9426a
+
f9426a
+var StatArrInt: TStatArrInt;
f9426a
+    StatArrInt_: Array[0..11] of integer;
f9426a
+    DynArrInt:  TDynArrInt;
f9426a
+    DynArrInt_: Array of integer;
f9426a
+    StatArrStr: TStatArrStr;
f9426a
+    DynArrStr: TDynArrStr;
f9426a
+    StatArrChar: TStatArrChar;
f9426a
+    DynArrChar: TDynArrChar;
f9426a
+
f9426a
+    Stat2dArrInt: TStat2dArrInt;
f9426a
+
f9426a
+    s: string;
f9426a
+	
f9426a
+    i,j : integer;
f9426a
+
f9426a
+begin
f9426a
+  for i := 0 to 11 do
f9426a
+    begin
f9426a
+    StatArrInt[i]:= i+50;
f9426a
+    StatArrInt_[i]:= i+50;
f9426a
+    StatArrChar[i]:= chr(ord('a')+i);
f9426a
+    for j := 0 to 4 do
f9426a
+      Stat2dArrInt[i,j]:=i+j;
f9426a
+    end;
f9426a
+  writeln(StatArrInt_[0]);
f9426a
+  writeln(StatArrInt[0]); { set breakpoint 1 here }
f9426a
+  writeln(StatArrChar[0]);
f9426a
+  writeln(Stat2dArrInt[0,0]);
f9426a
+
f9426a
+  setlength(DynArrInt,13);
f9426a
+  setlength(DynArrInt_,13);
f9426a
+  setlength(DynArrStr,13);
f9426a
+  setlength(DynArrChar,13);
f9426a
+  for i := 0 to 12 do
f9426a
+    begin
f9426a
+    DynArrInt[i]:= i+50;
f9426a
+    DynArrInt_[i]:= i+50;
f9426a
+    DynArrChar[i]:= chr(ord('a')+i);
f9426a
+    StatArrStr[i]:='str'+inttostr(i);
f9426a
+    DynArrStr[i]:='dstr'+inttostr(i);
f9426a
+    end;
f9426a
+  writeln(DynArrInt_[1]);
f9426a
+  writeln(DynArrInt[1]); 
f9426a
+  writeln(DynArrStr[1]); 
f9426a
+  writeln(StatArrStr[1]);
f9426a
+  writeln(DynArrChar[1]);
f9426a
+
f9426a
+  s := 'test'#0'string';
f9426a
+  writeln(s); { set breakpoint 2 here }
f9426a
+end.
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/lib/gdb.exp
f9426a
===================================================================
f9426a
--- gdb-7.7.90.20140613.orig/gdb/testsuite/lib/gdb.exp	2014-06-16 23:30:29.278939700 +0200
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/lib/gdb.exp	2014-06-16 23:30:30.117940492 +0200
f9426a
@@ -159,6 +159,11 @@ proc gdb_unload {} {
f9426a
 	    send_gdb "y\n"
f9426a
 	    exp_continue
f9426a
 	}
f9426a
+	-re "A program is being debugged already..*Are you sure you want to change the file.*y or n. $"\
f9426a
+	    { send_gdb "y\n"
f9426a
+		verbose "\t\tUnloading symbols for program being debugged"
f9426a
+	    exp_continue
f9426a
+	}
f9426a
 	-re "Discard symbol table from .*y or n.*$" {
f9426a
 	    send_gdb "y\n"
f9426a
 	    exp_continue
f9426a
Index: gdb-7.7.90.20140613/gdb/testsuite/lib/pascal.exp
f9426a
===================================================================
f9426a
--- gdb-7.7.90.20140613.orig/gdb/testsuite/lib/pascal.exp	2014-06-13 03:59:37.000000000 +0200
f9426a
+++ gdb-7.7.90.20140613/gdb/testsuite/lib/pascal.exp	2014-06-16 23:30:30.117940492 +0200
f9426a
@@ -37,6 +37,9 @@ proc pascal_init {} {
f9426a
     global pascal_compiler_is_fpc
f9426a
     global gpc_compiler
f9426a
     global fpc_compiler
f9426a
+    global fpcversion_major
f9426a
+    global fpcversion_minor
f9426a
+    global fpcversion_release
f9426a
     global env
f9426a
  
f9426a
     if { $pascal_init_done == 1 } {
f9426a
@@ -64,6 +67,20 @@ proc pascal_init {} {
f9426a
 	    set pascal_compiler_is_fpc 1
f9426a
 	    verbose -log "Free Pascal compiler found"
f9426a
 	}
f9426a
+
f9426a
+	# Detect the fpc-version
f9426a
+	if { $pascal_compiler_is_fpc == 1 } {
f9426a
+	    set fpcversion_major 1
f9426a
+	    set fpcversion_minor 0
f9426a
+	    set fpcversion_release 0
f9426a
+	    set fpcversion [ remote_exec host $fpc_compiler "-iV" ] 
f9426a
+	    if [regexp {.*([0-9]+)\.([0-9]+)\.([0-9]+).?} $fpcversion] {
f9426a
+              regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\1} fpcversion_major
f9426a
+              regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\2} fpcversion_minor
f9426a
+              regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\3} fpcversion_release
f9426a
+	    }
f9426a
+            verbose -log "Freepascal version: $fpcversion_major.$fpcversion_minor.$fpcversion_release"
f9426a
+	}
f9426a
     }
f9426a
     set pascal_init_done 1
f9426a
 }