public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch] Extend Fortran detection filename extensions
@ 2010-06-02 21:41 Jan Kratochvil
  2010-06-02 22:03 ` Tom Tromey
  2010-06-02 22:06 ` Joel Brobecker
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Kratochvil @ 2010-06-02 21:41 UTC (permalink / raw)
  To: gdb-patches

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] Extend Fortran detection filename extensions
  2010-06-02 21:41 [patch] Extend Fortran detection filename extensions Jan Kratochvil
@ 2010-06-02 22:03 ` Tom Tromey
  2010-06-02 23:03   ` Jan Kratochvil
  2010-06-02 22:06 ` Joel Brobecker
  1 sibling, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2010-06-02 22:03 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

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

This is ok.

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

This seems like a good place to look.

Tom

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] Extend Fortran detection filename extensions
  2010-06-02 21:41 [patch] Extend Fortran detection filename extensions Jan Kratochvil
  2010-06-02 22:03 ` Tom Tromey
@ 2010-06-02 22:06 ` Joel Brobecker
  2010-06-02 22:37   ` Jan Kratochvil
  1 sibling, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2010-06-02 22:06 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

> 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.

This seems reasonable to me. I wish I knew more languages that I do now,
but I don't see some of these extensions being used by other languages
as well. So this seems OK to me (and would be easy to adjust if someone
else has more info about a possible collision).

> gdb/testsuite/
> 2010-06-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	* gdb.fortran/module.exp (stopped language detection): New test.

A question about this new test (which is OK, btw).

> +# Test automatic language detection before the inferior starts.
> +gdb_test "p modmany::var_i" " = 14" "stopped language detection"

Why not just do "show language"?

-- 
Joel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] Extend Fortran detection filename extensions
  2010-06-02 22:06 ` Joel Brobecker
@ 2010-06-02 22:37   ` Jan Kratochvil
  2010-06-02 22:52     ` Joel Brobecker
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kratochvil @ 2010-06-02 22:37 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

On Thu, 03 Jun 2010 00:06:22 +0200, Joel Brobecker wrote:
> > +# Test automatic language detection before the inferior starts.
> > +gdb_test "p modmany::var_i" " = 14" "stopped language detection"
> 
> Why not just do "show language"?

I believe this testcase should be in place as it tests it all together.

There could be probably also an isolated new testcase.  I was not sure if
there would not be one day changes in how Fortran language variants get
detected and called in `show language'.  But I understand in such case even
the testcases must be changed.

Should I submit a separate testfile for it?


Thanks,
Jan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] Extend Fortran detection filename extensions
  2010-06-02 22:37   ` Jan Kratochvil
@ 2010-06-02 22:52     ` Joel Brobecker
  0 siblings, 0 replies; 6+ messages in thread
From: Joel Brobecker @ 2010-06-02 22:52 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

> > > +# Test automatic language detection before the inferior starts.
> > > +gdb_test "p modmany::var_i" " = 14" "stopped language detection"
> > 
> > Why not just do "show language"?
> 
> I believe this testcase should be in place as it tests it all together.
> 
> There could be probably also an isolated new testcase.  I was not sure if
> there would not be one day changes in how Fortran language variants get
> detected and called in `show language'.  But I understand in such case even
> the testcases must be changed.
> 
> Should I submit a separate testfile for it?

It's not very important, IMO. I'm happy with the above especially if
you adjust the comment to say that this *also* verifies that the language
is currently fortran, since the test itself seems to be important as well.

-- 
Joel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] Extend Fortran detection filename extensions
  2010-06-02 22:03 ` Tom Tromey
@ 2010-06-02 23:03   ` Jan Kratochvil
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Kratochvil @ 2010-06-02 23:03 UTC (permalink / raw)
  To: Tom Tromey, Joel Brobecker; +Cc: gdb-patches

On Thu, 03 Jun 2010 00:03:14 +0200, Tom Tromey wrote:
> This is ok.

On Thu, 03 Jun 2010 00:52:41 +0200, Joel Brobecker wrote:
> if adjust the comment to say that this *also* verifies that the language
> is currently fortran, since the test itself seems to be important as well.

I hope the extended comment is acceptable.

Checked-in.


Thanks,
Jan


http://sourceware.org/ml/gdb-cvs/2010-06/msg00028.html

--- src/gdb/ChangeLog	2010/06/02 22:41:55	1.11867
+++ src/gdb/ChangeLog	2010/06/02 23:01:00	1.11868
@@ -1,5 +1,11 @@
 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.
+
+2010-06-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
 	Support DW_TAG_module as separate namespaces.
 	* dwarf2read.c (typename_concat): New parameter physname.
 	(read_module_type): New function and declaration.
--- src/gdb/testsuite/ChangeLog	2010/06/02 22:41:56	1.2310
+++ src/gdb/testsuite/ChangeLog	2010/06/02 23:01:01	1.2311
@@ -1,5 +1,9 @@
 2010-06-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
+	* gdb.fortran/module.exp (stopped language detection): New test.
+
+2010-06-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
 	Support DW_TAG_module as separate namespaces.
 	* gdb.fortran/library-module.exp, gdb.fortran/library-module-main.f90,
 	gdb.fortran/library-module-lib.f90: New.
--- src/gdb/symfile.c	2010/05/16 23:49:58	1.287
+++ src/gdb/symfile.c	2010/06/02 23:01:00	1.288
@@ -2633,6 +2633,20 @@
       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);
--- src/gdb/testsuite/gdb.fortran/module.exp	2010/06/02 22:41:56	1.3
+++ src/gdb/testsuite/gdb.fortran/module.exp	2010/06/02 23:01:01	1.4
@@ -20,6 +20,12 @@
     return -1
 }
 
+# Test automatic language detection before the inferior starts.  It tests the
+# effect of expected:
+# (gdb) show language 
+# The current source language is "auto; currently fortran".
+gdb_test "p modmany::var_i" " = 14" "stopped language detection"
+
 if ![runto MAIN__] then {
     perror "couldn't run to breakpoint MAIN__"
     continue

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-06-02 23:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-02 21:41 [patch] Extend Fortran detection filename extensions Jan Kratochvil
2010-06-02 22:03 ` Tom Tromey
2010-06-02 23:03   ` Jan Kratochvil
2010-06-02 22:06 ` Joel Brobecker
2010-06-02 22:37   ` Jan Kratochvil
2010-06-02 22:52     ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).