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