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

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