Blame SOURCES/gdb-fortran-frame-string.patch

475228
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
475228
From: Fedora GDB patches <invalid@email.com>
475228
Date: Fri, 27 Oct 2017 21:07:50 +0200
475228
Subject: gdb-fortran-frame-string.patch
475228
475228
;; Display Fortran strings in backtraces.
475228
;;=fedoratest
475228
475228
http://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
475228
475228
Hi,
475228
475228
for Fortran it fixes displaying normal strings also in frames/backtraces:
475228
475228
(gdb) frame
475228
->
475228
475228
The patch is simple and I do not see why it should not be this way.
475228
475228
For C/C++ TYPE_CODE_STRING is not used.  I am not aware of Pascal but that
475228
language is currently not really much supported in GDB anyway.
475228
475228
This was a part of my archer/jankratochvil/vla branch but it is not a part of
475228
the Intel VLA patchset as it in fact is completely unrelated to "VLA".
475228
475228
No regressions on {x86_64,x86_64-m32,i686}-fedora22pre-linux-gnu.
475228
475228
Thanks,
475228
Jan
475228
475228
diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.exp b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp
475228
new file mode 100644
475228
--- /dev/null
475228
+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp
475228
@@ -0,0 +1,36 @@
475228
+# Copyright 2014 Free Software Foundation, Inc.
475228
+
475228
+# This program is free software; you can redistribute it and/or modify
475228
+# it under the terms of the GNU General Public License as published by
475228
+# the Free Software Foundation; either version 2 of the License, or
475228
+# (at your option) any later version.
475228
+# 
475228
+# This program is distributed in the hope that it will be useful,
475228
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
475228
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
475228
+# GNU General Public License for more details.
475228
+# 
475228
+# You should have received a copy of the GNU General Public License
475228
+# along with this program; if not, write to the Free Software
475228
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
475228
+
475228
+standard_testfile .f90
475228
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
475228
+    return -1
475228
+}
475228
+
475228
+if ![runto MAIN__] then {
475228
+    perror "couldn't run to breakpoint MAIN__"
475228
+    continue
475228
+}
475228
+
475228
+gdb_breakpoint [gdb_get_line_number "s = s"]
475228
+gdb_continue_to_breakpoint "s = s"
475228
+
475228
+gdb_test "ptype s" {type = character\*3}
475228
+gdb_test "p s" " = 'foo'"
475228
+
475228
+# Fix rejected upstream:
475228
+# https://sourceware.org/ml/gdb-patches/2014-07/msg00768.html
475228
+setup_kfail "rejected" *-*-* 
475228
+gdb_test "frame" { \(s='foo', .*}
475228
diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90
475228
new file mode 100644
475228
--- /dev/null
475228
+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90
475228
@@ -0,0 +1,28 @@
475228
+! Copyright 2014 Free Software Foundation, Inc.
475228
+!
475228
+! This program is free software; you can redistribute it and/or modify
475228
+! it under the terms of the GNU General Public License as published by
475228
+! the Free Software Foundation; either version 2 of the License, or
475228
+! (at your option) any later version.
475228
+!
475228
+! This program is distributed in the hope that it will be useful,
475228
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
475228
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
475228
+! GNU General Public License for more details.
475228
+!
475228
+! You should have received a copy of the GNU General Public License
475228
+! along with this program; if not, write to the Free Software
475228
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
475228
+!
475228
+! Ihis file is the Fortran source file for dynamic.exp.
475228
+! Original file written by Jakub Jelinek <jakub@redhat.com>.
475228
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
475228
+
475228
+  subroutine f(s)
475228
+  character*3 s
475228
+  s = s
475228
+  end
475228
+
475228
+  program main
475228
+  call f ('foo')
475228
+  end