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