public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gdb] gdb-17.2-rebase-f44: Rebase to FSF GDB 7.7.91.20140721 (pre-7.8 snapshot).
@ 2026-06-27 23:56 Jan Kratochvil
0 siblings, 0 replies; only message in thread
From: Jan Kratochvil @ 2026-06-27 23:56 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/gdb
Branch : gdb-17.2-rebase-f44
Commit : a972d47b4c2f40fb5a7564a83e13ea31349bcc54
Author : Jan Kratochvil <jan.kratochvil@redhat.com>
Date : 2014-07-22T20:38:38+02:00
Stats : +1811/-1590 in 10 file(s)
URL : https://src.fedoraproject.org/rpms/gdb/c/a972d47b4c2f40fb5a7564a83e13ea31349bcc54?branch=gdb-17.2-rebase-f44
Log:
Rebase to FSF GDB 7.7.91.20140721 (pre-7.8 snapshot).
- Rebase the Intel VLA patchset.
- New fix of the optimized-out entry data values crash (BZ 1111910).
- [testsuite] Fix paginate-*.exp race for "read1".
---
diff --git a/.gitignore b/.gitignore
index 1e24b85..bb0d7a7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
/gdb-libstdc++-v3-python-r155978.tar.bz2
-/gdb-7.7.90.20140711.tar.bz2
+/gdb-7.7.91.20140721.tar.bz2
diff --git a/gdb-entrydataoptimizedout.patch b/gdb-entrydataoptimizedout.patch
deleted file mode 100644
index c28ff3a..0000000
--- a/gdb-entrydataoptimizedout.patch
+++ /dev/null
@@ -1,1056 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2014-07/msg00277.html
-Subject: [patchv3] Fix crash on optimized-out entry data values
-
-
---Dxnq1zWXvFF0Q93v
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline
-
-On Wed, 09 Jul 2014 17:31:21 +0200, Jan Kratochvil wrote:
-> On Wed, 09 Jul 2014 13:52:00 +0200, Pedro Alves wrote:
-> > On 07/09/2014 11:33 AM, Jan Kratochvil wrote:
-> > > --- a/gdb/value.c
-> > > +++ b/gdb/value.c
-> > > @@ -198,12 +198,13 @@ struct value
-> > > unsigned int lazy : 1;
-> > >
-> > > /* If nonzero, this is the value of a variable that does not
-> > > - actually exist in the program. If nonzero, and LVAL is
-> > > + actually fully exist in the program. If nonzero, and LVAL is
-> > > lval_register, this is a register ($pc, $sp, etc., never a
-> > > program variable) that has not been saved in the frame. All
-> > > optimized-out values are treated pretty much the same, except
-> > > registers have a different string representation and related
-> > > - error strings. */
-> > > + error strings. It is true also for only partially optimized
-> > > + out variables - see the 'unavailable' field below. */
-> > > unsigned int optimized_out : 1;
-> > >
-> > > /* If value is a variable, is it initialized or not. */
-> > > @@ -334,7 +335,10 @@ struct value
-> > > valid if lazy is nonzero. */
-> > > gdb_byte *contents;
-> > >
-> > > - /* Unavailable ranges in CONTENTS. We mark unavailable ranges,
-> > > + /* If OPTIMIZED_OUT is false then UNAVAILABLE must be VEC_empty
-> > > + (not necessarily NULL).
-> >
-> > Hmm, why? We can collect only part of a non-optimized out value.
-> > What am I missing?
->
-> I miss some documentation how these availability fields interact together.
-
->From a comment in mail
- Message-Id: <201102071427.55970.pedro@codesourcery.com>
- We give preference to printing <optimized out> rather
- than <unavailable>, since if a value had been optimized out
- at compile time, it can never be collected at run-time.
-
-it seems it is just reversed, that 'unavailable' can exist only for
-!optimized_out and it cannot exist for for optimized_out values.
-
-
-> You are right, this patch regresses during gdbserver mode.
-
-It PASSes now even in gdbserver mode.
-
-
-Thanks,
-Jan
-
---Dxnq1zWXvFF0Q93v
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline; filename="optimfix3.patch"
-
-gdb/
-2014-07-09 Jan Kratochvil <jan.kratochvil@redhat.com>
-
- * value.c (struct value): Extend the comment for fields optimized_out
- and unavailable.
- (value_available_contents_bits_eq): Handle OPTIMIZED_OUT values as
- special cases.
-
-gdb/testsuite/
-2014-07-09 Jan Kratochvil <jan.kratochvil@redhat.com>
-
- * gdb.arch/amd64-entry-value-paramref.S: New file.
- * gdb.arch/amd64-entry-value-paramref.cc: New file.
- * gdb.arch/amd64-entry-value-paramref.exp: New file.
- * gdb.arch/amd64-optimout-repeat.S: New file.
- * gdb.arch/amd64-optimout-repeat.c: New file.
- * gdb.arch/amd64-optimout-repeat.exp: New file.
-
-diff --git a/gdb/value.c b/gdb/value.c
-index 557056f..c017c75 100644
---- a/gdb/value.c
-+++ b/gdb/value.c
-@@ -198,12 +198,14 @@ struct value
- unsigned int lazy : 1;
-
- /* If nonzero, this is the value of a variable that does not
-- actually exist in the program. If nonzero, and LVAL is
-+ actually exist in the program at all. If nonzero, and LVAL is
- lval_register, this is a register ($pc, $sp, etc., never a
- program variable) that has not been saved in the frame. All
- optimized-out values are treated pretty much the same, except
- registers have a different string representation and related
-- error strings. */
-+ error strings. When it is zero it still maybe only partially
-+ available (equally partially optimized out) - see the
-+ 'unavailable' field below. */
- unsigned int optimized_out : 1;
-
- /* If value is a variable, is it initialized or not. */
-@@ -334,7 +336,9 @@ struct value
- valid if lazy is nonzero. */
- gdb_byte *contents;
-
-- /* Unavailable ranges in CONTENTS. We mark unavailable ranges,
-+ /* If OPTIMIZED_OUT is nonzero then UNAVAILABLE must be VEC_empty
-+ (not necessarily NULL). Otherwise it specifies
-+ unavailable ranges in CONTENTS. We mark unavailable ranges,
- rather than available, since the common and default case is for a
- value to be available. This is filled in at value read time. The
- unavailable ranges are tracked in bits. */
-@@ -701,6 +705,13 @@ value_available_contents_bits_eq (const struct value *val1, int offset1,
- /* See function description in value.h. */
- gdb_assert (!val1->lazy && !val2->lazy);
-
-+ gdb_assert (!val1->optimized_out || VEC_empty (range_s, val1->unavailable));
-+ gdb_assert (!val2->optimized_out || VEC_empty (range_s, val2->unavailable));
-+ if (val1->optimized_out != val2->optimized_out)
-+ return 0;
-+ if (val1->optimized_out && val2->optimized_out)
-+ return 1;
-+
- while (length > 0)
- {
- range_s *r1, *r2;
-diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.S b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.S
-new file mode 100644
-index 0000000..a1e9d0a
---- /dev/null
-+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.S
-@@ -0,0 +1,459 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2014 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+/* This file is compiled from gdb.arch/amd64-entry-value-paramref.cc
-+ using -g -dA -S -O2.
-+ Additionally it has been patched. */
-+
-+ .file "amd64-entry-value-paramref.cc"
-+ .text
-+.Ltext0:
-+ .p2align 4,,15
-+ .type _ZL3barRi.constprop.0, @function
-+_ZL3barRi.constprop.0:
-+.LFB2:
-+ .file 1 "gdb.arch/amd64-entry-value-paramref.cc"
-+ # gdb.arch/amd64-entry-value-paramref.cc:21
-+ .loc 1 21 0
-+ .cfi_startproc
-+.LVL0:
-+# BLOCK 2 freq:10000 seq:0
-+# PRED: ENTRY [100.0%] (FALLTHRU)
-+ # gdb.arch/amd64-entry-value-paramref.cc:23
-+ .loc 1 23 0
-+ movl vv(%rip), %eax
-+ # gdb.arch/amd64-entry-value-paramref.cc:24
-+ .loc 1 24 0
-+ movq %rdi, p(%rip)
-+ # gdb.arch/amd64-entry-value-paramref.cc:23
-+ .loc 1 23 0
-+ addl $1, %eax
-+ movl %eax, vv(%rip)
-+ # gdb.arch/amd64-entry-value-paramref.cc:25
-+ .loc 1 25 0
-+ movl (%rdi), %eax
-+# SUCC: EXIT [100.0%]
-+ # gdb.arch/amd64-entry-value-paramref.cc:26
-+ .loc 1 26 0
-+ ret
-+ .cfi_endproc
-+.LFE2:
-+ .size _ZL3barRi.constprop.0, .-_ZL3barRi.constprop.0
-+ .section .text.startup,"ax",@progbits
-+ .p2align 4,,15
-+ .globl main
-+ .type main, @function
-+main:
-+.LFB1:
-+ # gdb.arch/amd64-entry-value-paramref.cc:30
-+ .loc 1 30 0
-+ .cfi_startproc
-+# BLOCK 2 freq:10000 seq:0
-+# PRED: ENTRY [100.0%] (FALLTHRU)
-+ subq $16, %rsp
-+ .cfi_def_cfa_offset 24
-+.LBB2:
-+ # gdb.arch/amd64-entry-value-paramref.cc:32
-+ .loc 1 32 0
-+ leaq 12(%rsp), %rdi
-+ # gdb.arch/amd64-entry-value-paramref.cc:31
-+ .loc 1 31 0
-+ movl $10, 12(%rsp)
-+ # gdb.arch/amd64-entry-value-paramref.cc:32
-+ .loc 1 32 0
-+ call _ZL3barRi.constprop.0
-+.LVL1:
-+.LBE2:
-+ # gdb.arch/amd64-entry-value-paramref.cc:33
-+ .loc 1 33 0
-+ addq $16, %rsp
-+ .cfi_def_cfa_offset 8
-+# SUCC: EXIT [100.0%]
-+ ret
-+ .cfi_endproc
-+.LFE1:
-+ .size main, .-main
-+ .globl p
-+ .bss
-+ .align 8
-+ .type p, @object
-+ .size p, 8
-+p:
-+ .zero 8
-+ .globl vv
-+ .align 4
-+ .type vv, @object
-+ .size vv, 4
-+vv:
-+ .zero 4
-+ .text
-+.Letext0:
-+ .section .debug_info,"",@progbits
-+.Ldebug_info0:
-+ .long .Linfo_end - .Linfo_start # Length of Compilation Unit Info
-+.Linfo_start:
-+ .value 0x4 # DWARF version number
-+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section
-+ .byte 0x8 # Pointer Size (in bytes)
-+ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
-+ .long .LASF0 # DW_AT_producer: "GNU C++ 4.8.2 20131212 (Red Hat 4.8.2-7) -mtune=generic -march=x86-64 -g -O2"
-+ .byte 0x4 # DW_AT_language
-+ .long .LASF1 # DW_AT_name: "gdb.arch/amd64-entry-value-paramref.cc"
-+ .long .LASF2 # DW_AT_comp_dir: ""
-+ .long .Ldebug_ranges0+0 # DW_AT_ranges
-+ .quad 0 # DW_AT_low_pc
-+ .long .Ldebug_line0 # DW_AT_stmt_list
-+DIE29: .uleb128 0x2 # (DIE (0x29) DW_TAG_subprogram)
-+ .ascii "bar\0" # DW_AT_name
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-paramref.cc)
-+ .byte 0x15 # DW_AT_decl_line
-+ .long DIE45 # DW_AT_type
-+ .byte 0x1 # DW_AT_inline
-+DIE39: .uleb128 0x3 # (DIE (0x39) DW_TAG_formal_parameter)
-+ .ascii "ref\0" # DW_AT_name
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-paramref.cc)
-+ .byte 0x15 # DW_AT_decl_line
-+ .long DIE4c # DW_AT_type
-+ .byte 0 # end of children of DIE 0x29
-+DIE45: .uleb128 0x4 # (DIE (0x45) DW_TAG_base_type)
-+ .byte 0x4 # DW_AT_byte_size
-+ .byte 0x5 # DW_AT_encoding
-+ .ascii "int\0" # DW_AT_name
-+DIE4c: .uleb128 0x5 # (DIE (0x4c) DW_TAG_const_type)
-+ .long DIE51 # DW_AT_type
-+DIE51: .uleb128 0x6 # (DIE (0x51) DW_TAG_reference_type)
-+ .byte 0x8 # DW_AT_byte_size
-+ .long DIE45 # DW_AT_type
-+DIE57: .uleb128 0x7 # (DIE (0x57) DW_TAG_subprogram)
-+ .long DIE29 # DW_AT_abstract_origin
-+ .quad .LFB2 # DW_AT_low_pc
-+ .quad .LFE2-.LFB2 # DW_AT_high_pc
-+ .uleb128 0x1 # DW_AT_frame_base
-+ .byte 0x9c # DW_OP_call_frame_cfa
-+ # DW_AT_GNU_all_call_sites
-+DIE72: .uleb128 0x8 # (DIE (0x72) DW_TAG_formal_parameter)
-+ .long DIE39 # DW_AT_abstract_origin
-+ .uleb128 0x1 # DW_AT_location
-+ .byte 0x55 # DW_OP_reg5
-+ .byte 0 # end of children of DIE 0x57
-+DIE7a: .uleb128 0x9 # (DIE (0x7a) DW_TAG_subprogram)
-+ # DW_AT_external
-+ .long .LASF3 # DW_AT_name: "main"
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-paramref.cc)
-+ .byte 0x1d # DW_AT_decl_line
-+ .long DIE45 # DW_AT_type
-+ .quad .LFB1 # DW_AT_low_pc
-+ .quad .LFE1-.LFB1 # DW_AT_high_pc
-+ .uleb128 0x1 # DW_AT_frame_base
-+ .byte 0x9c # DW_OP_call_frame_cfa
-+ # DW_AT_GNU_all_call_sites
-+DIE9b: .uleb128 0xa # (DIE (0x9b) DW_TAG_lexical_block)
-+ .quad .LBB2 # DW_AT_low_pc
-+ .quad .LBE2-.LBB2 # DW_AT_high_pc
-+DIEac: .uleb128 0xb # (DIE (0xac) DW_TAG_variable)
-+ .ascii "var\0" # DW_AT_name
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-paramref.cc)
-+ .byte 0x1f # DW_AT_decl_line
-+ .long DIE45 # DW_AT_type
-+ .uleb128 0x2 # DW_AT_location
-+ .byte 0x91 # DW_OP_fbreg
-+ .sleb128 -12
-+DIEba: .uleb128 0xc # (DIE (0xba) DW_TAG_GNU_call_site)
-+ .quad .LVL1 # DW_AT_low_pc
-+ .long DIE57 # DW_AT_abstract_origin
-+DIEc7: .uleb128 0xd # (DIE (0xc7) DW_TAG_GNU_call_site_parameter)
-+ .uleb128 0x1 # DW_AT_location
-+ .byte 0x55 # DW_OP_reg5
-+ .uleb128 0x2 # DW_AT_GNU_call_site_value
-+ .byte 0x91 # DW_OP_fbreg
-+ .sleb128 -12
-+#if 0
-+ .uleb128 0x1 # DW_AT_GNU_call_site_data_value
-+ .byte 0x3a # DW_OP_lit10
-+#else
-+ .uleb128 1f - 2f # DW_AT_GNU_call_site_data_value
-+2:
-+ .byte 0xf3 # DW_OP_GNU_entry_value
-+ .uleb128 1f - 3f
-+3:
-+ .byte 0x55 # DW_OP_reg5
-+1:
-+#endif
-+ .byte 0 # end of children of DIE 0xba
-+ .byte 0 # end of children of DIE 0x9b
-+ .byte 0 # end of children of DIE 0x7a
-+DIEd2: .uleb128 0xe # (DIE (0xd2) DW_TAG_variable)
-+ .ascii "vv\0" # DW_AT_name
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-paramref.cc)
-+ .byte 0x12 # DW_AT_decl_line
-+ .long DIEe6 # DW_AT_type
-+ # DW_AT_external
-+ .uleb128 0x9 # DW_AT_location
-+ .byte 0x3 # DW_OP_addr
-+ .quad vv
-+DIEe6: .uleb128 0xf # (DIE (0xe6) DW_TAG_volatile_type)
-+ .long DIE45 # DW_AT_type
-+DIEeb: .uleb128 0xe # (DIE (0xeb) DW_TAG_variable)
-+ .ascii "p\0" # DW_AT_name
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-paramref.cc)
-+ .byte 0x12 # DW_AT_decl_line
-+ .long DIEfe # DW_AT_type
-+ # DW_AT_external
-+ .uleb128 0x9 # DW_AT_location
-+ .byte 0x3 # DW_OP_addr
-+ .quad p
-+DIEfe: .uleb128 0x10 # (DIE (0xfe) DW_TAG_pointer_type)
-+ .byte 0x8 # DW_AT_byte_size
-+ .long DIEe6 # DW_AT_type
-+ .byte 0 # end of children of DIE 0xb
-+.Linfo_end:
-+ .section .debug_abbrev,"",@progbits
-+.Ldebug_abbrev0:
-+ .uleb128 0x1 # (abbrev code)
-+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x25 # (DW_AT_producer)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x13 # (DW_AT_language)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x1b # (DW_AT_comp_dir)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x55 # (DW_AT_ranges)
-+ .uleb128 0x17 # (DW_FORM_sec_offset)
-+ .uleb128 0x11 # (DW_AT_low_pc)
-+ .uleb128 0x1 # (DW_FORM_addr)
-+ .uleb128 0x10 # (DW_AT_stmt_list)
-+ .uleb128 0x17 # (DW_FORM_sec_offset)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x2 # (abbrev code)
-+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x20 # (DW_AT_inline)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x3 # (abbrev code)
-+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x4 # (abbrev code)
-+ .uleb128 0x24 # (TAG: DW_TAG_base_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0xb # (DW_AT_byte_size)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3e # (DW_AT_encoding)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x5 # (abbrev code)
-+ .uleb128 0x26 # (TAG: DW_TAG_const_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x6 # (abbrev code)
-+ .uleb128 0x10 # (TAG: DW_TAG_reference_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0xb # (DW_AT_byte_size)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x7 # (abbrev code)
-+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x31 # (DW_AT_abstract_origin)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x11 # (DW_AT_low_pc)
-+ .uleb128 0x1 # (DW_FORM_addr)
-+ .uleb128 0x12 # (DW_AT_high_pc)
-+ .uleb128 0x7 # (DW_FORM_data8)
-+ .uleb128 0x40 # (DW_AT_frame_base)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
-+ .uleb128 0x19 # (DW_FORM_flag_present)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x8 # (abbrev code)
-+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x31 # (DW_AT_abstract_origin)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x2 # (DW_AT_location)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x9 # (abbrev code)
-+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x3f # (DW_AT_external)
-+ .uleb128 0x19 # (DW_FORM_flag_present)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x11 # (DW_AT_low_pc)
-+ .uleb128 0x1 # (DW_FORM_addr)
-+ .uleb128 0x12 # (DW_AT_high_pc)
-+ .uleb128 0x7 # (DW_FORM_data8)
-+ .uleb128 0x40 # (DW_AT_frame_base)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
-+ .uleb128 0x19 # (DW_FORM_flag_present)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0xa # (abbrev code)
-+ .uleb128 0xb # (TAG: DW_TAG_lexical_block)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x11 # (DW_AT_low_pc)
-+ .uleb128 0x1 # (DW_FORM_addr)
-+ .uleb128 0x12 # (DW_AT_high_pc)
-+ .uleb128 0x7 # (DW_FORM_data8)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0xb # (abbrev code)
-+ .uleb128 0x34 # (TAG: DW_TAG_variable)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x2 # (DW_AT_location)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0xc # (abbrev code)
-+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x11 # (DW_AT_low_pc)
-+ .uleb128 0x1 # (DW_FORM_addr)
-+ .uleb128 0x31 # (DW_AT_abstract_origin)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0xd # (abbrev code)
-+ .uleb128 0x410a # (TAG: DW_TAG_GNU_call_site_parameter)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x2 # (DW_AT_location)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .uleb128 0x2111 # (DW_AT_GNU_call_site_value)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .uleb128 0x2112 # (DW_AT_GNU_call_site_data_value)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0xe # (abbrev code)
-+ .uleb128 0x34 # (TAG: DW_TAG_variable)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x3f # (DW_AT_external)
-+ .uleb128 0x19 # (DW_FORM_flag_present)
-+ .uleb128 0x2 # (DW_AT_location)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0xf # (abbrev code)
-+ .uleb128 0x35 # (TAG: DW_TAG_volatile_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x10 # (abbrev code)
-+ .uleb128 0xf # (TAG: DW_TAG_pointer_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0xb # (DW_AT_byte_size)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .byte 0
-+ .section .debug_aranges,"",@progbits
-+ .long 0x3c # Length of Address Ranges Info
-+ .value 0x2 # DWARF Version
-+ .long .Ldebug_info0 # Offset of Compilation Unit Info
-+ .byte 0x8 # Size of Address
-+ .byte 0 # Size of Segment Descriptor
-+ .value 0 # Pad to 16 byte boundary
-+ .value 0
-+ .quad .Ltext0 # Address
-+ .quad .Letext0-.Ltext0 # Length
-+ .quad .LFB1 # Address
-+ .quad .LFE1-.LFB1 # Length
-+ .quad 0
-+ .quad 0
-+ .section .debug_ranges,"",@progbits
-+.Ldebug_ranges0:
-+ .quad .Ltext0 # Offset 0
-+ .quad .Letext0
-+ .quad .LFB1 # Offset 0x10
-+ .quad .LFE1
-+ .quad 0
-+ .quad 0
-+ .section .debug_line,"",@progbits
-+.Ldebug_line0:
-+ .section .debug_str,"MS",@progbits,1
-+.LASF1:
-+ .string "gdb.arch/amd64-entry-value-paramref.cc"
-+.LASF2:
-+ .string ""
-+.LASF0:
-+ .string "GNU C++ 4.8.2 20131212 (Red Hat 4.8.2-7) -mtune=generic -march=x86-64 -g -O2"
-+.LASF3:
-+ .string "main"
-+ .ident "GCC: (GNU) 4.8.2 20131212 (Red Hat 4.8.2-7)"
-+ .section .note.GNU-stack,"",@progbits
-diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.cc b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.cc
-new file mode 100644
-index 0000000..aa473a3
---- /dev/null
-+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.cc
-@@ -0,0 +1,33 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2014 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+volatile int vv, *p;
-+
-+static __attribute__((noinline)) int
-+bar (int &ref)
-+{
-+ vv++; /* break-here */
-+ p = &ref;
-+ return ref;
-+}
-+
-+int
-+main (void)
-+{
-+ int var = 10;
-+ return bar (var);
-+}
-diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp
-new file mode 100644
-index 0000000..f06247d
---- /dev/null
-+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp
-@@ -0,0 +1,35 @@
-+# Copyright (C) 2014 Free Software Foundation, Inc.
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile .S .cc
-+
-+if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
-+ verbose "Skipping amd64-entry-value-paramref."
-+ return
-+}
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} "c++"] } {
-+ return -1
-+}
-+
-+if ![runto_main] {
-+ return -1
-+}
-+
-+set srcfile $srcfile2
-+gdb_breakpoint [gdb_get_line_number "break-here"]
-+
-+gdb_continue_to_breakpoint "break-here" ".* break-here .*"
-+gdb_test "frame" {bar \(ref=@0x[0-9a-f]+: 10, ref@entry=@0x[0-9a-f]+: <optimized out>\) at .*}
-diff --git a/gdb/testsuite/gdb.arch/amd64-optimout-repeat.S b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.S
-new file mode 100644
-index 0000000..2f8f4d2
---- /dev/null
-+++ b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.S
-@@ -0,0 +1,297 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2012-2014 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+/* This file is compiled from gdb.arch/amd64-entry-value-param.c
-+ using -g -dA -S -O2. */
-+
-+ .file "amd64-optimout-repeat.c"
-+ .text
-+.Ltext0:
-+ .section .text.unlikely,"ax",@progbits
-+.LCOLDB0:
-+ .section .text.startup,"ax",@progbits
-+.LHOTB0:
-+ .p2align 4,,15
-+ .section .text.unlikely
-+.Ltext_cold0:
-+ .section .text.startup
-+ .globl main
-+ .type main, @function
-+main:
-+.LFB0:
-+ .file 1 "gdb.arch/amd64-optimout-repeat.c"
-+ # gdb.arch/amd64-optimout-repeat.c:20
-+ .loc 1 20 0
-+ .cfi_startproc
-+# BLOCK 2 freq:10000 seq:0
-+# PRED: ENTRY [100.0%] (FALLTHRU)
-+.LVL0:
-+ # gdb.arch/amd64-optimout-repeat.c:29
-+ .loc 1 29 0
-+ xorl %eax, %eax
-+# SUCC: EXIT [100.0%]
-+ ret
-+ .cfi_endproc
-+.LFE0:
-+ .size main, .-main
-+ .section .text.unlikely
-+.LCOLDE0:
-+ .section .text.startup
-+.LHOTE0:
-+ .text
-+.Letext0:
-+ .section .text.unlikely
-+.Letext_cold0:
-+ .section .debug_info,"",@progbits
-+.Ldebug_info0:
-+ .long 0x97 # Length of Compilation Unit Info
-+ .value 0x4 # DWARF version number
-+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section
-+ .byte 0x8 # Pointer Size (in bytes)
-+ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
-+ .long .LASF1 # DW_AT_producer: "GNU C 4.9.1 20140709 (prerelease) -mtune=generic -march=x86-64 -g -O2"
-+ .byte 0x1 # DW_AT_language
-+ .long .LASF2 # DW_AT_name: "gdb.arch/amd64-optimout-repeat.c"
-+ .long .LASF3 # DW_AT_comp_dir: ""
-+ .long .Ldebug_ranges0+0 # DW_AT_ranges
-+ .quad 0 # DW_AT_low_pc
-+ .long .Ldebug_line0 # DW_AT_stmt_list
-+ .uleb128 0x2 # (DIE (0x29) DW_TAG_subprogram)
-+ # DW_AT_external
-+ .long .LASF4 # DW_AT_name: "main"
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-optimout-repeat.c)
-+ .byte 0x13 # DW_AT_decl_line
-+ # DW_AT_prototyped
-+ .long 0x7c # DW_AT_type
-+ .quad .LFB0 # DW_AT_low_pc
-+ .quad .LFE0-.LFB0 # DW_AT_high_pc
-+ .uleb128 0x1 # DW_AT_frame_base
-+ .byte 0x9c # DW_OP_call_frame_cfa
-+ # DW_AT_GNU_all_call_sites
-+ .long 0x7c # DW_AT_sibling
-+ .uleb128 0x3 # (DIE (0x4a) DW_TAG_structure_type)
-+ .value 0x404 # DW_AT_byte_size
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-optimout-repeat.c)
-+ .byte 0x15 # DW_AT_decl_line
-+ .long 0x6a # DW_AT_sibling
-+ .uleb128 0x4 # (DIE (0x53) DW_TAG_member)
-+ .ascii "i\0" # DW_AT_name
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-optimout-repeat.c)
-+ .byte 0x17 # DW_AT_decl_line
-+ .long 0x7c # DW_AT_type
-+ .byte 0 # DW_AT_data_member_location
-+ .uleb128 0x4 # (DIE (0x5d) DW_TAG_member)
-+ .ascii "xxx\0" # DW_AT_name
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-optimout-repeat.c)
-+ .byte 0x18 # DW_AT_decl_line
-+ .long 0x83 # DW_AT_type
-+ .byte 0x4 # DW_AT_data_member_location
-+ .byte 0 # end of children of DIE 0x4a
-+ .uleb128 0x5 # (DIE (0x6a) DW_TAG_variable)
-+ .ascii "v\0" # DW_AT_name
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-optimout-repeat.c)
-+ .byte 0x1a # DW_AT_decl_line
-+ .long 0x4a # DW_AT_type
-+ .uleb128 0x7 # DW_AT_location
-+ .byte 0x30 # DW_OP_lit0
-+ .byte 0x9f # DW_OP_stack_value
-+ .byte 0x93 # DW_OP_piece
-+ .uleb128 0x4
-+ .byte 0x93 # DW_OP_piece
-+ .uleb128 0x400
-+ .byte 0 # end of children of DIE 0x29
-+ .uleb128 0x6 # (DIE (0x7c) DW_TAG_base_type)
-+ .byte 0x4 # DW_AT_byte_size
-+ .byte 0x5 # DW_AT_encoding
-+ .ascii "int\0" # DW_AT_name
-+ .uleb128 0x7 # (DIE (0x83) DW_TAG_array_type)
-+ .long 0x7c # DW_AT_type
-+ .long 0x93 # DW_AT_sibling
-+ .uleb128 0x8 # (DIE (0x8c) DW_TAG_subrange_type)
-+ .long 0x93 # DW_AT_type
-+ .byte 0xff # DW_AT_upper_bound
-+ .byte 0 # end of children of DIE 0x83
-+ .uleb128 0x9 # (DIE (0x93) DW_TAG_base_type)
-+ .byte 0x8 # DW_AT_byte_size
-+ .byte 0x7 # DW_AT_encoding
-+ .long .LASF0 # DW_AT_name: "sizetype"
-+ .byte 0 # end of children of DIE 0xb
-+ .section .debug_abbrev,"",@progbits
-+.Ldebug_abbrev0:
-+ .uleb128 0x1 # (abbrev code)
-+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x25 # (DW_AT_producer)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x13 # (DW_AT_language)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x1b # (DW_AT_comp_dir)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x55 # (DW_AT_ranges)
-+ .uleb128 0x17 # (DW_FORM_sec_offset)
-+ .uleb128 0x11 # (DW_AT_low_pc)
-+ .uleb128 0x1 # (DW_FORM_addr)
-+ .uleb128 0x10 # (DW_AT_stmt_list)
-+ .uleb128 0x17 # (DW_FORM_sec_offset)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x2 # (abbrev code)
-+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x3f # (DW_AT_external)
-+ .uleb128 0x19 # (DW_FORM_flag_present)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x27 # (DW_AT_prototyped)
-+ .uleb128 0x19 # (DW_FORM_flag_present)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x11 # (DW_AT_low_pc)
-+ .uleb128 0x1 # (DW_FORM_addr)
-+ .uleb128 0x12 # (DW_AT_high_pc)
-+ .uleb128 0x7 # (DW_FORM_data8)
-+ .uleb128 0x40 # (DW_AT_frame_base)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
-+ .uleb128 0x19 # (DW_FORM_flag_present)
-+ .uleb128 0x1 # (DW_AT_sibling)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x3 # (abbrev code)
-+ .uleb128 0x13 # (TAG: DW_TAG_structure_type)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0xb # (DW_AT_byte_size)
-+ .uleb128 0x5 # (DW_FORM_data2)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x1 # (DW_AT_sibling)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x4 # (abbrev code)
-+ .uleb128 0xd # (TAG: DW_TAG_member)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x38 # (DW_AT_data_member_location)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x5 # (abbrev code)
-+ .uleb128 0x34 # (TAG: DW_TAG_variable)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x2 # (DW_AT_location)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x6 # (abbrev code)
-+ .uleb128 0x24 # (TAG: DW_TAG_base_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0xb # (DW_AT_byte_size)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3e # (DW_AT_encoding)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x7 # (abbrev code)
-+ .uleb128 0x1 # (TAG: DW_TAG_array_type)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x1 # (DW_AT_sibling)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x8 # (abbrev code)
-+ .uleb128 0x21 # (TAG: DW_TAG_subrange_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x2f # (DW_AT_upper_bound)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x9 # (abbrev code)
-+ .uleb128 0x24 # (TAG: DW_TAG_base_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0xb # (DW_AT_byte_size)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3e # (DW_AT_encoding)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .byte 0
-+ .byte 0
-+ .byte 0
-+ .section .debug_aranges,"",@progbits
-+ .long 0x2c # Length of Address Ranges Info
-+ .value 0x2 # DWARF Version
-+ .long .Ldebug_info0 # Offset of Compilation Unit Info
-+ .byte 0x8 # Size of Address
-+ .byte 0 # Size of Segment Descriptor
-+ .value 0 # Pad to 16 byte boundary
-+ .value 0
-+ .quad .LFB0 # Address
-+ .quad .LFE0-.LFB0 # Length
-+ .quad 0
-+ .quad 0
-+ .section .debug_ranges,"",@progbits
-+.Ldebug_ranges0:
-+ .quad .LFB0 # Offset 0
-+ .quad .LFE0
-+ .quad 0
-+ .quad 0
-+ .section .debug_line,"",@progbits
-+.Ldebug_line0:
-+ .section .debug_str,"MS",@progbits,1
-+.LASF0:
-+ .string "sizetype"
-+.LASF2:
-+ .string "gdb.arch/amd64-optimout-repeat.c"
-+.LASF1:
-+ .string "GNU C 4.9.1 20140709 (prerelease) -mtune=generic -march=x86-64 -g -O2"
-+.LASF3:
-+ .string ""
-+.LASF4:
-+ .string "main"
-+ .ident "GCC: (GNU) 4.9.1 20140709 (prerelease)"
-+ .section .note.GNU-stack,"",@progbits
-diff --git a/gdb/testsuite/gdb.arch/amd64-optimout-repeat.c b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.c
-new file mode 100644
-index 0000000..a32b6de
---- /dev/null
-+++ b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.c
-@@ -0,0 +1,29 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2014 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+int
-+main (void)
-+{
-+ struct
-+ {
-+ int i;
-+ int xxx[0x100];
-+ }
-+ v = { 0 };
-+
-+ return v.i;
-+}
-diff --git a/gdb/testsuite/gdb.arch/amd64-optimout-repeat.exp b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.exp
-new file mode 100644
-index 0000000..f3c93a4
---- /dev/null
-+++ b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.exp
-@@ -0,0 +1,36 @@
-+# Copyright (C) 2014 Free Software Foundation, Inc.
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile .S .c
-+set opts {}
-+
-+if [info exists COMPILE] {
-+ # make check RUNTESTFLAGS="gdb.arch/amd64-optimout-repeat.exp COMPILE=1"
-+ set srcfile ${srcfile2}
-+ lappend opts debug optimize=-O2
-+} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
-+ verbose "Skipping amd64-optimout-repeat."
-+ return
-+}
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $opts] } {
-+ return -1
-+}
-+
-+if ![runto_main] {
-+ return -1
-+}
-+
-+gdb_test "print v" { = {i = 0, xxx = {<optimized out> <repeats 256 times>}}}
-
---Dxnq1zWXvFF0Q93v--
-
diff --git a/gdb-entryval-crash-1of3.patch b/gdb-entryval-crash-1of3.patch
new file mode 100644
index 0000000..58fd34c
--- /dev/null
+++ b/gdb-entryval-crash-1of3.patch
@@ -0,0 +1,194 @@
+http://sourceware.org/ml/gdb-patches/2014-07/msg00530.html
+Subject: [read_frame_arg patch] Handle partially optimized out values similarly to unavailable values (Re: [patchv2] Fix crash on optimized-out entry data values)
+
+
+--V88s5gaDVPzZ0KCq
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+
+On Thu, 17 Jul 2014 14:23:06 +0200, Pedro Alves wrote:
+> On 07/16/2014 10:58 PM, Jan Kratochvil wrote:
+> > This patch is apparently not suitable for gdb-7.8 which is I guess often
+> > crashing on -O2 -g entry values so there could be some rather minimal crash
+> > avoiding patch instead.
+>
+> Yeah.
+>
+> So this was originally "caused" (more exposed) by 4f14910f:
+>
+> gdb/ChangeLog
+> 2013-11-26 Andrew Burgess <aburgess@broadcom.com>
+>
+> * value.c (allocate_optimized_out_value): Mark value as non-lazy.
+>
+> I tried a few approaches in value_available_contents_eq
+> today, and ended up thinking that the simplest should be to
+> just revert that patch until we have the fuller fix in place.
+
+OK, that seems as the best solution for 7.8 to me.
+
+
+> While doing just that fixes the crash, it surprisingly causes
+> one of your new tests to FAIL:
+>
+> (gdb) frame
+> #0 bar (ref=ref@entry=@0x7fffffffd184: 10) at gdb.arch/amd64-entry-value-paramref.cc:23
+> 23 vv++; /* break-here */
+> (gdb) FAIL: gdb.arch/amd64-entry-value-paramref.exp: frame
+
+There is a bug in that entry value code of mine, fix attached.
+The testcase then PASSes with the reverted optimization by Andrew Burgess.
+
+For the attached fix - if you nitpick the missing conditional case:
+ value_optimized_out (val_deref) && value_optimized_out (entryval_deref)
+It is not detected there but that IMO does not matter much as
+ * It is for 7.8 only, for trunk it will get compared correctly thanks to the
+ new implementation of value_available_contents_eq()
+ called value_contents_eq().
+ * If the conditional
+ if (val != val_deref
+ && !value_optimized_out (val_deref)
+ && !value_optimized_out (entryval_deref)
+ && value_available_contents_eq (val_deref, 0,
+ entryval_deref, 0,
+ TYPE_LENGTH (type_deref)))
+ val_equal = 1;
+ fails it may just print
+ bar (ref=@0x7fffffffd904: <optimized out>, ref@entry=@0x7fffffffd904: <optimized out>)
+ (or some variant with some partially optimized-out/unavailable parts)
+ instead of the more correct
+ bar (ref=ref@entry=@0x7fffffffd904: <optimized out>)
+ which is not much a bug.
+
+The attached fix no longe makes sense after the new implementation
+of value_available_contents_eq() called value_contents_eq() gets applied as it
+handles all the optimized-out/unavailable values on its own, therefore the
+attached patch is really only for 7.8.
+
+
+> Turns out it's the code disabled in value_of_dwarf_reg_entry:
+>
+> target_val = dwarf_entry_parameter_to_value (parameter,
+> TYPE_LENGTH (target_type),
+> target_type, caller_frame,
+> caller_per_cu);
+>
+> /* value_as_address dereferences TYPE_CODE_REF. */
+> addr = extract_typed_address (value_contents (outer_val), checked_type);
+>
+> /* The target entry value has artificial address of the entry value
+> reference. */
+> VALUE_LVAL (target_val) = lval_memory;
+> set_value_address (target_val, addr);
+>
+> It looks quite wrong to me to just change a value's lval like that.
+>
+> I ran the testsuite with that code disabled (like in the patch below),
+> and that caused no regressions. I can't say I really understand the
+> intention here though. What would we be missing if we removed that code?
+
+I cannot reproduce any wrong case having the code above #if 0-ed.
+
+I just do not find it correct to have it disabled. But at the same time I do
+like much / I do not find correct the code myself. It is a bit problematic to
+have struct value describing a memory content which is no longer present
+there.
+
+What happens there:
+------------------------------------------------------------------------------
+volatile int vv;
+static __attribute__((noinline)) int
+bar (int &ref) {
+ ref = 20;
+ vv++; /* break-here */
+ return ref;
+}
+int main (void) {
+ int var = 10;
+ return bar (var);
+}
+------------------------------------------------------------------------------
+ <4><c7>: Abbrev Number: 13 (DW_TAG_GNU_call_site_parameter)
+ <c8> DW_AT_location : 1 byte block: 55 (DW_OP_reg5 (rdi))
+ <ca> DW_AT_GNU_call_site_value: 2 byte block: 91 74 (DW_OP_fbreg: -12)
+ <cd> DW_AT_GNU_call_site_data_value: 1 byte block: 3a (DW_OP_lit10)
+------------------------------------------------------------------------------
+gdb -ex 'b value_addr' -ex r --args ../gdb ./1 -ex 'watch vv' -ex r -ex 'p &ref@entry'
+->
+6 return ref;
+bar (ref=@0x7fffffffd944: 20, ref@entry=@0x7fffffffd944: 10) at 1.C:25
+------------------------------------------------------------------------------
+At /* break-here */ struct value variable 'ref' is TYPE_CODE_REF.
+
+With FSF GDB HEAD:
+(gdb) x/gx arg1.contents
+0x6004000a4ad0: 0x00007fffffffd944
+(gdb) p ((struct value *)arg1.location.computed.closure).lval
+$1 = lval_memory
+(gdb) p/x ((struct value *)arg1.location.computed.closure).location.address
+$3 = 0x7fffffffd944
+
+With your #if0-ed code:
+(gdb) x/gx arg1.contents
+0x6004000a4ad0: 0x00007fffffffd944
+(gdb) p ((struct value *)arg1.location.computed.closure).lval
+$8 = not_lval
+(gdb) p/x ((struct value *)arg1.location.computed.closure).location.address
+$9 = 0x0
+
+I do not see how to access
+ ((struct value *)arg1.location.computed.closure).location.address
+from GDB CLI. Trying
+(gdb) p &ref@entry
+will invoke value_addr()'s:
+ if (TYPE_CODE (type) == TYPE_CODE_REF)
+ /* Copy the value, but change the type from (T&) to (T*). We
+ keep the same location information, which is efficient, and
+ allows &(&X) to get the location containing the reference. */
+and therefore the address gets fetched already from
+ arg1.contents
+and not from
+ ((struct value *)arg1.location.computed.closure).location.address
+.
+
+And for any other type than TYPE_CODE_REF this code you #if 0-ed does not get
+executed at all. This DW_AT_GNU_call_site_data_value DWARF was meant
+primarily for Fortran but with -O0 entry values do not get produced
+and with -Og and higher Fortran always optimizes out the passing by reference.
+
+If you do not like the #if 0 code there I am OK with removing it as I do not
+know how to make it's use reproducible for user anyway. In the worst case
+- if there really is some way how to exploit it - one should just get
+ Attempt to take address of value not located in memory.
+instead of some wrong value and it may be easy to fix then.
+
+
+Thanks for the analysis,
+Jan
+
+--V88s5gaDVPzZ0KCq
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline; filename=1
+
+gdb/
+2014-07-20 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * stack.c (read_frame_arg): Verify value_optimized_out before calling
+ value_available_contents_eq.
+
+diff --git a/gdb/stack.c b/gdb/stack.c
+index 0d6d8e7..4db5df5 100644
+--- a/gdb/stack.c
++++ b/gdb/stack.c
+@@ -413,6 +413,8 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame,
+ /* If the reference addresses match but dereferenced
+ content does not match print them. */
+ if (val != val_deref
++ && !value_optimized_out (val_deref)
++ && !value_optimized_out (entryval_deref)
+ && value_available_contents_eq (val_deref, 0,
+ entryval_deref, 0,
+ TYPE_LENGTH (type_deref)))
+
+--V88s5gaDVPzZ0KCq--
+
diff --git a/gdb-entryval-crash-2of3.patch b/gdb-entryval-crash-2of3.patch
new file mode 100644
index 0000000..a3cfe22
--- /dev/null
+++ b/gdb-entryval-crash-2of3.patch
@@ -0,0 +1,44 @@
+revert:
+commit 4f14910fa1331398cc695011a6af43a89252b4b1
+Author: Andrew Burgess <aburgess@broadcom.com>
+Date: Tue Nov 26 16:21:53 2013 +0000
+
+ Mark entirely optimized out value as non-lazy.
+
+ If a value is entirely optimized out, then there's nothing for
+ value_fetch_lazy to fetch. Sequences like:
+
+ if (value_lazy (retval))
+ value_fetch_lazy (retval);
+
+ End up allocating the value contents buffer, wasting memory, for no
+ use.
+
+ gdb/ChangeLog
+ 2013-11-26 Andrew Burgess <aburgess@broadcom.com>
+
+ * value.c (allocate_optimized_out_value): Mark value as non-lazy.
+
+### a/gdb/ChangeLog
+### b/gdb/ChangeLog
+## -1,3 +1,7 @@
++2013-11-26 Andrew Burgess <aburgess@broadcom.com>
++
++ * value.c (allocate_optimized_out_value): Mark value as non-lazy.
++
+ 2013-11-26 Tom Tromey <tromey@redhat.com>
+
+ * dwarf2-frame.c (dwarf2_frame_cache): Revert patch from
+diff --git a/gdb/value.c b/gdb/value.c
+index 29abe5f..f073d71 100644
+--- a/gdb/value.c
++++ b/gdb/value.c
+@@ -906,7 +906,7 @@ allocate_optimized_out_value (struct type *type)
+ struct value *retval = allocate_value_lazy (type);
+
+ set_value_optimized_out (retval, 1);
+- set_value_lazy (retval, 0);
++
+ return retval;
+ }
+
diff --git a/gdb-entryval-crash-3of3.patch b/gdb-entryval-crash-3of3.patch
new file mode 100644
index 0000000..a8ea099
--- /dev/null
+++ b/gdb-entryval-crash-3of3.patch
@@ -0,0 +1,1011 @@
+http://sourceware.org/ml/gdb-patches/2014-07/msg00277.html
+Subject: [patchv3] Fix crash on optimized-out entry data values
+
+
+--Dxnq1zWXvFF0Q93v
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+
+On Wed, 09 Jul 2014 17:31:21 +0200, Jan Kratochvil wrote:
+> On Wed, 09 Jul 2014 13:52:00 +0200, Pedro Alves wrote:
+> > On 07/09/2014 11:33 AM, Jan Kratochvil wrote:
+> > > --- a/gdb/value.c
+> > > +++ b/gdb/value.c
+> > > @@ -198,12 +198,13 @@ struct value
+> > > unsigned int lazy : 1;
+> > >
+> > > /* If nonzero, this is the value of a variable that does not
+> > > - actually exist in the program. If nonzero, and LVAL is
+> > > + actually fully exist in the program. If nonzero, and LVAL is
+> > > lval_register, this is a register ($pc, $sp, etc., never a
+> > > program variable) that has not been saved in the frame. All
+> > > optimized-out values are treated pretty much the same, except
+> > > registers have a different string representation and related
+> > > - error strings. */
+> > > + error strings. It is true also for only partially optimized
+> > > + out variables - see the 'unavailable' field below. */
+> > > unsigned int optimized_out : 1;
+> > >
+> > > /* If value is a variable, is it initialized or not. */
+> > > @@ -334,7 +335,10 @@ struct value
+> > > valid if lazy is nonzero. */
+> > > gdb_byte *contents;
+> > >
+> > > - /* Unavailable ranges in CONTENTS. We mark unavailable ranges,
+> > > + /* If OPTIMIZED_OUT is false then UNAVAILABLE must be VEC_empty
+> > > + (not necessarily NULL).
+> >
+> > Hmm, why? We can collect only part of a non-optimized out value.
+> > What am I missing?
+>
+> I miss some documentation how these availability fields interact together.
+
+>From a comment in mail
+ Message-Id: <201102071427.55970.pedro@codesourcery.com>
+ We give preference to printing <optimized out> rather
+ than <unavailable>, since if a value had been optimized out
+ at compile time, it can never be collected at run-time.
+
+it seems it is just reversed, that 'unavailable' can exist only for
+!optimized_out and it cannot exist for for optimized_out values.
+
+
+> You are right, this patch regresses during gdbserver mode.
+
+It PASSes now even in gdbserver mode.
+
+
+Thanks,
+Jan
+
+--Dxnq1zWXvFF0Q93v
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline; filename="optimfix3.patch"
+
+gdb/
+2014-07-09 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+removed:
+ * value.c (struct value): Extend the comment for fields optimized_out
+ and unavailable.
+ (value_available_contents_bits_eq): Handle OPTIMIZED_OUT values as
+ special cases.
+
+gdb/testsuite/
+2014-07-09 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.arch/amd64-entry-value-paramref.S: New file.
+ * gdb.arch/amd64-entry-value-paramref.cc: New file.
+ * gdb.arch/amd64-entry-value-paramref.exp: New file.
+ * gdb.arch/amd64-optimout-repeat.S: New file.
+ * gdb.arch/amd64-optimout-repeat.c: New file.
+ * gdb.arch/amd64-optimout-repeat.exp: New file.
+
+diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.S b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.S
+new file mode 100644
+index 0000000..a1e9d0a
+--- /dev/null
++++ b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.S
+@@ -0,0 +1,459 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++ Copyright 2014 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++/* This file is compiled from gdb.arch/amd64-entry-value-paramref.cc
++ using -g -dA -S -O2.
++ Additionally it has been patched. */
++
++ .file "amd64-entry-value-paramref.cc"
++ .text
++.Ltext0:
++ .p2align 4,,15
++ .type _ZL3barRi.constprop.0, @function
++_ZL3barRi.constprop.0:
++.LFB2:
++ .file 1 "gdb.arch/amd64-entry-value-paramref.cc"
++ # gdb.arch/amd64-entry-value-paramref.cc:21
++ .loc 1 21 0
++ .cfi_startproc
++.LVL0:
++# BLOCK 2 freq:10000 seq:0
++# PRED: ENTRY [100.0%] (FALLTHRU)
++ # gdb.arch/amd64-entry-value-paramref.cc:23
++ .loc 1 23 0
++ movl vv(%rip), %eax
++ # gdb.arch/amd64-entry-value-paramref.cc:24
++ .loc 1 24 0
++ movq %rdi, p(%rip)
++ # gdb.arch/amd64-entry-value-paramref.cc:23
++ .loc 1 23 0
++ addl $1, %eax
++ movl %eax, vv(%rip)
++ # gdb.arch/amd64-entry-value-paramref.cc:25
++ .loc 1 25 0
++ movl (%rdi), %eax
++# SUCC: EXIT [100.0%]
++ # gdb.arch/amd64-entry-value-paramref.cc:26
++ .loc 1 26 0
++ ret
++ .cfi_endproc
++.LFE2:
++ .size _ZL3barRi.constprop.0, .-_ZL3barRi.constprop.0
++ .section .text.startup,"ax",@progbits
++ .p2align 4,,15
++ .globl main
++ .type main, @function
++main:
++.LFB1:
++ # gdb.arch/amd64-entry-value-paramref.cc:30
++ .loc 1 30 0
++ .cfi_startproc
++# BLOCK 2 freq:10000 seq:0
++# PRED: ENTRY [100.0%] (FALLTHRU)
++ subq $16, %rsp
++ .cfi_def_cfa_offset 24
++.LBB2:
++ # gdb.arch/amd64-entry-value-paramref.cc:32
++ .loc 1 32 0
++ leaq 12(%rsp), %rdi
++ # gdb.arch/amd64-entry-value-paramref.cc:31
++ .loc 1 31 0
++ movl $10, 12(%rsp)
++ # gdb.arch/amd64-entry-value-paramref.cc:32
++ .loc 1 32 0
++ call _ZL3barRi.constprop.0
++.LVL1:
++.LBE2:
++ # gdb.arch/amd64-entry-value-paramref.cc:33
++ .loc 1 33 0
++ addq $16, %rsp
++ .cfi_def_cfa_offset 8
++# SUCC: EXIT [100.0%]
++ ret
++ .cfi_endproc
++.LFE1:
++ .size main, .-main
++ .globl p
++ .bss
++ .align 8
++ .type p, @object
++ .size p, 8
++p:
++ .zero 8
++ .globl vv
++ .align 4
++ .type vv, @object
++ .size vv, 4
++vv:
++ .zero 4
++ .text
++.Letext0:
++ .section .debug_info,"",@progbits
++.Ldebug_info0:
++ .long .Linfo_end - .Linfo_start # Length of Compilation Unit Info
++.Linfo_start:
++ .value 0x4 # DWARF version number
++ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section
++ .byte 0x8 # Pointer Size (in bytes)
++ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
++ .long .LASF0 # DW_AT_producer: "GNU C++ 4.8.2 20131212 (Red Hat 4.8.2-7) -mtune=generic -march=x86-64 -g -O2"
++ .byte 0x4 # DW_AT_language
++ .long .LASF1 # DW_AT_name: "gdb.arch/amd64-entry-value-paramref.cc"
++ .long .LASF2 # DW_AT_comp_dir: ""
++ .long .Ldebug_ranges0+0 # DW_AT_ranges
++ .quad 0 # DW_AT_low_pc
++ .long .Ldebug_line0 # DW_AT_stmt_list
++DIE29: .uleb128 0x2 # (DIE (0x29) DW_TAG_subprogram)
++ .ascii "bar\0" # DW_AT_name
++ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-paramref.cc)
++ .byte 0x15 # DW_AT_decl_line
++ .long DIE45 # DW_AT_type
++ .byte 0x1 # DW_AT_inline
++DIE39: .uleb128 0x3 # (DIE (0x39) DW_TAG_formal_parameter)
++ .ascii "ref\0" # DW_AT_name
++ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-paramref.cc)
++ .byte 0x15 # DW_AT_decl_line
++ .long DIE4c # DW_AT_type
++ .byte 0 # end of children of DIE 0x29
++DIE45: .uleb128 0x4 # (DIE (0x45) DW_TAG_base_type)
++ .byte 0x4 # DW_AT_byte_size
++ .byte 0x5 # DW_AT_encoding
++ .ascii "int\0" # DW_AT_name
++DIE4c: .uleb128 0x5 # (DIE (0x4c) DW_TAG_const_type)
++ .long DIE51 # DW_AT_type
++DIE51: .uleb128 0x6 # (DIE (0x51) DW_TAG_reference_type)
++ .byte 0x8 # DW_AT_byte_size
++ .long DIE45 # DW_AT_type
++DIE57: .uleb128 0x7 # (DIE (0x57) DW_TAG_subprogram)
++ .long DIE29 # DW_AT_abstract_origin
++ .quad .LFB2 # DW_AT_low_pc
++ .quad .LFE2-.LFB2 # DW_AT_high_pc
++ .uleb128 0x1 # DW_AT_frame_base
++ .byte 0x9c # DW_OP_call_frame_cfa
++ # DW_AT_GNU_all_call_sites
++DIE72: .uleb128 0x8 # (DIE (0x72) DW_TAG_formal_parameter)
++ .long DIE39 # DW_AT_abstract_origin
++ .uleb128 0x1 # DW_AT_location
++ .byte 0x55 # DW_OP_reg5
++ .byte 0 # end of children of DIE 0x57
++DIE7a: .uleb128 0x9 # (DIE (0x7a) DW_TAG_subprogram)
++ # DW_AT_external
++ .long .LASF3 # DW_AT_name: "main"
++ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-paramref.cc)
++ .byte 0x1d # DW_AT_decl_line
++ .long DIE45 # DW_AT_type
++ .quad .LFB1 # DW_AT_low_pc
++ .quad .LFE1-.LFB1 # DW_AT_high_pc
++ .uleb128 0x1 # DW_AT_frame_base
++ .byte 0x9c # DW_OP_call_frame_cfa
++ # DW_AT_GNU_all_call_sites
++DIE9b: .uleb128 0xa # (DIE (0x9b) DW_TAG_lexical_block)
++ .quad .LBB2 # DW_AT_low_pc
++ .quad .LBE2-.LBB2 # DW_AT_high_pc
++DIEac: .uleb128 0xb # (DIE (0xac) DW_TAG_variable)
++ .ascii "var\0" # DW_AT_name
++ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-paramref.cc)
++ .byte 0x1f # DW_AT_decl_line
++ .long DIE45 # DW_AT_type
++ .uleb128 0x2 # DW_AT_location
++ .byte 0x91 # DW_OP_fbreg
++ .sleb128 -12
++DIEba: .uleb128 0xc # (DIE (0xba) DW_TAG_GNU_call_site)
++ .quad .LVL1 # DW_AT_low_pc
++ .long DIE57 # DW_AT_abstract_origin
++DIEc7: .uleb128 0xd # (DIE (0xc7) DW_TAG_GNU_call_site_parameter)
++ .uleb128 0x1 # DW_AT_location
++ .byte 0x55 # DW_OP_reg5
++ .uleb128 0x2 # DW_AT_GNU_call_site_value
++ .byte 0x91 # DW_OP_fbreg
++ .sleb128 -12
++#if 0
++ .uleb128 0x1 # DW_AT_GNU_call_site_data_value
++ .byte 0x3a # DW_OP_lit10
++#else
++ .uleb128 1f - 2f # DW_AT_GNU_call_site_data_value
++2:
++ .byte 0xf3 # DW_OP_GNU_entry_value
++ .uleb128 1f - 3f
++3:
++ .byte 0x55 # DW_OP_reg5
++1:
++#endif
++ .byte 0 # end of children of DIE 0xba
++ .byte 0 # end of children of DIE 0x9b
++ .byte 0 # end of children of DIE 0x7a
++DIEd2: .uleb128 0xe # (DIE (0xd2) DW_TAG_variable)
++ .ascii "vv\0" # DW_AT_name
++ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-paramref.cc)
++ .byte 0x12 # DW_AT_decl_line
++ .long DIEe6 # DW_AT_type
++ # DW_AT_external
++ .uleb128 0x9 # DW_AT_location
++ .byte 0x3 # DW_OP_addr
++ .quad vv
++DIEe6: .uleb128 0xf # (DIE (0xe6) DW_TAG_volatile_type)
++ .long DIE45 # DW_AT_type
++DIEeb: .uleb128 0xe # (DIE (0xeb) DW_TAG_variable)
++ .ascii "p\0" # DW_AT_name
++ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-paramref.cc)
++ .byte 0x12 # DW_AT_decl_line
++ .long DIEfe # DW_AT_type
++ # DW_AT_external
++ .uleb128 0x9 # DW_AT_location
++ .byte 0x3 # DW_OP_addr
++ .quad p
++DIEfe: .uleb128 0x10 # (DIE (0xfe) DW_TAG_pointer_type)
++ .byte 0x8 # DW_AT_byte_size
++ .long DIEe6 # DW_AT_type
++ .byte 0 # end of children of DIE 0xb
++.Linfo_end:
++ .section .debug_abbrev,"",@progbits
++.Ldebug_abbrev0:
++ .uleb128 0x1 # (abbrev code)
++ .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
++ .byte 0x1 # DW_children_yes
++ .uleb128 0x25 # (DW_AT_producer)
++ .uleb128 0xe # (DW_FORM_strp)
++ .uleb128 0x13 # (DW_AT_language)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3 # (DW_AT_name)
++ .uleb128 0xe # (DW_FORM_strp)
++ .uleb128 0x1b # (DW_AT_comp_dir)
++ .uleb128 0xe # (DW_FORM_strp)
++ .uleb128 0x55 # (DW_AT_ranges)
++ .uleb128 0x17 # (DW_FORM_sec_offset)
++ .uleb128 0x11 # (DW_AT_low_pc)
++ .uleb128 0x1 # (DW_FORM_addr)
++ .uleb128 0x10 # (DW_AT_stmt_list)
++ .uleb128 0x17 # (DW_FORM_sec_offset)
++ .byte 0
++ .byte 0
++ .uleb128 0x2 # (abbrev code)
++ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
++ .byte 0x1 # DW_children_yes
++ .uleb128 0x3 # (DW_AT_name)
++ .uleb128 0x8 # (DW_FORM_string)
++ .uleb128 0x3a # (DW_AT_decl_file)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3b # (DW_AT_decl_line)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .uleb128 0x20 # (DW_AT_inline)
++ .uleb128 0xb # (DW_FORM_data1)
++ .byte 0
++ .byte 0
++ .uleb128 0x3 # (abbrev code)
++ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
++ .byte 0 # DW_children_no
++ .uleb128 0x3 # (DW_AT_name)
++ .uleb128 0x8 # (DW_FORM_string)
++ .uleb128 0x3a # (DW_AT_decl_file)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3b # (DW_AT_decl_line)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .byte 0
++ .byte 0
++ .uleb128 0x4 # (abbrev code)
++ .uleb128 0x24 # (TAG: DW_TAG_base_type)
++ .byte 0 # DW_children_no
++ .uleb128 0xb # (DW_AT_byte_size)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3e # (DW_AT_encoding)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3 # (DW_AT_name)
++ .uleb128 0x8 # (DW_FORM_string)
++ .byte 0
++ .byte 0
++ .uleb128 0x5 # (abbrev code)
++ .uleb128 0x26 # (TAG: DW_TAG_const_type)
++ .byte 0 # DW_children_no
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .byte 0
++ .byte 0
++ .uleb128 0x6 # (abbrev code)
++ .uleb128 0x10 # (TAG: DW_TAG_reference_type)
++ .byte 0 # DW_children_no
++ .uleb128 0xb # (DW_AT_byte_size)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .byte 0
++ .byte 0
++ .uleb128 0x7 # (abbrev code)
++ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
++ .byte 0x1 # DW_children_yes
++ .uleb128 0x31 # (DW_AT_abstract_origin)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .uleb128 0x11 # (DW_AT_low_pc)
++ .uleb128 0x1 # (DW_FORM_addr)
++ .uleb128 0x12 # (DW_AT_high_pc)
++ .uleb128 0x7 # (DW_FORM_data8)
++ .uleb128 0x40 # (DW_AT_frame_base)
++ .uleb128 0x18 # (DW_FORM_exprloc)
++ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
++ .uleb128 0x19 # (DW_FORM_flag_present)
++ .byte 0
++ .byte 0
++ .uleb128 0x8 # (abbrev code)
++ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
++ .byte 0 # DW_children_no
++ .uleb128 0x31 # (DW_AT_abstract_origin)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .uleb128 0x2 # (DW_AT_location)
++ .uleb128 0x18 # (DW_FORM_exprloc)
++ .byte 0
++ .byte 0
++ .uleb128 0x9 # (abbrev code)
++ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
++ .byte 0x1 # DW_children_yes
++ .uleb128 0x3f # (DW_AT_external)
++ .uleb128 0x19 # (DW_FORM_flag_present)
++ .uleb128 0x3 # (DW_AT_name)
++ .uleb128 0xe # (DW_FORM_strp)
++ .uleb128 0x3a # (DW_AT_decl_file)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3b # (DW_AT_decl_line)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .uleb128 0x11 # (DW_AT_low_pc)
++ .uleb128 0x1 # (DW_FORM_addr)
++ .uleb128 0x12 # (DW_AT_high_pc)
++ .uleb128 0x7 # (DW_FORM_data8)
++ .uleb128 0x40 # (DW_AT_frame_base)
++ .uleb128 0x18 # (DW_FORM_exprloc)
++ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
++ .uleb128 0x19 # (DW_FORM_flag_present)
++ .byte 0
++ .byte 0
++ .uleb128 0xa # (abbrev code)
++ .uleb128 0xb # (TAG: DW_TAG_lexical_block)
++ .byte 0x1 # DW_children_yes
++ .uleb128 0x11 # (DW_AT_low_pc)
++ .uleb128 0x1 # (DW_FORM_addr)
++ .uleb128 0x12 # (DW_AT_high_pc)
++ .uleb128 0x7 # (DW_FORM_data8)
++ .byte 0
++ .byte 0
++ .uleb128 0xb # (abbrev code)
++ .uleb128 0x34 # (TAG: DW_TAG_variable)
++ .byte 0 # DW_children_no
++ .uleb128 0x3 # (DW_AT_name)
++ .uleb128 0x8 # (DW_FORM_string)
++ .uleb128 0x3a # (DW_AT_decl_file)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3b # (DW_AT_decl_line)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .uleb128 0x2 # (DW_AT_location)
++ .uleb128 0x18 # (DW_FORM_exprloc)
++ .byte 0
++ .byte 0
++ .uleb128 0xc # (abbrev code)
++ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site)
++ .byte 0x1 # DW_children_yes
++ .uleb128 0x11 # (DW_AT_low_pc)
++ .uleb128 0x1 # (DW_FORM_addr)
++ .uleb128 0x31 # (DW_AT_abstract_origin)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .byte 0
++ .byte 0
++ .uleb128 0xd # (abbrev code)
++ .uleb128 0x410a # (TAG: DW_TAG_GNU_call_site_parameter)
++ .byte 0 # DW_children_no
++ .uleb128 0x2 # (DW_AT_location)
++ .uleb128 0x18 # (DW_FORM_exprloc)
++ .uleb128 0x2111 # (DW_AT_GNU_call_site_value)
++ .uleb128 0x18 # (DW_FORM_exprloc)
++ .uleb128 0x2112 # (DW_AT_GNU_call_site_data_value)
++ .uleb128 0x18 # (DW_FORM_exprloc)
++ .byte 0
++ .byte 0
++ .uleb128 0xe # (abbrev code)
++ .uleb128 0x34 # (TAG: DW_TAG_variable)
++ .byte 0 # DW_children_no
++ .uleb128 0x3 # (DW_AT_name)
++ .uleb128 0x8 # (DW_FORM_string)
++ .uleb128 0x3a # (DW_AT_decl_file)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3b # (DW_AT_decl_line)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .uleb128 0x3f # (DW_AT_external)
++ .uleb128 0x19 # (DW_FORM_flag_present)
++ .uleb128 0x2 # (DW_AT_location)
++ .uleb128 0x18 # (DW_FORM_exprloc)
++ .byte 0
++ .byte 0
++ .uleb128 0xf # (abbrev code)
++ .uleb128 0x35 # (TAG: DW_TAG_volatile_type)
++ .byte 0 # DW_children_no
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .byte 0
++ .byte 0
++ .uleb128 0x10 # (abbrev code)
++ .uleb128 0xf # (TAG: DW_TAG_pointer_type)
++ .byte 0 # DW_children_no
++ .uleb128 0xb # (DW_AT_byte_size)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .byte 0
++ .byte 0
++ .byte 0
++ .section .debug_aranges,"",@progbits
++ .long 0x3c # Length of Address Ranges Info
++ .value 0x2 # DWARF Version
++ .long .Ldebug_info0 # Offset of Compilation Unit Info
++ .byte 0x8 # Size of Address
++ .byte 0 # Size of Segment Descriptor
++ .value 0 # Pad to 16 byte boundary
++ .value 0
++ .quad .Ltext0 # Address
++ .quad .Letext0-.Ltext0 # Length
++ .quad .LFB1 # Address
++ .quad .LFE1-.LFB1 # Length
++ .quad 0
++ .quad 0
++ .section .debug_ranges,"",@progbits
++.Ldebug_ranges0:
++ .quad .Ltext0 # Offset 0
++ .quad .Letext0
++ .quad .LFB1 # Offset 0x10
++ .quad .LFE1
++ .quad 0
++ .quad 0
++ .section .debug_line,"",@progbits
++.Ldebug_line0:
++ .section .debug_str,"MS",@progbits,1
++.LASF1:
++ .string "gdb.arch/amd64-entry-value-paramref.cc"
++.LASF2:
++ .string ""
++.LASF0:
++ .string "GNU C++ 4.8.2 20131212 (Red Hat 4.8.2-7) -mtune=generic -march=x86-64 -g -O2"
++.LASF3:
++ .string "main"
++ .ident "GCC: (GNU) 4.8.2 20131212 (Red Hat 4.8.2-7)"
++ .section .note.GNU-stack,"",@progbits
+diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.cc b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.cc
+new file mode 100644
+index 0000000..aa473a3
+--- /dev/null
++++ b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.cc
+@@ -0,0 +1,33 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++ Copyright 2014 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++volatile int vv, *p;
++
++static __attribute__((noinline)) int
++bar (int &ref)
++{
++ vv++; /* break-here */
++ p = &ref;
++ return ref;
++}
++
++int
++main (void)
++{
++ int var = 10;
++ return bar (var);
++}
+diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp
+new file mode 100644
+index 0000000..f06247d
+--- /dev/null
++++ b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp
+@@ -0,0 +1,35 @@
++# Copyright (C) 2014 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++standard_testfile .S .cc
++
++if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
++ verbose "Skipping amd64-entry-value-paramref."
++ return
++}
++
++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} "c++"] } {
++ return -1
++}
++
++if ![runto_main] {
++ return -1
++}
++
++set srcfile $srcfile2
++gdb_breakpoint [gdb_get_line_number "break-here"]
++
++gdb_continue_to_breakpoint "break-here" ".* break-here .*"
++gdb_test "frame" {bar \(ref=@0x[0-9a-f]+: 10, ref@entry=@0x[0-9a-f]+: <optimized out>\) at .*}
+diff --git a/gdb/testsuite/gdb.arch/amd64-optimout-repeat.S b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.S
+new file mode 100644
+index 0000000..2f8f4d2
+--- /dev/null
++++ b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.S
+@@ -0,0 +1,297 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++ Copyright 2012-2014 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++/* This file is compiled from gdb.arch/amd64-entry-value-param.c
++ using -g -dA -S -O2. */
++
++ .file "amd64-optimout-repeat.c"
++ .text
++.Ltext0:
++ .section .text.unlikely,"ax",@progbits
++.LCOLDB0:
++ .section .text.startup,"ax",@progbits
++.LHOTB0:
++ .p2align 4,,15
++ .section .text.unlikely
++.Ltext_cold0:
++ .section .text.startup
++ .globl main
++ .type main, @function
++main:
++.LFB0:
++ .file 1 "gdb.arch/amd64-optimout-repeat.c"
++ # gdb.arch/amd64-optimout-repeat.c:20
++ .loc 1 20 0
++ .cfi_startproc
++# BLOCK 2 freq:10000 seq:0
++# PRED: ENTRY [100.0%] (FALLTHRU)
++.LVL0:
++ # gdb.arch/amd64-optimout-repeat.c:29
++ .loc 1 29 0
++ xorl %eax, %eax
++# SUCC: EXIT [100.0%]
++ ret
++ .cfi_endproc
++.LFE0:
++ .size main, .-main
++ .section .text.unlikely
++.LCOLDE0:
++ .section .text.startup
++.LHOTE0:
++ .text
++.Letext0:
++ .section .text.unlikely
++.Letext_cold0:
++ .section .debug_info,"",@progbits
++.Ldebug_info0:
++ .long 0x97 # Length of Compilation Unit Info
++ .value 0x4 # DWARF version number
++ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section
++ .byte 0x8 # Pointer Size (in bytes)
++ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
++ .long .LASF1 # DW_AT_producer: "GNU C 4.9.1 20140709 (prerelease) -mtune=generic -march=x86-64 -g -O2"
++ .byte 0x1 # DW_AT_language
++ .long .LASF2 # DW_AT_name: "gdb.arch/amd64-optimout-repeat.c"
++ .long .LASF3 # DW_AT_comp_dir: ""
++ .long .Ldebug_ranges0+0 # DW_AT_ranges
++ .quad 0 # DW_AT_low_pc
++ .long .Ldebug_line0 # DW_AT_stmt_list
++ .uleb128 0x2 # (DIE (0x29) DW_TAG_subprogram)
++ # DW_AT_external
++ .long .LASF4 # DW_AT_name: "main"
++ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-optimout-repeat.c)
++ .byte 0x13 # DW_AT_decl_line
++ # DW_AT_prototyped
++ .long 0x7c # DW_AT_type
++ .quad .LFB0 # DW_AT_low_pc
++ .quad .LFE0-.LFB0 # DW_AT_high_pc
++ .uleb128 0x1 # DW_AT_frame_base
++ .byte 0x9c # DW_OP_call_frame_cfa
++ # DW_AT_GNU_all_call_sites
++ .long 0x7c # DW_AT_sibling
++ .uleb128 0x3 # (DIE (0x4a) DW_TAG_structure_type)
++ .value 0x404 # DW_AT_byte_size
++ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-optimout-repeat.c)
++ .byte 0x15 # DW_AT_decl_line
++ .long 0x6a # DW_AT_sibling
++ .uleb128 0x4 # (DIE (0x53) DW_TAG_member)
++ .ascii "i\0" # DW_AT_name
++ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-optimout-repeat.c)
++ .byte 0x17 # DW_AT_decl_line
++ .long 0x7c # DW_AT_type
++ .byte 0 # DW_AT_data_member_location
++ .uleb128 0x4 # (DIE (0x5d) DW_TAG_member)
++ .ascii "xxx\0" # DW_AT_name
++ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-optimout-repeat.c)
++ .byte 0x18 # DW_AT_decl_line
++ .long 0x83 # DW_AT_type
++ .byte 0x4 # DW_AT_data_member_location
++ .byte 0 # end of children of DIE 0x4a
++ .uleb128 0x5 # (DIE (0x6a) DW_TAG_variable)
++ .ascii "v\0" # DW_AT_name
++ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-optimout-repeat.c)
++ .byte 0x1a # DW_AT_decl_line
++ .long 0x4a # DW_AT_type
++ .uleb128 0x7 # DW_AT_location
++ .byte 0x30 # DW_OP_lit0
++ .byte 0x9f # DW_OP_stack_value
++ .byte 0x93 # DW_OP_piece
++ .uleb128 0x4
++ .byte 0x93 # DW_OP_piece
++ .uleb128 0x400
++ .byte 0 # end of children of DIE 0x29
++ .uleb128 0x6 # (DIE (0x7c) DW_TAG_base_type)
++ .byte 0x4 # DW_AT_byte_size
++ .byte 0x5 # DW_AT_encoding
++ .ascii "int\0" # DW_AT_name
++ .uleb128 0x7 # (DIE (0x83) DW_TAG_array_type)
++ .long 0x7c # DW_AT_type
++ .long 0x93 # DW_AT_sibling
++ .uleb128 0x8 # (DIE (0x8c) DW_TAG_subrange_type)
++ .long 0x93 # DW_AT_type
++ .byte 0xff # DW_AT_upper_bound
++ .byte 0 # end of children of DIE 0x83
++ .uleb128 0x9 # (DIE (0x93) DW_TAG_base_type)
++ .byte 0x8 # DW_AT_byte_size
++ .byte 0x7 # DW_AT_encoding
++ .long .LASF0 # DW_AT_name: "sizetype"
++ .byte 0 # end of children of DIE 0xb
++ .section .debug_abbrev,"",@progbits
++.Ldebug_abbrev0:
++ .uleb128 0x1 # (abbrev code)
++ .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
++ .byte 0x1 # DW_children_yes
++ .uleb128 0x25 # (DW_AT_producer)
++ .uleb128 0xe # (DW_FORM_strp)
++ .uleb128 0x13 # (DW_AT_language)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3 # (DW_AT_name)
++ .uleb128 0xe # (DW_FORM_strp)
++ .uleb128 0x1b # (DW_AT_comp_dir)
++ .uleb128 0xe # (DW_FORM_strp)
++ .uleb128 0x55 # (DW_AT_ranges)
++ .uleb128 0x17 # (DW_FORM_sec_offset)
++ .uleb128 0x11 # (DW_AT_low_pc)
++ .uleb128 0x1 # (DW_FORM_addr)
++ .uleb128 0x10 # (DW_AT_stmt_list)
++ .uleb128 0x17 # (DW_FORM_sec_offset)
++ .byte 0
++ .byte 0
++ .uleb128 0x2 # (abbrev code)
++ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
++ .byte 0x1 # DW_children_yes
++ .uleb128 0x3f # (DW_AT_external)
++ .uleb128 0x19 # (DW_FORM_flag_present)
++ .uleb128 0x3 # (DW_AT_name)
++ .uleb128 0xe # (DW_FORM_strp)
++ .uleb128 0x3a # (DW_AT_decl_file)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3b # (DW_AT_decl_line)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x27 # (DW_AT_prototyped)
++ .uleb128 0x19 # (DW_FORM_flag_present)
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .uleb128 0x11 # (DW_AT_low_pc)
++ .uleb128 0x1 # (DW_FORM_addr)
++ .uleb128 0x12 # (DW_AT_high_pc)
++ .uleb128 0x7 # (DW_FORM_data8)
++ .uleb128 0x40 # (DW_AT_frame_base)
++ .uleb128 0x18 # (DW_FORM_exprloc)
++ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
++ .uleb128 0x19 # (DW_FORM_flag_present)
++ .uleb128 0x1 # (DW_AT_sibling)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .byte 0
++ .byte 0
++ .uleb128 0x3 # (abbrev code)
++ .uleb128 0x13 # (TAG: DW_TAG_structure_type)
++ .byte 0x1 # DW_children_yes
++ .uleb128 0xb # (DW_AT_byte_size)
++ .uleb128 0x5 # (DW_FORM_data2)
++ .uleb128 0x3a # (DW_AT_decl_file)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3b # (DW_AT_decl_line)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x1 # (DW_AT_sibling)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .byte 0
++ .byte 0
++ .uleb128 0x4 # (abbrev code)
++ .uleb128 0xd # (TAG: DW_TAG_member)
++ .byte 0 # DW_children_no
++ .uleb128 0x3 # (DW_AT_name)
++ .uleb128 0x8 # (DW_FORM_string)
++ .uleb128 0x3a # (DW_AT_decl_file)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3b # (DW_AT_decl_line)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .uleb128 0x38 # (DW_AT_data_member_location)
++ .uleb128 0xb # (DW_FORM_data1)
++ .byte 0
++ .byte 0
++ .uleb128 0x5 # (abbrev code)
++ .uleb128 0x34 # (TAG: DW_TAG_variable)
++ .byte 0 # DW_children_no
++ .uleb128 0x3 # (DW_AT_name)
++ .uleb128 0x8 # (DW_FORM_string)
++ .uleb128 0x3a # (DW_AT_decl_file)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3b # (DW_AT_decl_line)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .uleb128 0x2 # (DW_AT_location)
++ .uleb128 0x18 # (DW_FORM_exprloc)
++ .byte 0
++ .byte 0
++ .uleb128 0x6 # (abbrev code)
++ .uleb128 0x24 # (TAG: DW_TAG_base_type)
++ .byte 0 # DW_children_no
++ .uleb128 0xb # (DW_AT_byte_size)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3e # (DW_AT_encoding)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3 # (DW_AT_name)
++ .uleb128 0x8 # (DW_FORM_string)
++ .byte 0
++ .byte 0
++ .uleb128 0x7 # (abbrev code)
++ .uleb128 0x1 # (TAG: DW_TAG_array_type)
++ .byte 0x1 # DW_children_yes
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .uleb128 0x1 # (DW_AT_sibling)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .byte 0
++ .byte 0
++ .uleb128 0x8 # (abbrev code)
++ .uleb128 0x21 # (TAG: DW_TAG_subrange_type)
++ .byte 0 # DW_children_no
++ .uleb128 0x49 # (DW_AT_type)
++ .uleb128 0x13 # (DW_FORM_ref4)
++ .uleb128 0x2f # (DW_AT_upper_bound)
++ .uleb128 0xb # (DW_FORM_data1)
++ .byte 0
++ .byte 0
++ .uleb128 0x9 # (abbrev code)
++ .uleb128 0x24 # (TAG: DW_TAG_base_type)
++ .byte 0 # DW_children_no
++ .uleb128 0xb # (DW_AT_byte_size)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3e # (DW_AT_encoding)
++ .uleb128 0xb # (DW_FORM_data1)
++ .uleb128 0x3 # (DW_AT_name)
++ .uleb128 0xe # (DW_FORM_strp)
++ .byte 0
++ .byte 0
++ .byte 0
++ .section .debug_aranges,"",@progbits
++ .long 0x2c # Length of Address Ranges Info
++ .value 0x2 # DWARF Version
++ .long .Ldebug_info0 # Offset of Compilation Unit Info
++ .byte 0x8 # Size of Address
++ .byte 0 # Size of Segment Descriptor
++ .value 0 # Pad to 16 byte boundary
++ .value 0
++ .quad .LFB0 # Address
++ .quad .LFE0-.LFB0 # Length
++ .quad 0
++ .quad 0
++ .section .debug_ranges,"",@progbits
++.Ldebug_ranges0:
++ .quad .LFB0 # Offset 0
++ .quad .LFE0
++ .quad 0
++ .quad 0
++ .section .debug_line,"",@progbits
++.Ldebug_line0:
++ .section .debug_str,"MS",@progbits,1
++.LASF0:
++ .string "sizetype"
++.LASF2:
++ .string "gdb.arch/amd64-optimout-repeat.c"
++.LASF1:
++ .string "GNU C 4.9.1 20140709 (prerelease) -mtune=generic -march=x86-64 -g -O2"
++.LASF3:
++ .string ""
++.LASF4:
++ .string "main"
++ .ident "GCC: (GNU) 4.9.1 20140709 (prerelease)"
++ .section .note.GNU-stack,"",@progbits
+diff --git a/gdb/testsuite/gdb.arch/amd64-optimout-repeat.c b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.c
+new file mode 100644
+index 0000000..a32b6de
+--- /dev/null
++++ b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.c
+@@ -0,0 +1,29 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++ Copyright 2014 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++int
++main (void)
++{
++ struct
++ {
++ int i;
++ int xxx[0x100];
++ }
++ v = { 0 };
++
++ return v.i;
++}
+diff --git a/gdb/testsuite/gdb.arch/amd64-optimout-repeat.exp b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.exp
+new file mode 100644
+index 0000000..f3c93a4
+--- /dev/null
++++ b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.exp
+@@ -0,0 +1,36 @@
++# Copyright (C) 2014 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++standard_testfile .S .c
++set opts {}
++
++if [info exists COMPILE] {
++ # make check RUNTESTFLAGS="gdb.arch/amd64-optimout-repeat.exp COMPILE=1"
++ set srcfile ${srcfile2}
++ lappend opts debug optimize=-O2
++} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
++ verbose "Skipping amd64-optimout-repeat."
++ return
++}
++
++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $opts] } {
++ return -1
++}
++
++if ![runto_main] {
++ return -1
++}
++
++gdb_test "print v" { = {i = 0, xxx = {<optimized out> <repeats 256 times>}}}
+
+--Dxnq1zWXvFF0Q93v--
+
diff --git a/gdb-testsuite-pagination-read1.patch b/gdb-testsuite-pagination-read1.patch
new file mode 100644
index 0000000..58fb132
--- /dev/null
+++ b/gdb-testsuite-pagination-read1.patch
@@ -0,0 +1,415 @@
+http://sourceware.org/ml/gdb-patches/2014-07/msg00553.html
+Subject: [testsuite patch] Fix paginate-*.exp race for "read1"
+
+
+--17pEHd4RhPHOinZp
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+
+Hi Pedro,
+
+these testcase have racy results:
+ gdb.base/double-prompt-target-event-error.exp
+ gdb.base/paginate-after-ctrl-c-running.exp
+ gdb.base/paginate-bg-execution.exp
+ gdb.base/paginate-execution-startup.exp
+ gdb.base/paginate-inferior-exit.exp
+
+reproducible with "read1" from:
+ reproducer for races of expect incomplete reads
+ http://sourceware.org/bugzilla/show_bug.cgi?id=12649
+
+# Prevent gdb_test_multiple considering an error -re "<return>" match.
+# For unknown reason -notransfer -re "<return>" { exp_continue } does not
+# prevent it.
+
+Tested on Fedora 20 x86_64 and Fedora Rawhide x86_64 that -notransfer does not
+work there:
+ expect-5.45-10.fc20.x86_64
+ expect-5.45-16.fc21.x86_64
+
+Sure if someone gets -notransfer working this patch could be dropped.
+
+
+Jan
+
+--17pEHd4RhPHOinZp
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline; filename=1
+
+gdb/testsuite/
+2014-07-22 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.base/double-prompt-target-event-error.exp: Use
+ gdb_test_pagination.
+ * gdb.base/paginate-after-ctrl-c-running.exp: Likewise.
+ * gdb.base/paginate-bg-execution.exp: Likewise.
+ * gdb.base/paginate-execution-startup.exp: Likewise.
+ * gdb.base/paginate-inferior-exit.exp: Likewise.
+ * lib/gdb.exp (pagination_prompt): Remove.
+ (gdb_test_pagination): New.
+
+diff --git a/gdb/testsuite/gdb.base/double-prompt-target-event-error.exp b/gdb/testsuite/gdb.base/double-prompt-target-event-error.exp
+index 5571cdf..803e256 100644
+--- a/gdb/testsuite/gdb.base/double-prompt-target-event-error.exp
++++ b/gdb/testsuite/gdb.base/double-prompt-target-event-error.exp
+@@ -28,7 +28,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug] == -1} {
+
+ proc cancel_pagination_in_target_event { command } {
+ global binfile srcfile
+- global gdb_prompt pagination_prompt
++ global gdb_prompt
+
+ set testline [gdb_get_line_number "after sleep"]
+
+@@ -60,25 +60,23 @@ proc cancel_pagination_in_target_event { command } {
+
+ # Wait for pagination prompt after the "Continuing" line,
+ # indicating the program was running and then stopped.
++ global saw_continuing
+ set saw_continuing 0
+ set test "continue to pagination"
+- gdb_test_multiple "$command" $test {
+- -re "$pagination_prompt$" {
+- if {$saw_continuing} {
+- pass $test
+- } else {
+- send_gdb "\n"
+- exp_continue
+- }
++ gdb_test_pagination $command $test {
++ global saw_continuing
++ if {$saw_continuing} {
++ pass $test
++ } else {
++ send_gdb "\n"
++ exp_continue
+ }
++ } {
+ -re "Continuing" {
++ global saw_continuing
+ set saw_continuing 1
+ exp_continue
+ }
+- -notransfer -re "<return>" {
+- # Otherwise gdb_test_multiple considers this an error.
+- exp_continue
+- }
+ }
+
+ # We're now stopped in a pagination query while handling a
+@@ -88,15 +86,20 @@ proc cancel_pagination_in_target_event { command } {
+ send_gdb "\003p 1\n"
+
+ set test "no double prompt"
+- gdb_test_multiple "" $test {
+- -re "$gdb_prompt.*$gdb_prompt.*$gdb_prompt $" {
+- fail $test
+- }
+- -re "$gdb_prompt .* = 1\r\n$gdb_prompt $" {
++ global saw_prompt
++ set saw_prompt 0
++ gdb_test_pagination "" $test {
++ exp_continue
++ } {
++ -re " = 1\r\n$gdb_prompt $" {
+ pass $test
+ }
+- -notransfer -re "<return>" {
+- # Otherwise gdb_test_multiple considers this an error.
++ -re "\r\n$gdb_prompt " {
++ global saw_prompt
++ if { $saw_prompt != 0 } {
++ fail $test
++ }
++ set saw_prompt 1
+ exp_continue
+ }
+ }
+diff --git a/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp b/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp
+index 0ed8c92..3323fe7 100644
+--- a/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp
++++ b/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp
+@@ -24,7 +24,6 @@ if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
+
+ proc test_ctrlc_while_target_running_paginates {} {
+ global binfile srcfile
+- global gdb_prompt pagination_prompt
+
+ set testline [gdb_get_line_number "after sleep"]
+
+@@ -61,19 +60,13 @@ proc test_ctrlc_while_target_running_paginates {} {
+ # the user can respond to the pagination query.
+ set test "got prompt"
+ set saw_pagination_prompt 0
+- gdb_test_multiple "" $test {
+- -re "$pagination_prompt$" {
+- set saw_pagination_prompt 1
+- send_gdb "\n"
+- exp_continue
+- }
++ gdb_test_pagination "" $test {
++ send_gdb "\n"
++ exp_continue
++ } {
+ -re "$gdb_prompt $" {
+ gdb_assert $saw_pagination_prompt $test
+ }
+- -notransfer -re "<return>" {
+- # Otherwise gdb_test_multiple considers this an error.
+- exp_continue
+- }
+ }
+
+ # Confirm GDB can still process input.
+diff --git a/gdb/testsuite/gdb.base/paginate-bg-execution.exp b/gdb/testsuite/gdb.base/paginate-bg-execution.exp
+index dcff8ad..3ba46a3 100644
+--- a/gdb/testsuite/gdb.base/paginate-bg-execution.exp
++++ b/gdb/testsuite/gdb.base/paginate-bg-execution.exp
+@@ -27,7 +27,6 @@ if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
+
+ proc test_bg_execution_pagination_return {} {
+ global binfile
+- global pagination_prompt
+
+ with_test_prefix "paginate" {
+ clean_restart $binfile
+@@ -43,21 +42,12 @@ proc test_bg_execution_pagination_return {} {
+
+ gdb_test "continue&" "Continuing\."
+
+- set test "pagination handled, breakpoint hit"
+- set saw_pagination_prompt 0
+- gdb_test_multiple "" $test {
+- -re "$pagination_prompt$" {
+- set saw_pagination_prompt 1
+- send_gdb "\n"
+- exp_continue
+- }
+- -notransfer -re "<return>" {
+- # Otherwise gdb_test_multiple considers this an
+- # error.
+- exp_continue
+- }
++ gdb_test_pagination "" "pagination handled, breakpoint hit" {
++ send_gdb "\n"
++ exp_continue
++ } {
+ -re "after sleep\[^\r\n\]+\r\n$" {
+- gdb_assert $saw_pagination_prompt $test
++ gdb_assert { $saw_pagination_prompt == 3 } $test
+ }
+ }
+
+@@ -75,7 +65,7 @@ proc test_bg_execution_pagination_return {} {
+
+ proc test_bg_execution_pagination_cancel { how } {
+ global binfile
+- global gdb_prompt pagination_prompt
++ global gdb_prompt
+
+ with_test_prefix "cancel with $how" {
+ clean_restart $binfile
+@@ -92,14 +82,8 @@ proc test_bg_execution_pagination_cancel { how } {
+ gdb_test "continue&" "Continuing\."
+
+ set test "continue& paginates"
+- gdb_test_multiple "" $test {
+- -re "$pagination_prompt$" {
+- pass $test
+- }
+- -notransfer -re "<return>" {
+- # Otherwise gdb_test_multiple considers this an error.
+- exp_continue
+- }
++ gdb_test_pagination "" $test {
++ pass $test
+ }
+
+ set test "cancel pagination"
+diff --git a/gdb/testsuite/gdb.base/paginate-execution-startup.exp b/gdb/testsuite/gdb.base/paginate-execution-startup.exp
+index dc713ec..4dc2376 100644
+--- a/gdb/testsuite/gdb.base/paginate-execution-startup.exp
++++ b/gdb/testsuite/gdb.base/paginate-execution-startup.exp
+@@ -76,7 +76,6 @@ proc probe_can_run_cmdline {} {
+ proc test_fg_execution_pagination_return {} {
+ global file_arg
+ global saved_gdbflags GDBFLAGS
+- global gdb_prompt pagination_prompt
+
+ set GDBFLAGS $saved_gdbflags
+ append GDBFLAGS " -ex \"set height 2\""
+@@ -92,10 +91,9 @@ proc test_fg_execution_pagination_return {} {
+ fail $test
+ return $res
+ }
+- gdb_test_multiple "" $test {
+- -re "$pagination_prompt$" {
+- pass $test
+- }
++ gdb_test_pagination "" $test {
++ pass $test
++ } {
+ -re "$gdb_prompt $" {
+ fail $test
+ }
+@@ -103,20 +101,13 @@ proc test_fg_execution_pagination_return {} {
+
+ send_gdb "\n"
+
+- set saw_pagination_prompt 0
+ set test "send \\n to GDB"
+- gdb_test_multiple "" $test {
+- -re "$pagination_prompt$" {
+- set saw_pagination_prompt 1
+- send_gdb "\n"
+- exp_continue
+- }
+- -notransfer -re "<return>" {
+- # Otherwise gdb_test_multiple considers this an error.
+- exp_continue
+- }
++ gdb_test_pagination "" $test {
++ send_gdb "\n"
++ exp_continue
++ } {
+ -re "$gdb_prompt $" {
+- gdb_assert $saw_pagination_prompt $test
++ gdb_assert { $saw_pagination_prompt == 3 } $test
+ }
+ }
+
+@@ -133,7 +124,7 @@ proc test_fg_execution_pagination_return {} {
+ proc test_fg_execution_pagination_cancel { how } {
+ global file_arg
+ global saved_gdbflags GDBFLAGS
+- global gdb_prompt pagination_prompt
++ global gdb_prompt
+
+ set GDBFLAGS $saved_gdbflags
+
+@@ -150,14 +141,8 @@ proc test_fg_execution_pagination_cancel { how } {
+ fail $test
+ return $res
+ }
+- gdb_test_multiple "" $test {
+- -re "$pagination_prompt$" {
+- pass $test
+- }
+- -notransfer -re "<return>" {
+- # Otherwise gdb_test_multiple considers this an error.
+- exp_continue
+- }
++ gdb_test_pagination "" $test {
++ pass $test
+ }
+
+ set test "cancel pagination"
+diff --git a/gdb/testsuite/gdb.base/paginate-inferior-exit.exp b/gdb/testsuite/gdb.base/paginate-inferior-exit.exp
+index 0e37be9..d43a245 100644
+--- a/gdb/testsuite/gdb.base/paginate-inferior-exit.exp
++++ b/gdb/testsuite/gdb.base/paginate-inferior-exit.exp
+@@ -26,7 +26,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
+ #
+ proc test_paginate_inferior_exited {} {
+ global binfile
+- global gdb_prompt pagination_prompt
++ global gdb_prompt
+ global inferior_exited_re
+
+ with_test_prefix "paginate" {
+@@ -45,23 +45,18 @@ proc test_paginate_inferior_exited {} {
+ # Wait for the "Starting program" line, indicating the program
+ # is running.
+ set saw_starting 0
+- gdb_test_multiple "continue" $test {
+- -re "$pagination_prompt" {
+- if {$saw_starting} {
+- pass $test
+- } else {
+- send_gdb "\n"
+- exp_continue
+- }
++ gdb_test_pagination "continue" $test {
++ if {$saw_starting} {
++ pass $test
++ } else {
++ send_gdb "\n"
++ exp_continue
+ }
++ } {
+ -re "Continuing" {
+ set saw_starting 1
+ exp_continue
+ }
+- -notransfer -re "<return>" {
+- # Otherwise gdb_test_multiple considers this an error.
+- exp_continue
+- }
+ }
+
+ # We're now stopped in a pagination output while handling a
+diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
+index 7a00efb..d953a50 100644
+--- a/gdb/testsuite/lib/gdb.exp
++++ b/gdb/testsuite/lib/gdb.exp
+@@ -70,9 +70,6 @@ if ![info exists gdb_prompt] then {
+ set gdb_prompt "\[(\]gdb\[)\]"
+ }
+
+-# A regexp that matches the pagination prompt.
+-set pagination_prompt "---Type <return> to continue, or q <return> to quit---"
+-
+ # The variable fullname_syntax_POSIX is a regexp which matches a POSIX
+ # absolute path ie. /foo/
+ set fullname_syntax_POSIX {/[^\n]*/}
+@@ -4846,5 +4843,46 @@ proc capture_command_output { command prefix } {
+ return $output_string
+ }
+
++# Prevent gdb_test_multiple considering an error -re "<return>" match.
++# For unknown reason -notransfer -re "<return>" { exp_continue } does not
++# prevent it.
++
++proc gdb_test_pagination { command test { code_prompt3 {} } { code_append {} } } {
++ global pagination_prompt1 pagination_prompt2 pagination_prompt3
++ global gdb_prompt
++
++ # A regexp that matches the pagination prompt.
++ set pagination_prompt1 "---Type <return"
++ set pagination_prompt2 "> to continue, or q <return"
++ set pagination_prompt3 "> to quit---"
++
++ append code_append {
++ -re "${pagination_prompt1}" {
++ if { $saw_pagination_prompt != 0 && $saw_pagination_prompt != 3 } {
++ fail "$test (1)"
++ }
++ set saw_pagination_prompt 1
++ exp_continue
++ }
++ -re "${pagination_prompt2}" {
++ if { $saw_pagination_prompt != 1 } {
++ fail "$test (2)"
++ }
++ set saw_pagination_prompt 2
++ exp_continue
++ }
++ -re "${pagination_prompt3}$" {
++ if { $saw_pagination_prompt != 2 } {
++ fail "$test (3)"
++ }
++ set saw_pagination_prompt 3
++ eval $code_prompt3
++ }
++ }
++
++ set saw_pagination_prompt 0
++ gdb_test_multiple $command $test $code_append
++}
++
+ # Always load compatibility stuff.
+ load_lib future.exp
+
+--17pEHd4RhPHOinZp--
+
diff --git a/gdb-upstream.patch b/gdb-upstream.patch
index 055067a..028fe7a 100644
--- a/gdb-upstream.patch
+++ b/gdb-upstream.patch
@@ -65,375 +65,3 @@ index 0e0202d..d849b4c 100644
# gdbserver does not have this issue.
if ![is_remote target] {
setup_kfail "*-*-*" gdb/15934
-
-
-
-
-commit 768fbcfda81ff37027eb7a02c043ff669f7701fa
-Author: Pedro Alves <palves@redhat.com>
-Date: Fri Jul 11 11:11:20 2014 +0100
-
- GDBserver crashes when killing a multi-thread process
-
- Here's an example, with the new test:
-
- gdbserver :9999 gdb.threads/kill
- gdb gdb.threads/kill
- (gdb) b 52
- Breakpoint 1 at 0x4007f4: file kill.c, line 52.
- Continuing.
-
- Breakpoint 1, main () at kill.c:52
- 52 return 0; /* set break here */
- (gdb) k
- Kill the program being debugged? (y or n) y
-
- gdbserver :9999 gdb.threads/kill
- Process gdb.base/watch_thread_num created; pid = 9719
- Listening on port 1234
- Remote debugging from host 127.0.0.1
- Killing all inferiors
- Segmentation fault (core dumped)
-
- Backtrace:
-
- (gdb) bt
- #0 0x00000000004068a0 in find_inferior (list=0x66b060 <all_threads>, func=0x427637 <kill_one_lwp_callback>, arg=0x7fffffffd3fc) at src/gdb/gdbserver/inferiors.c:199
- #1 0x00000000004277b6 in linux_kill (pid=15708) at src/gdb/gdbserver/linux-low.c:966
- #2 0x000000000041354d in kill_inferior (pid=15708) at src/gdb/gdbserver/target.c:163
- #3 0x00000000004107e9 in kill_inferior_callback (entry=0x6704f0) at src/gdb/gdbserver/server.c:2934
- #4 0x0000000000406522 in for_each_inferior (list=0x66b050 <all_processes>, action=0x4107a6 <kill_inferior_callback>) at src/gdb/gdbserver/inferiors.c:57
- #5 0x0000000000412377 in process_serial_event () at src/gdb/gdbserver/server.c:3767
- #6 0x000000000041267c in handle_serial_event (err=0, client_data=0x0) at src/gdb/gdbserver/server.c:3880
- #7 0x00000000004189ff in handle_file_event (event_file_desc=4) at src/gdb/gdbserver/event-loop.c:434
- #8 0x00000000004181c6 in process_event () at src/gdb/gdbserver/event-loop.c:189
- #9 0x0000000000418f45 in start_event_loop () at src/gdb/gdbserver/event-loop.c:552
- #10 0x0000000000411272 in main (argc=3, argv=0x7fffffffd8d8) at src/gdb/gdbserver/server.c:3283
-
- The problem is that linux_wait_for_event deletes lwps that have exited
- (even those not passed in as lwps of interest), while the lwp/thread
- list is being walked on with find_inferior. find_inferior can handle
- the current iterated inferior being deleted, but not others.
-
- When killing lwps, we don't really care about any of the pending
- status handling of linux_wait_for_event. We can just waitpid the lwps
- directly, which is also what GDB does (see
- linux-nat.c:kill_wait_callback). This way the lwps are not deleted
- while we're walking the list. They'll be deleted by linux_mourn
- afterwards.
-
- This crash triggers several times when running the testsuite against
- GDBserver with the native-gdbserver board (target remote), but as GDB
- can't distinguish between GDBserver crashing and "kill" being
- sucessful, as in both cases the connection is closed (the 'k' packet
- doesn't require a reply), and the inferior is gone, that results in no
- FAIL.
-
- The patch adds a generic test that catches the issue with
- extended-remote mode (and works fine with native testing too). Here's
- how it fails with the native-extended-gdbserver board without the fix:
-
- (gdb) info threads
- Id Target Id Frame
- 6 Thread 15367.15374 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
- 5 Thread 15367.15373 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
- 4 Thread 15367.15372 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
- 3 Thread 15367.15371 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
- 2 Thread 15367.15370 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
- * 1 Thread 15367.15367 main () at .../gdb.threads/kill.c:52
- (gdb) kill
- Kill the program being debugged? (y or n) y
- Remote connection closed
- ^^^^^^^^^^^^^^^^^^^^^^^^
- (gdb) FAIL: gdb.threads/kill.exp: kill
-
- Extended remote should remain connected after the kill.
-
- gdb/gdbserver/
- 2014-07-11 Pedro Alves <palves@redhat.com>
-
- * linux-low.c (kill_wait_lwp): New function, based on
- kill_one_lwp_callback, but use my_waitpid directly.
- (kill_one_lwp_callback, linux_kill): Use it.
-
- gdb/testsuite/
- 2014-07-11 Pedro Alves <palves@redhat.com>
-
- * gdb.threads/kill.c: New file.
- * gdb.threads/kill.exp: New file.
-
-### a/gdb/gdbserver/ChangeLog
-### b/gdb/gdbserver/ChangeLog
-## -1,3 +1,9 @@
-+2014-07-11 Pedro Alves <palves@redhat.com>
-+
-+ * linux-low.c (kill_wait_lwp): New function, based on
-+ kill_one_lwp_callback, but use my_waitpid directly.
-+ (kill_one_lwp_callback, linux_kill): Use it.
-+
- 2014-06-23 Pedro Alves <palves@redhat.com>
-
- * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
---- a/gdb/gdbserver/linux-low.c
-+++ b/gdb/gdbserver/linux-low.c
-@@ -909,6 +909,46 @@ linux_kill_one_lwp (struct lwp_info *lwp)
- errno ? strerror (errno) : "OK");
- }
-
-+/* Kill LWP and wait for it to die. */
-+
-+static void
-+kill_wait_lwp (struct lwp_info *lwp)
-+{
-+ struct thread_info *thr = get_lwp_thread (lwp);
-+ int pid = ptid_get_pid (ptid_of (thr));
-+ int lwpid = ptid_get_lwp (ptid_of (thr));
-+ int wstat;
-+ int res;
-+
-+ if (debug_threads)
-+ debug_printf ("kwl: killing lwp %d, for pid: %d\n", lwpid, pid);
-+
-+ do
-+ {
-+ linux_kill_one_lwp (lwp);
-+
-+ /* Make sure it died. Notes:
-+
-+ - The loop is most likely unnecessary.
-+
-+ - We don't use linux_wait_for_event as that could delete lwps
-+ while we're iterating over them. We're not interested in
-+ any pending status at this point, only in making sure all
-+ wait status on the kernel side are collected until the
-+ process is reaped.
-+
-+ - We don't use __WALL here as the __WALL emulation relies on
-+ SIGCHLD, and killing a stopped process doesn't generate
-+ one, nor an exit status.
-+ */
-+ res = my_waitpid (lwpid, &wstat, 0);
-+ if (res == -1 && errno == ECHILD)
-+ res = my_waitpid (lwpid, &wstat, __WCLONE);
-+ } while (res > 0 && WIFSTOPPED (wstat));
-+
-+ gdb_assert (res > 0);
-+}
-+
- /* Callback for `find_inferior'. Kills an lwp of a given process,
- except the leader. */
-
-@@ -917,7 +957,6 @@ kill_one_lwp_callback (struct inferior_list_entry *entry, void *args)
- {
- struct thread_info *thread = (struct thread_info *) entry;
- struct lwp_info *lwp = get_thread_lwp (thread);
-- int wstat;
- int pid = * (int *) args;
-
- if (ptid_get_pid (entry->id) != pid)
-@@ -936,14 +975,7 @@ kill_one_lwp_callback (struct inferior_list_entry *entry, void *args)
- return 0;
- }
-
-- do
-- {
-- linux_kill_one_lwp (lwp);
--
-- /* Make sure it died. The loop is most likely unnecessary. */
-- pid = linux_wait_for_event (thread->entry.id, &wstat, __WALL);
-- } while (pid > 0 && WIFSTOPPED (wstat));
--
-+ kill_wait_lwp (lwp);
- return 0;
- }
-
-@@ -952,8 +984,6 @@ linux_kill (int pid)
- {
- struct process_info *process;
- struct lwp_info *lwp;
-- int wstat;
-- int lwpid;
-
- process = find_process_pid (pid);
- if (process == NULL)
-@@ -976,21 +1006,7 @@ linux_kill (int pid)
- pid);
- }
- else
-- {
-- struct thread_info *thr = get_lwp_thread (lwp);
--
-- if (debug_threads)
-- debug_printf ("lk_1: killing lwp %ld, for pid: %d\n",
-- lwpid_of (thr), pid);
--
-- do
-- {
-- linux_kill_one_lwp (lwp);
--
-- /* Make sure it died. The loop is most likely unnecessary. */
-- lwpid = linux_wait_for_event (thr->entry.id, &wstat, __WALL);
-- } while (lwpid > 0 && WIFSTOPPED (wstat));
-- }
-+ kill_wait_lwp (lwp);
-
- the_target->mourn (process);
-
-### a/gdb/testsuite/ChangeLog
-### b/gdb/testsuite/ChangeLog
-## -1,3 +1,8 @@
-+2014-07-11 Pedro Alves <palves@redhat.com>
-+
-+ * gdb.threads/kill.c: New file.
-+ * gdb.threads/kill.exp: New file.
-+
- 2014-07-09 Pedro Alves <palves@redhat.com>
-
- * gdb.base/attach-wait-input.exp: New file.
---- /dev/null
-+++ b/gdb/testsuite/gdb.threads/kill.c
-@@ -0,0 +1,64 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2014 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+#ifdef USE_THREADS
-+
-+#include <unistd.h>
-+#include <pthread.h>
-+
-+#define NUM 5
-+
-+pthread_barrier_t barrier;
-+
-+void *
-+thread_function (void *arg)
-+{
-+ volatile unsigned int counter = 1;
-+
-+ pthread_barrier_wait (&barrier);
-+
-+ while (counter > 0)
-+ {
-+ counter++;
-+ usleep (1);
-+ }
-+
-+ pthread_exit (NULL);
-+}
-+
-+#endif /* USE_THREADS */
-+
-+void
-+setup (void)
-+{
-+#ifdef USE_THREADS
-+ pthread_t threads[NUM];
-+ int i;
-+
-+ pthread_barrier_init (&barrier, NULL, NUM + 1);
-+ for (i = 0; i < NUM; i++)
-+ pthread_create (&threads[i], NULL, thread_function, NULL);
-+ pthread_barrier_wait (&barrier);
-+#endif /* USE_THREADS */
-+}
-+
-+int
-+main (void)
-+{
-+ setup ();
-+ return 0; /* set break here */
-+}
---- /dev/null
-+++ b/gdb/testsuite/gdb.threads/kill.exp
-@@ -0,0 +1,77 @@
-+# This testcase is part of GDB, the GNU debugger.
-+
-+# Copyright 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+standard_testfile
-+
-+# Run the test proper. THREADED indicates whether to build a threaded
-+# program and spawn several threads before trying to kill the program.
-+
-+proc test {threaded} {
-+ global testfile srcfile
-+
-+ with_test_prefix [expr ($threaded)?"threaded":"non-threaded"] {
-+
-+ set options {debug}
-+ if {$threaded} {
-+ lappend options "pthreads"
-+ lappend options "additional_flags=-DUSE_THREADS"
-+ set prog ${testfile}_threads
-+ } else {
-+ set prog ${testfile}_nothreads
-+ }
-+
-+ if {[prepare_for_testing "failed to prepare" $prog $srcfile $options] == -1} {
-+ return -1
-+ }
-+
-+ if { ![runto main] } then {
-+ fail "run to main"
-+ return
-+ }
-+
-+ set linenum [gdb_get_line_number "set break here"]
-+ gdb_breakpoint "$srcfile:$linenum"
-+ gdb_continue_to_breakpoint "break here" ".*break here.*"
-+
-+ if {$threaded} {
-+ gdb_test "info threads" "6.*5.*4.*3.*2.*1.*" "all threads started"
-+ }
-+
-+ # This kills and ensures no output other than the prompt comes out,
-+ # like:
-+ #
-+ # (gdb) kill
-+ # Kill the program being debugged? (y or n) y
-+ # (gdb)
-+ #
-+ # If we instead saw more output, like e.g., with an extended-remote
-+ # connection:
-+ #
-+ # (gdb) kill
-+ # Kill the program being debugged? (y or n) y
-+ # Remote connection closed
-+ # (gdb)
-+ #
-+ # the above would mean that the remote end crashed.
-+
-+ gdb_test "kill" "^y" "kill program" "Kill the program being debugged\\? \\(y or n\\) $" "y"
-+ }
-+}
-+
-+foreach threaded {true false} {
-+ test $threaded
-+}
diff --git a/gdb-vla-intel.patch b/gdb-vla-intel.patch
index 0a646ab..d4f9eed 100644
--- a/gdb-vla-intel.patch
+++ b/gdb-vla-intel.patch
@@ -3,19 +3,18 @@ https://sourceware.org/ml/gdb-patches/2014-06/msg00108.html
https://github.com/intel-gdb/vla/tree/vla-fortran
GIT snapshot:
-commit c622a047d23bcbc4dc68398fc70b531cebd8f5ee
+commit 511bff520372ffc10fa2ff569c176bdf1e6e475d
diff --git a/gdb/NEWS b/gdb/NEWS
-index d9a19ae..1f22fea 100644
+index d9a19ae..e6885d2 100644
### a/gdb/NEWS
### b/gdb/NEWS
-@@ -3,6 +3,10 @@
+@@ -3,6 +3,9 @@
*** Changes since GDB 7.8
-+* Fortran dynamic array support: GDB has now support for
-+ dynamic arrays in Fortran. It allows the user to evaluate
++* Fortran dynamic array support: It allows the user to evaluate
+ dynamic arrays like an ordinary static array.
+
*** Changes in GDB 7.8
@@ -78,7 +77,7 @@ index 39dadf3..8cebbe8 100644
/* The location of a value. */
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
-index fcab9b9..4aac278 100644
+index fcab9b9..a624dac 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -306,6 +306,7 @@ struct dwarf_expr_baton
@@ -138,7 +137,19 @@ index fcab9b9..4aac278 100644
ctx = new_dwarf_expr_context ();
old_chain = make_cleanup_free_dwarf_expr_context (ctx);
-@@ -2436,6 +2456,7 @@ dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame,
+@@ -2326,6 +2346,11 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
+ int in_stack_memory = dwarf_expr_fetch_in_stack_memory (ctx, 0);
+
+ do_cleanups (value_chain);
++
++ /* Select right frame to correctly evaluate VLA's during a backtrace. */
++ if (is_dynamic_type (type))
++ select_frame (frame);
++
+ retval = value_at_lazy (type, address + byte_offset);
+ if (in_stack_memory)
+ set_value_stack (retval, 1);
+@@ -2436,6 +2461,7 @@ dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame,
static int
dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
@@ -146,7 +157,7 @@ index fcab9b9..4aac278 100644
CORE_ADDR *valp)
{
struct dwarf_expr_context *ctx;
-@@ -2451,6 +2472,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
+@@ -2451,6 +2477,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
baton.frame = get_selected_frame (NULL);
baton.per_cu = dlbaton->per_cu;
@@ -154,7 +165,7 @@ index fcab9b9..4aac278 100644
objfile = dwarf2_per_cu_objfile (dlbaton->per_cu);
-@@ -2491,7 +2513,8 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
+@@ -2491,7 +2518,8 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
/* See dwarf2loc.h. */
int
@@ -164,7 +175,7 @@ index fcab9b9..4aac278 100644
{
if (prop == NULL)
return 0;
-@@ -2502,7 +2525,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, CORE_ADDR *value)
+@@ -2502,7 +2530,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, CORE_ADDR *value)
{
const struct dwarf2_property_baton *baton = prop->data.baton;
@@ -173,31 +184,7 @@ index fcab9b9..4aac278 100644
{
if (baton->referenced_type)
{
-@@ -2510,6 +2533,11 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, CORE_ADDR *value)
-
- *value = value_as_address (val);
- }
-+ if (baton->post_values.data && baton->post_values.size > 0)
-+ {
-+ CORE_ADDR new_addr = *value;
-+ dwarf2_locexpr_baton_eval (&baton->post_values, new_addr, value);
-+ }
- return 1;
- }
- }
-@@ -2532,6 +2560,11 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, CORE_ADDR *value)
- if (!value_optimized_out (val))
- {
- *value = value_as_address (val);
-+ if (baton->post_values.data && baton->post_values.size > 0)
-+ {
-+ CORE_ADDR new_addr = *value;
-+ dwarf2_locexpr_baton_eval (&baton->post_values, new_addr, value);
-+ }
- return 1;
- }
- }
-@@ -2546,6 +2579,20 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, CORE_ADDR *value)
+@@ -2546,6 +2574,20 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, CORE_ADDR *value)
return 0;
}
@@ -218,7 +205,7 @@ index fcab9b9..4aac278 100644
\f
/* Helper functions and baton for dwarf2_loc_desc_needs_frame. */
-@@ -2653,6 +2700,15 @@ needs_get_addr_index (void *baton, unsigned int index)
+@@ -2653,6 +2695,15 @@ needs_get_addr_index (void *baton, unsigned int index)
return 1;
}
@@ -234,7 +221,7 @@ index fcab9b9..4aac278 100644
/* Virtual method table for dwarf2_loc_desc_needs_frame below. */
static const struct dwarf_expr_context_funcs needs_frame_ctx_funcs =
-@@ -2667,7 +2723,8 @@ static const struct dwarf_expr_context_funcs needs_frame_ctx_funcs =
+@@ -2667,7 +2718,8 @@ static const struct dwarf_expr_context_funcs needs_frame_ctx_funcs =
needs_frame_dwarf_call,
NULL, /* get_base_type */
needs_dwarf_reg_entry_value,
@@ -244,7 +231,7 @@ index fcab9b9..4aac278 100644
};
/* Return non-zero iff the location expression at DATA (length SIZE)
-@@ -3316,6 +3373,10 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
+@@ -3316,6 +3368,10 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
unimplemented (op);
break;
@@ -256,7 +243,7 @@ index fcab9b9..4aac278 100644
offset = extract_signed_integer (op_ptr, 2, byte_order);
op_ptr += 2;
diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
-index 8ad5fa9..cf648eb 100644
+index 8ad5fa9..fb65c5c 100644
--- a/gdb/dwarf2loc.h
+++ b/gdb/dwarf2loc.h
@@ -96,11 +96,18 @@ struct value *dwarf2_evaluate_loc_desc (struct type *type,
@@ -278,21 +265,11 @@ index 8ad5fa9..cf648eb 100644
/* The symbol location baton types used by the DWARF-2 reader (i.e.
SYMBOL_LOCATION_BATON for a LOC_COMPUTED symbol). "struct
dwarf2_locexpr_baton" is for a symbol with a single location
-@@ -161,6 +168,9 @@ struct dwarf2_property_baton
- /* Location list to be evaluated in the context of REFERENCED_TYPE. */
- struct dwarf2_loclist_baton loclist;
- };
-+
-+ /* Attributes, which will be pushed after evaluating locexpr or loclist. */
-+ struct dwarf2_locexpr_baton post_values;
- };
-
- extern const struct symbol_computed_ops dwarf2_locexpr_funcs;
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
-index 276d2f1..f5b35d7 100644
+index 276d2f1..fbf13ce 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
-@@ -1847,6 +1847,15 @@ static void free_dwo_file_cleanup (void *);
+@@ -1847,6 +1847,12 @@ static void free_dwo_file_cleanup (void *);
static void process_cu_includes (void);
static void check_producer (struct dwarf2_cu *cu);
@@ -302,13 +279,10 @@ index 276d2f1..f5b35d7 100644
+ struct dwarf2_cu *cu, struct dynamic_prop *prop,
+ const gdb_byte *additional_data, int additional_data_size);
+
-+static void add_post_values_to_baton (struct dwarf2_property_baton *baton,
-+ const gdb_byte *data, int size, struct dwarf2_cu *cu);
-+
\f
/* Various complaints about symbol reading that don't abort the process. */
-@@ -14201,29 +14210,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -14201,29 +14207,92 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct type *type, *range_type, *index_type, *char_type;
struct attribute *attr;
@@ -348,7 +322,6 @@ index 276d2f1..f5b35d7 100644
+ data attribute, to reflect DWARF specialities to get address
+ sizes. */
+ const gdb_byte append_ops[] = {
-+ DW_OP_push_object_address,
+ /* DW_OP_deref_size: size of an address on the target machine
+ (bytes), where the size will be specified by the next
+ operand. */
@@ -368,7 +341,10 @@ index 276d2f1..f5b35d7 100644
+ is the address size of the target machine. */
+ else
+ {
-+ if (!attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0))
++ const gdb_byte append_ops[] = { DW_OP_deref };
++
++ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops,
++ ARRAY_SIZE (append_ops)))
+ complaint (&symfile_complaints,
+ _("Could not parse DW_AT_string_length"));
+ }
@@ -406,31 +382,10 @@ index 276d2f1..f5b35d7 100644
char_type = language_string_char_type (cu->language_defn, gdbarch);
type = create_string_type (NULL, char_type, range_type);
-@@ -14540,13 +14610,36 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -14540,13 +14609,15 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
return set_die_type (die, type, cu);
}
-+/* Add post processing op-codes to a dwarf2_property_baton. */
-+
-+static void add_post_values_to_baton (struct dwarf2_property_baton *baton,
-+ const gdb_byte *data, int size, struct dwarf2_cu *cu)
-+{
-+ if (data != NULL && size > 0)
-+ {
-+ struct obstack *obstack = &cu->objfile->objfile_obstack;
-+ gdb_byte *post_data;
-+
-+ post_data = obstack_alloc (obstack, size);
-+ memcpy(post_data, data, size);
-+ baton->post_values.data = post_data;
-+ baton->post_values.size = size;
-+ baton->post_values.per_cu = cu->per_cu;
-+ } else {
-+ baton->post_values.data = NULL;
-+ baton->post_values.size = 0;
-+ baton->post_values.per_cu = NULL;
-+ }
-+}
+
/* Parse dwarf attribute if it's a block, reference or constant and put the
resulting value of the attribute into struct bound_prop.
@@ -444,37 +399,66 @@ index 276d2f1..f5b35d7 100644
{
struct dwarf2_property_baton *baton;
struct obstack *obstack = &cu->objfile->objfile_obstack;
-@@ -14559,8 +14652,10 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
+@@ -14559,8 +14630,25 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
baton = obstack_alloc (obstack, sizeof (*baton));
baton->referenced_type = NULL;
baton->locexpr.per_cu = cu->per_cu;
- baton->locexpr.size = DW_BLOCK (attr)->size;
- baton->locexpr.data = DW_BLOCK (attr)->data;
-+ baton->locexpr.size = DW_BLOCK (attr)->size;
-+ add_post_values_to_baton (baton, additional_data,
-+ additional_data_size, cu);
+- baton->locexpr.data = DW_BLOCK (attr)->data;
++
++ if (additional_data != NULL && additional_data_size > 0)
++ {
++ gdb_byte *data;
++
++ data = obstack_alloc (&cu->objfile->objfile_obstack,
++ DW_BLOCK (attr)->size + additional_data_size);
++ memcpy (data, DW_BLOCK (attr)->data, DW_BLOCK (attr)->size);
++ memcpy (data + DW_BLOCK (attr)->size,
++ additional_data, additional_data_size);
++
++ baton->locexpr.data = data;
++ baton->locexpr.size = DW_BLOCK (attr)->size + additional_data_size;
++ }
++ else
++ {
++ baton->locexpr.data = DW_BLOCK (attr)->data;
++ baton->locexpr.size = DW_BLOCK (attr)->size;
++ }
prop->data.baton = baton;
prop->kind = PROP_LOCEXPR;
gdb_assert (prop->data.baton != NULL);
-@@ -14581,6 +14676,8 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
+@@ -14590,8 +14678,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
baton = obstack_alloc (obstack, sizeof (*baton));
baton->referenced_type = die_type (target_die, target_cu);
- fill_in_loclist_baton (cu, &baton->loclist, target_attr);
-+ add_post_values_to_baton (baton, additional_data,
-+ additional_data_size, cu);
- prop->data.baton = baton;
- prop->kind = PROP_LOCLIST;
- gdb_assert (prop->data.baton != NULL);
-@@ -14592,6 +14689,8 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
baton->locexpr.per_cu = cu->per_cu;
- baton->locexpr.size = DW_BLOCK (target_attr)->size;
- baton->locexpr.data = DW_BLOCK (target_attr)->data;
-+ add_post_values_to_baton (baton, additional_data,
-+ additional_data_size, cu);
+- baton->locexpr.size = DW_BLOCK (target_attr)->size;
+- baton->locexpr.data = DW_BLOCK (target_attr)->data;
++
++ if (additional_data != NULL && additional_data_size > 0)
++ {
++ gdb_byte *data;
++
++ data = obstack_alloc (&cu->objfile->objfile_obstack,
++ DW_BLOCK (target_attr)->size + additional_data_size);
++ memcpy (data, DW_BLOCK (target_attr)->data,
++ DW_BLOCK (target_attr)->size);
++ memcpy (data + DW_BLOCK (target_attr)->size,
++ additional_data, additional_data_size);
++
++ baton->locexpr.data = data;
++ baton->locexpr.size = (DW_BLOCK (target_attr)->size
++ + additional_data_size);
++ }
++ else
++ {
++ baton->locexpr.data = DW_BLOCK (target_attr)->data;
++ baton->locexpr.size = DW_BLOCK (target_attr)->size;
++ }
++
prop->data.baton = baton;
prop->kind = PROP_LOCEXPR;
gdb_assert (prop->data.baton != NULL);
-@@ -14626,7 +14725,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -14626,7 +14734,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
struct type *base_type, *orig_base_type;
struct type *range_type;
struct attribute *attr;
@@ -483,7 +467,7 @@ index 276d2f1..f5b35d7 100644
int low_default_is_valid;
int high_bound_is_count = 0;
const char *name;
-@@ -14646,7 +14745,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -14646,7 +14754,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
low.kind = PROP_CONST;
high.kind = PROP_CONST;
@@ -493,7 +477,7 @@ index 276d2f1..f5b35d7 100644
/* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow
omitting DW_AT_lower_bound. */
-@@ -14679,19 +14780,26 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -14679,19 +14789,26 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
break;
}
@@ -523,7 +507,7 @@ index 276d2f1..f5b35d7 100644
{
/* If bounds are constant do the final calculation here. */
if (low.kind == PROP_CONST && high.kind == PROP_CONST)
-@@ -14755,7 +14863,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -14755,7 +14872,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
&& !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask))
high.data.const_val |= negative_mask;
@@ -532,7 +516,7 @@ index 276d2f1..f5b35d7 100644
if (high_bound_is_count)
TYPE_RANGE_DATA (range_type)->flag_upper_bound_is_count = 1;
-@@ -21673,6 +21781,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+@@ -21673,6 +21790,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
{
struct dwarf2_per_cu_offset_and_type **slot, ofs;
struct objfile *objfile = cu->objfile;
@@ -541,7 +525,7 @@ index 276d2f1..f5b35d7 100644
/* For Ada types, make sure that the gnat-specific data is always
initialized (if not already set). There are a few types where
-@@ -21687,6 +21797,43 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+@@ -21687,6 +21806,43 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
&& !HAVE_GNAT_AUX_INFO (type))
INIT_GNAT_SPECIFIC (type);
@@ -864,7 +848,7 @@ index 408c8cc..38f32e0 100644
fputs_filtered (", ", stream);
}
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
-index d0c002f..3f52d61 100644
+index e99a2f3..53cae2c 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -805,7 +805,8 @@ allocate_stub_method (struct type *type)
@@ -934,9 +918,9 @@ index d0c002f..3f52d61 100644
else if (bit_stride > 0)
TYPE_LENGTH (result_type) =
(bit_stride * (high_bound - low_bound + 1) + 7) / 8;
-@@ -1616,11 +1628,30 @@ stub_noname_complaint (void)
- int
- is_dynamic_type (struct type *type)
+@@ -1616,12 +1628,31 @@ stub_noname_complaint (void)
+ static int
+ is_dynamic_type_internal (struct type *type, int top_level)
{
+ int index;
+
@@ -945,7 +929,8 @@ index d0c002f..3f52d61 100644
+
type = check_typedef (type);
- if (TYPE_CODE (type) == TYPE_CODE_REF)
+ /* We only want to recognize references at the outermost level. */
+ if (top_level && TYPE_CODE (type) == TYPE_CODE_REF)
type = check_typedef (TYPE_TARGET_TYPE (type));
+ if (TYPE_ASSOCIATED_PROP (type))
@@ -965,7 +950,7 @@ index d0c002f..3f52d61 100644
switch (TYPE_CODE (type))
{
case TYPE_CODE_RANGE:
-@@ -1630,11 +1661,19 @@ is_dynamic_type (struct type *type)
+@@ -1631,11 +1662,19 @@ is_dynamic_type_internal (struct type *type, int top_level)
{
gdb_assert (TYPE_NFIELDS (type) == 1);
@@ -975,21 +960,21 @@ index d0c002f..3f52d61 100644
+ - the bounds are dynamic,
+ - the elements it contains have a dynamic contents
+ - a data_locaton attribute was found. */
- if (is_dynamic_type (TYPE_INDEX_TYPE (type)))
+ if (is_dynamic_type_internal (TYPE_INDEX_TYPE (type), 0))
return 1;
-- return is_dynamic_type (TYPE_TARGET_TYPE (type));
+- return is_dynamic_type_internal (TYPE_TARGET_TYPE (type), 0);
+ else if (TYPE_DATA_LOCATION (type) != NULL
+ && (TYPE_DATA_LOCATION_KIND (type) == PROP_LOCEXPR
+ || TYPE_DATA_LOCATION_KIND (type) == PROP_LOCLIST))
+ return 1;
+ else
-+ return is_dynamic_type (TYPE_TARGET_TYPE (type));
++ return is_dynamic_type_internal (TYPE_TARGET_TYPE (type), 0);
+ break;
}
case TYPE_CODE_STRUCT:
-@@ -1647,28 +1686,40 @@ is_dynamic_type (struct type *type)
- && is_dynamic_type (TYPE_FIELD_TYPE (type, i)))
+@@ -1648,6 +1687,17 @@ is_dynamic_type_internal (struct type *type, int top_level)
+ && is_dynamic_type_internal (TYPE_FIELD_TYPE (type, i), 0))
return 1;
}
+ case TYPE_CODE_PTR:
@@ -1006,8 +991,9 @@ index d0c002f..3f52d61 100644
break;
}
- return 0;
- }
+@@ -1666,22 +1716,23 @@ static struct type *resolve_dynamic_type_internal (struct type *type,
+ CORE_ADDR addr,
+ int top_level);
-/* Given a dynamic range type (dyn_range_type), return a static version
- of that type. */
@@ -1034,7 +1020,7 @@ index d0c002f..3f52d61 100644
{
low_bound.kind = PROP_CONST;
low_bound.data.const_val = value;
-@@ -1680,7 +1731,7 @@ resolve_dynamic_range (struct type *dyn_range_type)
+@@ -1693,7 +1744,7 @@ resolve_dynamic_range (struct type *dyn_range_type)
}
prop = &TYPE_RANGE_DATA (dyn_range_type)->high;
@@ -1043,7 +1029,7 @@ index d0c002f..3f52d61 100644
{
high_bound.kind = PROP_CONST;
high_bound.data.const_val = value;
-@@ -1694,10 +1745,17 @@ resolve_dynamic_range (struct type *dyn_range_type)
+@@ -1707,10 +1758,17 @@ resolve_dynamic_range (struct type *dyn_range_type)
high_bound.kind = PROP_UNDEFINED;
high_bound.data.const_val = 0;
}
@@ -1064,7 +1050,7 @@ index d0c002f..3f52d61 100644
TYPE_RANGE_DATA (static_range_type)->flag_bound_evaluated = 1;
return static_range_type;
}
-@@ -1707,29 +1765,52 @@ resolve_dynamic_range (struct type *dyn_range_type)
+@@ -1720,29 +1778,52 @@ resolve_dynamic_range (struct type *dyn_range_type)
of the associated array. */
static struct type *
@@ -1125,24 +1111,16 @@ index d0c002f..3f52d61 100644
}
/* Resolve dynamic bounds of members of the union TYPE to static
-@@ -1823,6 +1904,7 @@ resolve_dynamic_struct (struct type *type, CORE_ADDR addr)
- return resolved_type;
- }
-
-+
- /* See gdbtypes.h */
-
- struct type *
-@@ -1830,6 +1912,8 @@ resolve_dynamic_type (struct type *type, CORE_ADDR addr)
+@@ -1846,6 +1927,8 @@ resolve_dynamic_type_internal (struct type *type, CORE_ADDR addr,
{
struct type *real_type = check_typedef (type);
struct type *resolved_type = type;
+ const struct dynamic_prop *prop;
+ CORE_ADDR value;
- if (!is_dynamic_type (real_type))
+ if (!is_dynamic_type_internal (real_type, top_level))
return type;
-@@ -1853,11 +1937,12 @@ resolve_dynamic_type (struct type *type, CORE_ADDR addr)
+@@ -1871,11 +1954,12 @@ resolve_dynamic_type_internal (struct type *type, CORE_ADDR addr,
}
case TYPE_CODE_ARRAY:
@@ -1157,7 +1135,7 @@ index d0c002f..3f52d61 100644
break;
case TYPE_CODE_UNION:
-@@ -1869,6 +1954,25 @@ resolve_dynamic_type (struct type *type, CORE_ADDR addr)
+@@ -1887,6 +1971,25 @@ resolve_dynamic_type_internal (struct type *type, CORE_ADDR addr,
break;
}
@@ -1183,7 +1161,7 @@ index d0c002f..3f52d61 100644
return resolved_type;
}
-@@ -4078,6 +4182,27 @@ copy_type_recursive (struct objfile *objfile,
+@@ -4104,6 +4207,27 @@ copy_type_recursive (struct objfile *objfile,
*TYPE_RANGE_DATA (new_type) = *TYPE_RANGE_DATA (type);
}
@@ -1211,7 +1189,7 @@ index d0c002f..3f52d61 100644
/* Copy pointers to other types. */
if (TYPE_TARGET_TYPE (type))
TYPE_TARGET_TYPE (new_type) =
-@@ -4124,6 +4249,44 @@ copy_type (const struct type *type)
+@@ -4150,6 +4274,44 @@ copy_type (const struct type *type)
memcpy (TYPE_MAIN_TYPE (new_type), TYPE_MAIN_TYPE (type),
sizeof (struct main_type));
@@ -1257,10 +1235,10 @@ index d0c002f..3f52d61 100644
}
\f
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
-index bb6352d..5818f79 100644
+index 5008ef4..436edf8 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
-@@ -670,6 +670,10 @@ struct main_type
+@@ -669,6 +669,10 @@ struct main_type
struct dynamic_prop high;
@@ -1271,7 +1249,7 @@ index bb6352d..5818f79 100644
/* True if HIGH range bound contains the number of elements in the
subrange. This affects how the final hight bound is computed. */
-@@ -725,6 +729,23 @@ struct main_type
+@@ -724,6 +728,23 @@ struct main_type
struct func_type *func_stuff;
} type_specific;
@@ -1295,7 +1273,7 @@ index bb6352d..5818f79 100644
};
/* * A ``struct type'' describes a particular instance of a type, with
-@@ -1203,6 +1224,39 @@ extern void allocate_gnat_aux_type (struct type *);
+@@ -1202,6 +1223,39 @@ extern void allocate_gnat_aux_type (struct type *);
TYPE_RANGE_DATA(range_type)->high.kind
#define TYPE_LOW_BOUND_KIND(range_type) \
TYPE_RANGE_DATA(range_type)->low.kind
@@ -1335,7 +1313,7 @@ index bb6352d..5818f79 100644
/* Moto-specific stuff for FORTRAN arrays. */
-@@ -1210,6 +1264,9 @@ extern void allocate_gnat_aux_type (struct type *);
+@@ -1209,6 +1263,9 @@ extern void allocate_gnat_aux_type (struct type *);
TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
#define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
@@ -1345,7 +1323,7 @@ index bb6352d..5818f79 100644
#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
(TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
-@@ -1678,6 +1735,7 @@ extern struct type *create_array_type_with_stride
+@@ -1677,6 +1734,7 @@ extern struct type *create_array_type_with_stride
extern struct type *create_range_type (struct type *, struct type *,
const struct dynamic_prop *,
@@ -2030,10 +2008,10 @@ index 0000000..6053c17
+gdb_test "print sizeof(pvla)" " = 4000" "print sizeof associated pvla"
diff --git a/gdb/testsuite/gdb.fortran/vla-stride.exp b/gdb/testsuite/gdb.fortran/vla-stride.exp
new file mode 100644
-index 0000000..e791115
+index 0000000..35f585d
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/vla-stride.exp
-@@ -0,0 +1,51 @@
+@@ -0,0 +1,44 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
@@ -2061,13 +2039,6 @@ index 0000000..e791115
+ continue
+}
+
-+gdb_breakpoint [gdb_get_line_number "reverse-elements"]
-+gdb_continue_to_breakpoint "reverse-elements"
-+gdb_test "print pvla" " = \\\(10, 9, 8, 7, 6, 5, 4, 3, 2, 1\\\)" \
-+ "print reverse-elements"
-+gdb_test "print pvla(1)" " = 10" "print first reverse-element"
-+gdb_test "print pvla(10)" " = 1" "print last reverse-element"
-+
+gdb_breakpoint [gdb_get_line_number "re-reverse-elements"]
+gdb_continue_to_breakpoint "re-reverse-elements"
+gdb_test "print pvla" " = \\\(1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\\)" \
@@ -2087,7 +2058,7 @@ index 0000000..e791115
+gdb_test "print pvla(1)" " = 5" "print one single-element"
diff --git a/gdb/testsuite/gdb.fortran/vla-stride.f90 b/gdb/testsuite/gdb.fortran/vla-stride.f90
new file mode 100644
-index 0000000..1f8cc55
+index 0000000..6aa4f2b
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/vla-stride.f90
@@ -0,0 +1,30 @@
@@ -2115,7 +2086,7 @@ index 0000000..1f8cc55
+ vla = (/ (I, I = 1,10) /)
+
+ pvla => vla(10:1:-1)
-+ pvla => pvla(10:1:-1) ! reverse-elements
++ pvla => pvla(10:1:-1)
+ pvla => vla(1:10:2) ! re-reverse-elements
+ pvla => vla(5:4:-2) ! odd-elements
+
@@ -3157,7 +3128,7 @@ index 6698247..7a415cf 100644
+
#endif
diff --git a/gdb/value.c b/gdb/value.c
-index 557056f..4e91a43 100644
+index 29abe5f..5efea89 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -43,6 +43,7 @@
@@ -3168,7 +3139,7 @@ index 557056f..4e91a43 100644
/* Prototypes for exported functions. */
-@@ -1646,6 +1647,25 @@ set_value_component_location (struct value *component,
+@@ -1627,6 +1628,25 @@ set_value_component_location (struct value *component,
if (funcs->copy_closure)
component->location.computed.closure = funcs->copy_closure (whole);
}
@@ -3194,7 +3165,7 @@ index 557056f..4e91a43 100644
}
\f
-@@ -2950,13 +2970,22 @@ value_primitive_field (struct value *arg1, int offset,
+@@ -2931,13 +2951,22 @@ value_primitive_field (struct value *arg1, int offset,
v = allocate_value_lazy (type);
else
{
@@ -3223,7 +3194,7 @@ index 557056f..4e91a43 100644
}
set_value_component_location (v, arg1);
VALUE_REGNUM (v) = VALUE_REGNUM (arg1);
-@@ -3539,7 +3568,8 @@ readjust_indirect_value_type (struct value *value, struct type *enc_type,
+@@ -3520,7 +3549,8 @@ readjust_indirect_value_type (struct value *value, struct type *enc_type,
struct value *original_value)
{
/* Re-adjust type. */
@@ -3233,7 +3204,7 @@ index 557056f..4e91a43 100644
/* Add embedding info. */
set_value_enclosing_type (value, enc_type);
-@@ -3556,6 +3586,12 @@ coerce_ref (struct value *arg)
+@@ -3537,6 +3567,12 @@ coerce_ref (struct value *arg)
struct value *retval;
struct type *enc_type;
@@ -3246,7 +3217,7 @@ index 557056f..4e91a43 100644
retval = coerce_ref_if_computed (arg);
if (retval)
return retval;
-@@ -3699,8 +3735,14 @@ value_fetch_lazy (struct value *val)
+@@ -3680,8 +3716,14 @@ value_fetch_lazy (struct value *val)
}
else if (VALUE_LVAL (val) == lval_memory)
{
diff --git a/gdb.spec b/gdb.spec
index 78e6b92..75b9417 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -18,14 +18,14 @@ Summary: A GNU source-level debugger for C, C++, Fortran, Go and other languages
Name: %{?scl_prefix}gdb
# Freeze it when GDB gets branched
-%global snapsrc 20140711
+%global snapsrc 20140721
# See timestamp of source gnulib installed into gdb/gnulib/ .
%global snapgnulib 20121213
-Version: 7.7.90.%{snapsrc}
+Version: 7.7.91.%{snapsrc}
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
-Release: 11%{?dist}
+Release: 12%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL
Group: Development/Debuggers
@@ -516,12 +516,17 @@ Patch914: gdb-readline-6.3.5.patch
Patch918: gdb-btrobust.patch
# Fix crash on optimized-out entry data values (BZ 1111910).
-Patch919: gdb-entrydataoptimizedout.patch
+Patch922: gdb-entryval-crash-1of3.patch
+Patch923: gdb-entryval-crash-2of3.patch
+Patch919: gdb-entryval-crash-3of3.patch
# Python completion w/overriden completer (Sergio Durigan Junior, BZ 1075199).
Patch920: gdb-python-completer-1of2.patch
Patch921: gdb-python-completer-2of2.patch
+# [testsuite] Fix paginate-*.exp race for "read1".
+Patch924: gdb-testsuite-pagination-read1.patch
+
%if 0%{!?rhel:1} || 0%{?rhel} > 6
# RL_STATE_FEDORA_GDB would not be found for:
# Patch642: gdb-readline62-ask-more-rh.patch
@@ -798,9 +803,12 @@ find -name "*.info*"|xargs rm -f
%patch887 -p1
%patch914 -p1
%patch918 -p1
-%patch919 -p1
%patch920 -p1
%patch921 -p1
+%patch922 -p1
+%patch923 -p1
+%patch919 -p1
+%patch924 -p1
%patch848 -p1
%if 0%{!?el6:1}
@@ -1291,6 +1299,12 @@ then
fi
%changelog
+* Tue Jul 22 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.7.91.20140721-12.fc21
+- Rebase to FSF GDB 7.7.91.20140721 (pre-7.8 snapshot).
+- Rebase the Intel VLA patchset.
+- New fix of the optimized-out entry data values crash (BZ 1111910).
+- [testsuite] Fix paginate-*.exp race for "read1".
+
* Fri Jul 11 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.7.90.20140711-11.fc21
- Fix regression#2 of the optimized-out entry data values fix (of BZ 1111910).
- Rebase to FSF GDB 7.7.90.20140711 (pre-7.8 snapshot).
diff --git a/sources b/sources
index bb941c1..024c845 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
4981307aa9619bbec5b73261e4e41c8d gdb-libstdc++-v3-python-r155978.tar.bz2
-6912a3a243a66a5fa04dc38aad3e8e80 gdb-7.7.90.20140711.tar.bz2
+e482a840e0bf8e928268c72cb2241646 gdb-7.7.91.20140721.tar.bz2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-27 23:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-27 23:56 [rpms/gdb] gdb-17.2-rebase-f44: Rebase to FSF GDB 7.7.91.20140721 (pre-7.8 snapshot) Jan Kratochvil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox