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/dwarf2loc.c b/gdb/dwarf2loc.c
36 #include <unordered_set>
37 +#include <functional>
38 #include "common/underlying.h"
39 #include "common/byte-vector.h"
41 @@ -2348,6 +2349,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
45 +frame_id old_frame_id (get_frame_id (deprecated_safe_get_selected_frame ()));
48 + const std::function<void ()> func;
50 + RestoreCall(std::function<void ()> func_):func(func_) {}
51 + ~RestoreCall() { func(); }
52 +} restore_frame([=]() {
53 + frame_info *old_frame (frame_find_by_id (old_frame_id));
54 + if (old_frame != NULL)
55 + select_frame (old_frame);
57 +if (frame != NULL) select_frame (frame);
59 scoped_value_mark free_values;
61 ctx.gdbarch = get_objfile_arch (objfile);
62 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
65 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
67 +! Copyright 2010 Free Software Foundation, Inc.
69 +! This program is free software; you can redistribute it and/or modify
70 +! it under the terms of the GNU General Public License as published by
71 +! the Free Software Foundation; either version 2 of the License, or
72 +! (at your option) any later version.
74 +! This program is distributed in the hope that it will be useful,
75 +! but WITHOUT ANY WARRANTY; without even the implied warranty of
76 +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
77 +! GNU General Public License for more details.
79 +! You should have received a copy of the GNU General Public License
80 +! along with this program; if not, write to the Free Software
81 +! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
83 +! Ihis file is the Fortran source file for dynamic.exp.
84 +! Original file written by Jakub Jelinek <jakub@redhat.com>.
85 +! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
91 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
94 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
96 +# Copyright 2010 Free Software Foundation, Inc.
98 +# This program is free software; you can redistribute it and/or modify
99 +# it under the terms of the GNU General Public License as published by
100 +# the Free Software Foundation; either version 2 of the License, or
101 +# (at your option) any later version.
103 +# This program is distributed in the hope that it will be useful,
104 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
105 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
106 +# GNU General Public License for more details.
108 +# You should have received a copy of the GNU General Public License
109 +# along with this program; if not, write to the Free Software
110 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
112 +set testfile "dynamic-other-frame"
113 +set srcfile1 ${testfile}.f90
114 +set srcfile2 ${testfile}-stub.f90
115 +set objfile2 [standard_output_file ${testfile}-stub.o]
116 +set executable ${testfile}
117 +set binfile [standard_output_file ${executable}]
119 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != ""
120 + || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } {
121 + untested "Couldn't compile ${srcfile1} or ${srcfile2}"
125 +clean_restart ${executable}
127 +gdb_test_no_output "set print frame-arguments all"
129 +if ![runto bar_] then {
130 + perror "couldn't run to bar_"
134 +gdb_test "bt" {foo \(string='hello'.*}
135 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
138 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
140 +! Copyright 2010 Free Software Foundation, Inc.
142 +! This program is free software; you can redistribute it and/or modify
143 +! it under the terms of the GNU General Public License as published by
144 +! the Free Software Foundation; either version 2 of the License, or
145 +! (at your option) any later version.
147 +! This program is distributed in the hope that it will be useful,
148 +! but WITHOUT ANY WARRANTY; without even the implied warranty of
149 +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
150 +! GNU General Public License for more details.
152 +! You should have received a copy of the GNU General Public License
153 +! along with this program; if not, write to the Free Software
154 +! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
156 +! Ihis file is the Fortran source file for dynamic.exp.
157 +! Original file written by Jakub Jelinek <jakub@redhat.com>.
158 +! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
160 +subroutine foo (string)
165 + character string*(*)
166 + call bar ! stop-here
170 + subroutine foo (string)
171 + character string*(*)