Blame SOURCES/gdb-vla-intel-stringbt-fix.patch

f9426a
http://sourceware.org/ml/gdb-patches/2014-08/msg00025.html
f9426a
Subject: [patch 1/2] Re: Crash regression(?) printing Fortran strings in bt  [Re: [V2 00/23] Fortran dynamic array support]
f9426a
f9426a
f9426a
--FCuugMFkClbJLl1L
f9426a
Content-Type: text/plain; charset=us-ascii
f9426a
Content-Disposition: inline
f9426a
f9426a
On Fri, 01 Aug 2014 09:20:19 +0200, Keven Boell wrote:
f9426a
> I just tried it on Fedora 20 i686.  Applied the patch, you mentioned, on top of
f9426a
> the Fortran VLA series and executed your dynamic-other-frame test.  Everything
f9426a
> is working fine here, I cannot reproduce the crash.
f9426a
f9426a
I have it reproducible on Fedora 20 i686 with plain
f9426a
CFLAGS=-g ./configure;make;cd gdb/testsuite;make site.exp;runtest gdb.fortran/dynamic-other-frame.exp
f9426a
f9426a
Besides that I have updated the testcase with
f9426a
	gdb_test_no_output "set print frame-arguments all"
f9426a
so that there is no longer needed the patch:
f9426a
	[patch] Display Fortran strings in backtraces
f9426a
	https://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
f9426a
f9426a
The fix below has no regressions for me.  Unfortunately I do not see why you
f9426a
cannot reproduce it.
f9426a
f9426a
f9426a
Thanks,
f9426a
Jan
f9426a
f9426a
--FCuugMFkClbJLl1L
f9426a
Content-Type: text/plain; charset=us-ascii
f9426a
Content-Disposition: inline; filename="vlastringonly.patch"
f9426a
f9426a
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
f9426a
index 53cae2c..cf7ac26 100644
f9426a
--- a/gdb/gdbtypes.c
f9426a
+++ b/gdb/gdbtypes.c
f9426a
@@ -1659,6 +1659,7 @@ is_dynamic_type_internal (struct type *type, int top_level)
f9426a
       return !has_static_range (TYPE_RANGE_DATA (type));
f9426a
 
f9426a
     case TYPE_CODE_ARRAY:
f9426a
+    case TYPE_CODE_STRING:
f9426a
       {
f9426a
 	gdb_assert (TYPE_NFIELDS (type) == 1);
f9426a
 
f9426a
diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
f9426a
new file mode 100644
f9426a
index 0000000..261ce17
f9426a
--- /dev/null
f9426a
+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
f9426a
@@ -0,0 +1,24 @@
f9426a
+! Copyright 2010 Free Software Foundation, Inc.
f9426a
+!
f9426a
+! This program is free software; you can redistribute it and/or modify
f9426a
+! it under the terms of the GNU General Public License as published by
f9426a
+! the Free Software Foundation; either version 2 of the License, or
f9426a
+! (at your option) any later version.
f9426a
+!
f9426a
+! This program is distributed in the hope that it will be useful,
f9426a
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+! GNU General Public License for more details.
f9426a
+!
f9426a
+! You should have received a copy of the GNU General Public License
f9426a
+! along with this program; if not, write to the Free Software
f9426a
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
f9426a
+!
f9426a
+! Ihis file is the Fortran source file for dynamic.exp.
f9426a
+! Original file written by Jakub Jelinek <jakub@redhat.com>.
f9426a
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
f9426a
+
f9426a
+subroutine bar
f9426a
+  real :: dummy
f9426a
+  dummy = 1
f9426a
+end subroutine bar
f9426a
diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
f9426a
new file mode 100644
f9426a
index 0000000..570a28c
f9426a
--- /dev/null
f9426a
+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
f9426a
@@ -0,0 +1,39 @@
f9426a
+# Copyright 2010 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 2 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+# 
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+# 
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program; if not, write to the Free Software
f9426a
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
f9426a
+
f9426a
+set testfile "dynamic-other-frame"
f9426a
+set srcfile1 ${testfile}.f90
f9426a
+set srcfile2 ${testfile}-stub.f90
f9426a
+set objfile2 [standard_output_file ${testfile}-stub.o]
f9426a
+set executable ${testfile}
f9426a
+set binfile [standard_output_file ${executable}]
f9426a
+
f9426a
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != ""
f9426a
+     || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } {
f9426a
+    untested "Couldn't compile ${srcfile1} or ${srcfile2}"
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+clean_restart ${executable}
f9426a
+
f9426a
+gdb_test_no_output "set print frame-arguments all"
f9426a
+
f9426a
+if ![runto bar_] then {
f9426a
+    perror "couldn't run to bar_"
f9426a
+    continue
f9426a
+}
f9426a
+
f9426a
+gdb_test "bt" {foo \(string='hello'.*}
f9426a
diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
f9426a
new file mode 100644
f9426a
index 0000000..2bc637d
f9426a
--- /dev/null
f9426a
+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
f9426a
@@ -0,0 +1,36 @@
f9426a
+! Copyright 2010 Free Software Foundation, Inc.
f9426a
+!
f9426a
+! This program is free software; you can redistribute it and/or modify
f9426a
+! it under the terms of the GNU General Public License as published by
f9426a
+! the Free Software Foundation; either version 2 of the License, or
f9426a
+! (at your option) any later version.
f9426a
+!
f9426a
+! This program is distributed in the hope that it will be useful,
f9426a
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+! GNU General Public License for more details.
f9426a
+!
f9426a
+! You should have received a copy of the GNU General Public License
f9426a
+! along with this program; if not, write to the Free Software
f9426a
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
f9426a
+!
f9426a
+! Ihis file is the Fortran source file for dynamic.exp.
f9426a
+! Original file written by Jakub Jelinek <jakub@redhat.com>.
f9426a
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
f9426a
+
f9426a
+subroutine foo (string)
f9426a
+  interface
f9426a
+    subroutine bar
f9426a
+    end subroutine
f9426a
+  end interface
f9426a
+  character string*(*)
f9426a
+  call bar                                ! stop-here
f9426a
+end subroutine foo
f9426a
+program test
f9426a
+  interface
f9426a
+    subroutine foo (string)
f9426a
+    character string*(*)
f9426a
+    end subroutine
f9426a
+  end interface
f9426a
+  call foo ('hello')
f9426a
+end
f9426a
f9426a
--FCuugMFkClbJLl1L--
f9426a