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

f9426a
http://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
f9426a
Subject: [patch] Display Fortran strings in backtraces
f9426a
f9426a
f9426a
Hi,
f9426a
f9426a
for Fortran it fixes displaying normal strings also in frames/backtraces:
f9426a
f9426a
(gdb) frame
f9426a
#0  f (s=..., _s=3) at ./gdb.fortran/fortran-frame-string.f90:24
f9426a
->
f9426a
#0  f (s='foo', _s=3) at ./gdb.fortran/fortran-frame-string.f90:24
f9426a
f9426a
The patch is simple and I do not see why it should not be this way.
f9426a
f9426a
For C/C++ TYPE_CODE_STRING is not used.  I am not aware of Pascal but that
f9426a
language is currently not really much supported in GDB anyway.
f9426a
f9426a
This was a part of my archer/jankratochvil/vla branch but it is not a part of
f9426a
the Intel VLA patchset as it in fact is completely unrelated to "VLA".
f9426a
f9426a
No regressions on {x86_64,x86_64-m32,i686}-fedora22pre-linux-gnu.
f9426a
f9426a
f9426a
Thanks,
f9426a
Jan
f9426a
f9426a
f9426a
diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.exp b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp
f9426a
new file mode 100644
f9426a
index 0000000..4b78266
f9426a
--- /dev/null
f9426a
+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp
f9426a
@@ -0,0 +1,36 @@
f9426a
+# Copyright 2014 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
+standard_testfile .f90
f9426a
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
f9426a
+    return -1
f9426a
+}
f9426a
+
f9426a
+if ![runto MAIN__] then {
f9426a
+    perror "couldn't run to breakpoint MAIN__"
f9426a
+    continue
f9426a
+}
f9426a
+
f9426a
+gdb_breakpoint [gdb_get_line_number "s = s"]
f9426a
+gdb_continue_to_breakpoint "s = s"
f9426a
+
f9426a
+gdb_test "ptype s" {type = character\*3}
f9426a
+gdb_test "p s" " = 'foo'"
f9426a
+
f9426a
+# Fix rejected upstream:
f9426a
+# https://sourceware.org/ml/gdb-patches/2014-07/msg00768.html
f9426a
+setup_kfail "rejected" *-*-* 
f9426a
+gdb_test "frame" { \(s='foo', .*}
f9426a
diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90
f9426a
new file mode 100644
f9426a
index 0000000..3d1576f
f9426a
--- /dev/null
f9426a
+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90
f9426a
@@ -0,0 +1,28 @@
f9426a
+! Copyright 2014 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 f(s)
f9426a
+  character*3 s
f9426a
+  s = s
f9426a
+  end
f9426a
+
f9426a
+  program main
f9426a
+  call f ('foo')
f9426a
+  end