]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-vla-intel-stringbt-fix.patch
f6197f25cc81f24715bbc9df5941c796274fc809
[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 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
39        }
40  
41      case TYPE_CODE_ARRAY:
42 +    case TYPE_CODE_STRING:
43        {
44         gdb_assert (TYPE_NFIELDS (type) == 1);
45  
46 @@ -2192,6 +2193,7 @@ resolve_dynamic_type_internal (struct ty
47           }
48  
49         case TYPE_CODE_ARRAY:
50 +       case TYPE_CODE_STRING:
51           resolved_type = resolve_dynamic_array (type, addr_stack);
52           break;
53  
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
58 @@ -0,0 +1,24 @@
59 +! Copyright 2010 Free Software Foundation, Inc.
60 +!
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.
65 +!
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.
70 +!
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.
74 +!
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>.
78 +
79 +subroutine bar
80 +  real :: dummy
81 +  dummy = 1
82 +end subroutine bar
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
87 @@ -0,0 +1,39 @@
88 +# Copyright 2010 Free Software Foundation, Inc.
89 +
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.
94 +# 
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.
99 +# 
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.  
103 +
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}]
110 +
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}"
114 +    return -1
115 +}
116 +
117 +clean_restart ${executable}
118 +
119 +gdb_test_no_output "set print frame-arguments all"
120 +
121 +if ![runto bar_] then {
122 +    perror "couldn't run to bar_"
123 +    continue
124 +}
125 +
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
131 @@ -0,0 +1,36 @@
132 +! Copyright 2010 Free Software Foundation, Inc.
133 +!
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.
138 +!
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.
143 +!
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.
147 +!
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>.
151 +
152 +subroutine foo (string)
153 +  interface
154 +    subroutine bar
155 +    end subroutine
156 +  end interface
157 +  character string*(*)
158 +  call bar                                ! stop-here
159 +end subroutine foo
160 +program test
161 +  interface
162 +    subroutine foo (string)
163 +    character string*(*)
164 +    end subroutine
165 +  end interface
166 +  call foo ('hello')
167 +end
This page took 0.037035 seconds and 2 git commands to generate.