]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-vla-intel-stringbt-fix.patch
- add support for Fortran dynamics arrays; copied from Fedora (263b580)
[packages/gdb.git] / gdb-vla-intel-stringbt-fix.patch
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]
3
4
5 --FCuugMFkClbJLl1L
6 Content-Type: text/plain; charset=us-ascii
7 Content-Disposition: inline
8
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.
13
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
16
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
22
23 The fix below has no regressions for me.  Unfortunately I do not see why you
24 cannot reproduce it.
25
26
27 Thanks,
28 Jan
29
30 --FCuugMFkClbJLl1L
31 Content-Type: text/plain; charset=us-ascii
32 Content-Disposition: inline; filename="vlastringonly.patch"
33
34 diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
35 index 53cae2c..cf7ac26 100644
36 --- a/gdb/gdbtypes.c
37 +++ b/gdb/gdbtypes.c
38 @@ -1659,6 +1659,7 @@ is_dynamic_type_internal (struct type *type, int top_level)
39        return !has_static_range (TYPE_RANGE_DATA (type));
40  
41      case TYPE_CODE_ARRAY:
42 +    case TYPE_CODE_STRING:
43        {
44         gdb_assert (TYPE_NFIELDS (type) == 1);
45  
46 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
47 new file mode 100644
48 index 0000000..261ce17
49 --- /dev/null
50 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
51 @@ -0,0 +1,24 @@
52 +! Copyright 2010 Free Software Foundation, Inc.
53 +!
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.
58 +!
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.
63 +!
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.
67 +!
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>.
71 +
72 +subroutine bar
73 +  real :: dummy
74 +  dummy = 1
75 +end subroutine bar
76 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
77 new file mode 100644
78 index 0000000..570a28c
79 --- /dev/null
80 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
81 @@ -0,0 +1,39 @@
82 +# Copyright 2010 Free Software Foundation, Inc.
83 +
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.
88 +# 
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.
93 +# 
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.  
97 +
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}]
104 +
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}"
108 +    return -1
109 +}
110 +
111 +clean_restart ${executable}
112 +
113 +gdb_test_no_output "set print frame-arguments all"
114 +
115 +if ![runto bar_] then {
116 +    perror "couldn't run to bar_"
117 +    continue
118 +}
119 +
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
122 new file mode 100644
123 index 0000000..2bc637d
124 --- /dev/null
125 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
126 @@ -0,0 +1,36 @@
127 +! Copyright 2010 Free Software Foundation, Inc.
128 +!
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.
133 +!
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.
138 +!
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.
142 +!
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>.
146 +
147 +subroutine foo (string)
148 +  interface
149 +    subroutine bar
150 +    end subroutine
151 +  end interface
152 +  character string*(*)
153 +  call bar                                ! stop-here
154 +end subroutine foo
155 +program test
156 +  interface
157 +    subroutine foo (string)
158 +    character string*(*)
159 +    end subroutine
160 +  end interface
161 +  call foo ('hello')
162 +end
163
164 --FCuugMFkClbJLl1L--
165
This page took 0.066125 seconds and 4 git commands to generate.