aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/fortran.exp
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-07-09 15:47:19 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-08-28 13:33:54 +0100
commit1f20c35ea4a0095e6a9d9b7819f6c437a0c4cfc1 (patch)
treeb65b098310de5ceb7dc0892d627a283626020821 /gdb/testsuite/lib/fortran.exp
parentfa463e9fc644e7a3bad39aa73bf6be72ea865805 (diff)
downloadbinutils-1f20c35ea4a0095e6a9d9b7819f6c437a0c4cfc1.zip
binutils-1f20c35ea4a0095e6a9d9b7819f6c437a0c4cfc1.tar.gz
binutils-1f20c35ea4a0095e6a9d9b7819f6c437a0c4cfc1.tar.bz2
gdb/fortran: Implement la_print_typedef for Fortran
Implement an la_print_typedef method for Fortran, this allows 'info types' to work for Fortran. The implementation is just copied from ada_print_typedef (with the appropriate changes). To support the testing of this patch I added a new proc, fortran_character1, to lib/fortran.exp which returns a regexp to match a 1-byte character type. The regexp returned is correct for current versions of gFortran. All of the other regexp are guesses based on all of the other support procs in lib/fortran.exp, I haven't tested them myself. gdb/ChangeLog: * f-lang.c (f_language_defn): Use f_print_typedef. * f-lang.h (f_print_typedef): Declare. * f-typeprint.c (f_print_typedef): Define. gdb/testsuite/ChangeLog: * gdb.fortran/info-types.exp: New file. * gdb.fortran/info-types.f90: New file. * lib/fortran.exp (fortran_character1): New proc.
Diffstat (limited to 'gdb/testsuite/lib/fortran.exp')
-rw-r--r--gdb/testsuite/lib/fortran.exp12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/fortran.exp b/gdb/testsuite/lib/fortran.exp
index d3a35cd..81811db 100644
--- a/gdb/testsuite/lib/fortran.exp
+++ b/gdb/testsuite/lib/fortran.exp
@@ -88,3 +88,15 @@ proc fortran_logical4 {} {
return "unknown"
}
}
+
+proc fortran_character1 {} {
+ if {[test_compiler_info {gcc-4-[012]-*}]} {
+ return "character1"
+ } elseif {[test_compiler_info {gcc-*}]} {
+ return "character\\(kind=1\\)"
+ } elseif {[test_compiler_info {icc-*}]} {
+ return "CHARACTER\\(1\\)"
+ } else {
+ return "unknown"
+ }
+}