1 http://sourceware.org/ml/gdb-patches/2014-08/msg00025.html
2 Subject: [patch 1/2] Re: Crash regression(?) printing Fortran strings in bt [Re: [V2 00/23] Fortran dynamic array support]
6 Content-Type: text/plain; charset=us-ascii
7 Content-Disposition: inline
9 On Fri, 01 Aug 2014 09:20:19 +0200, Keven Boell wrote:
10 > I just tried it on Fedora 20 i686. Applied the patch, you mentioned, on top of
11 > the Fortran VLA series and executed your dynamic-other-frame test. Everything
12 > is working fine here, I cannot reproduce the crash.
14 I have it reproducible on Fedora 20 i686 with plain
15 CFLAGS=-g ./configure;make;cd gdb/testsuite;make site.exp;runtest gdb.fortran/dynamic-other-frame.exp
17 Besides that I have updated the testcase with
18 gdb_test_no_output "set print frame-arguments all"
19 so that there is no longer needed the patch:
20 [patch] Display Fortran strings in backtraces
21 https://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
23 The fix below has no regressions for me. Unfortunately I do not see why you
31 Content-Type: text/plain; charset=us-ascii
32 Content-Disposition: inline; filename="vlastringonly.patch"
34 diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
35 index 53cae2c..cf7ac26 100644
38 @@ -1659,6 +1659,7 @@ is_dynamic_type_internal (struct type *type, int top_level)
39 return !has_static_range (TYPE_RANGE_DATA (type));
42 + case TYPE_CODE_STRING:
44 gdb_assert (TYPE_NFIELDS (type) == 1);
46 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
48 index 0000000..261ce17
50 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
52 +! Copyright 2010 Free Software Foundation, Inc.
54 +! This program is free software; you can redistribute it and/or modify
55 +! it under the terms of the GNU General Public License as published by
56 +! the Free Software Foundation; either version 2 of the License, or
57 +! (at your option) any later version.
59 +! This program is distributed in the hope that it will be useful,
60 +! but WITHOUT ANY WARRANTY; without even the implied warranty of
61 +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62 +! GNU General Public License for more details.
64 +! You should have received a copy of the GNU General Public License
65 +! along with this program; if not, write to the Free Software
66 +! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
68 +! Ihis file is the Fortran source file for dynamic.exp.
69 +! Original file written by Jakub Jelinek <jakub@redhat.com>.
70 +! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
76 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
78 index 0000000..570a28c
80 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
82 +# Copyright 2010 Free Software Foundation, Inc.
84 +# This program is free software; you can redistribute it and/or modify
85 +# it under the terms of the GNU General Public License as published by
86 +# the Free Software Foundation; either version 2 of the License, or
87 +# (at your option) any later version.
89 +# This program is distributed in the hope that it will be useful,
90 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
91 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
92 +# GNU General Public License for more details.
94 +# You should have received a copy of the GNU General Public License
95 +# along with this program; if not, write to the Free Software
96 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
98 +set testfile "dynamic-other-frame"
99 +set srcfile1 ${testfile}.f90
100 +set srcfile2 ${testfile}-stub.f90
101 +set objfile2 [standard_output_file ${testfile}-stub.o]
102 +set executable ${testfile}
103 +set binfile [standard_output_file ${executable}]
105 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != ""
106 + || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } {
107 + untested "Couldn't compile ${srcfile1} or ${srcfile2}"
111 +clean_restart ${executable}
113 +gdb_test_no_output "set print frame-arguments all"
115 +if ![runto bar_] then {
116 + perror "couldn't run to bar_"
120 +gdb_test "bt" {foo \(string='hello'.*}
121 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
123 index 0000000..2bc637d
125 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
127 +! Copyright 2010 Free Software Foundation, Inc.
129 +! This program is free software; you can redistribute it and/or modify
130 +! it under the terms of the GNU General Public License as published by
131 +! the Free Software Foundation; either version 2 of the License, or
132 +! (at your option) any later version.
134 +! This program is distributed in the hope that it will be useful,
135 +! but WITHOUT ANY WARRANTY; without even the implied warranty of
136 +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
137 +! GNU General Public License for more details.
139 +! You should have received a copy of the GNU General Public License
140 +! along with this program; if not, write to the Free Software
141 +! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
143 +! Ihis file is the Fortran source file for dynamic.exp.
144 +! Original file written by Jakub Jelinek <jakub@redhat.com>.
145 +! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
147 +subroutine foo (string)
152 + character string*(*)
153 + call bar ! stop-here
157 + subroutine foo (string)
158 + character string*(*)