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