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 Index: gdb-7.9.50.20150520/gdb/gdbtypes.c
35 ===================================================================
36 --- gdb-7.9.50.20150520.orig/gdb/gdbtypes.c 2015-05-31 16:14:04.164533833 +0200
37 +++ gdb-7.9.50.20150520/gdb/gdbtypes.c 2015-05-31 16:14:05.844545344 +0200
38 @@ -1851,6 +1851,7 @@ is_dynamic_type_internal (struct type *t
42 + case TYPE_CODE_STRING:
44 gdb_assert (TYPE_NFIELDS (type) == 1);
46 @@ -2192,6 +2193,7 @@ resolve_dynamic_type_internal (struct ty
50 + case TYPE_CODE_STRING:
51 resolved_type = resolve_dynamic_array (type, addr_stack);
54 Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
55 ===================================================================
56 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
57 +++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 2015-05-31 16:14:05.844545344 +0200
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 Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
84 ===================================================================
85 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
86 +++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp 2015-05-31 16:14:05.845545351 +0200
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 Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
128 ===================================================================
129 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
130 +++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 2015-05-31 16:14:05.845545351 +0200
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*(*)