1 From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
2 From: Jan Kratochvil <jan.kratochvil@redhat.com>
3 Date: Fri, 1 Aug 2014 23:02:17 +0200
4 Subject: gdb-vla-intel-stringbt-fix.patch
8 http://sourceware.org/ml/gdb-patches/2014-08/msg00025.html
10 On Fri, 01 Aug 2014 09:20:19 +0200, Keven Boell wrote:
11 > I just tried it on Fedora 20 i686. Applied the patch, you mentioned, on top of
12 > the Fortran VLA series and executed your dynamic-other-frame test. Everything
13 > is working fine here, I cannot reproduce the crash.
15 I have it reproducible on Fedora 20 i686 with plain
16 CFLAGS=-g ./configure;make;cd gdb/testsuite;make site.exp;runtest gdb.fortran/dynamic-other-frame.exp
18 Besides that I have updated the testcase with
19 gdb_test_no_output "set print frame-arguments all"
20 so that there is no longer needed the patch:
21 [patch] Display Fortran strings in backtraces
22 https://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
24 The fix below has no regressions for me. Unfortunately I do not see why you
30 diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
31 --- a/gdb/dwarf2/loc.c
32 +++ b/gdb/dwarf2/loc.c
33 @@ -2249,6 +2249,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
37 +frame_id old_frame_id (get_frame_id (deprecated_safe_get_selected_frame ()));
40 + const std::function<void ()> func;
42 + RestoreCall(std::function<void ()> func_):func(func_) {}
43 + ~RestoreCall() { func(); }
44 +} restore_frame([=]() {
45 + frame_info *old_frame (frame_find_by_id (old_frame_id));
46 + if (old_frame != NULL)
47 + select_frame (old_frame);
49 +if (frame != NULL) select_frame (frame);
51 scoped_value_mark free_values;
53 ctx.gdbarch = per_objfile->objfile->arch ();
54 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
57 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
59 +! Copyright 2010 Free Software Foundation, Inc.
61 +! This program is free software; you can redistribute it and/or modify
62 +! it under the terms of the GNU General Public License as published by
63 +! the Free Software Foundation; either version 2 of the License, or
64 +! (at your option) any later version.
66 +! This program is distributed in the hope that it will be useful,
67 +! but WITHOUT ANY WARRANTY; without even the implied warranty of
68 +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
69 +! GNU General Public License for more details.
71 +! You should have received a copy of the GNU General Public License
72 +! along with this program; if not, write to the Free Software
73 +! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
75 +! Ihis file is the Fortran source file for dynamic.exp.
76 +! Original file written by Jakub Jelinek <jakub@redhat.com>.
77 +! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
83 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
86 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
88 +# Copyright 2010 Free Software Foundation, Inc.
90 +# This program is free software; you can redistribute it and/or modify
91 +# it under the terms of the GNU General Public License as published by
92 +# the Free Software Foundation; either version 2 of the License, or
93 +# (at your option) any later version.
95 +# This program is distributed in the hope that it will be useful,
96 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
97 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
98 +# GNU General Public License for more details.
100 +# You should have received a copy of the GNU General Public License
101 +# along with this program; if not, write to the Free Software
102 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
104 +set testfile "dynamic-other-frame"
105 +set srcfile1 ${testfile}.f90
106 +set srcfile2 ${testfile}-stub.f90
107 +set objfile2 [standard_output_file ${testfile}-stub.o]
108 +set executable ${testfile}
109 +set binfile [standard_output_file ${executable}]
111 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != ""
112 + || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } {
113 + untested "Couldn't compile ${srcfile1} or ${srcfile2}"
117 +clean_restart ${executable}
119 +gdb_test_no_output "set print frame-arguments all"
121 +if ![runto bar_] then {
122 + perror "couldn't run to bar_"
126 +gdb_test "bt" {foo \(string='hello'.*}
127 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
130 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
132 +! Copyright 2010 Free Software Foundation, Inc.
134 +! This program is free software; you can redistribute it and/or modify
135 +! it under the terms of the GNU General Public License as published by
136 +! the Free Software Foundation; either version 2 of the License, or
137 +! (at your option) any later version.
139 +! This program is distributed in the hope that it will be useful,
140 +! but WITHOUT ANY WARRANTY; without even the implied warranty of
141 +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
142 +! GNU General Public License for more details.
144 +! You should have received a copy of the GNU General Public License
145 +! along with this program; if not, write to the Free Software
146 +! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
148 +! Ihis file is the Fortran source file for dynamic.exp.
149 +! Original file written by Jakub Jelinek <jakub@redhat.com>.
150 +! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
152 +subroutine foo (string)
157 + character string*(*)
158 + call bar ! stop-here
162 + subroutine foo (string)
163 + character string*(*)