This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Extend Fortran detection filename extensions


Hi,

this patch would not need to be but it was made on top of pending
	Re: [patch 3/3] Fortran modules namespaces [rediff]
	http://sourceware.org/ml/gdb-patches/2010-06/msg00059.html

I found out before I start the inferior GDB still claims:
(gdb) show language 
The current source language is "auto; currently c".

Therefore I extended the filename extensions table from that found in gcc HEAD
gcc/gcc.c:default_compilers[].

No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.


Thanks,
Jan


gdb/
2010-06-02  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* symfile.c (init_filename_language_table): New extensions .for, .FOR,
	.ftn, .FTN, .fpp, .FPP, .f90, .F90, .f95, .F95, .f03, .F03, .f08 and
	.F08.

gdb/testsuite/
2010-06-02  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.fortran/module.exp (stopped language detection): New test.

--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2633,6 +2633,20 @@ init_filename_language_table (void)
       add_filename_language (".m", language_objc);
       add_filename_language (".f", language_fortran);
       add_filename_language (".F", language_fortran);
+      add_filename_language (".for", language_fortran);
+      add_filename_language (".FOR", language_fortran);
+      add_filename_language (".ftn", language_fortran);
+      add_filename_language (".FTN", language_fortran);
+      add_filename_language (".fpp", language_fortran);
+      add_filename_language (".FPP", language_fortran);
+      add_filename_language (".f90", language_fortran);
+      add_filename_language (".F90", language_fortran);
+      add_filename_language (".f95", language_fortran);
+      add_filename_language (".F95", language_fortran);
+      add_filename_language (".f03", language_fortran);
+      add_filename_language (".F03", language_fortran);
+      add_filename_language (".f08", language_fortran);
+      add_filename_language (".F08", language_fortran);
       add_filename_language (".s", language_asm);
       add_filename_language (".sx", language_asm);
       add_filename_language (".S", language_asm);
--- a/gdb/testsuite/gdb.fortran/module.exp
+++ b/gdb/testsuite/gdb.fortran/module.exp
@@ -20,6 +20,9 @@ if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f77}] } {
     return -1
 }
 
+# Test automatic language detection before the inferior starts.
+gdb_test "p modmany::var_i" " = 14" "stopped language detection"
+
 if ![runto MAIN__] then {
     perror "couldn't run to breakpoint MAIN__"
     continue


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]