* Name of Fortran intrinsic types
@ 2007-11-17 20:56 FX Coudert
2007-12-16 20:59 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: FX Coudert @ 2007-11-17 20:56 UTC (permalink / raw)
To: gdb-patches; +Cc: fortran@gcc.gnu.org List
[-- Attachment #1: Type: text/plain, Size: 865 bytes --]
Hi all,
This is my first patch submission for gdb (I received confirmation of
my copyright assignment a week ago). It's short and I hope it's
straightforward: for intrinsic Fortran types (here, real and complex
types), I think we should use the name the compiler produced, instead
of trying to be clever.
The rationale is that this allows us to output Fortran names for the
types, e.g. "real(kind=4)", instead gdb-specific, non-Fortran names
(e.g. "int4"). The reason for doing that instead of simply replacing
the format (currently "int%d") in gdb is that we have no way, in
general, to know the kind of the variable in gdb, so it's better to
simply trust the compiler!
Built and regtested on x86_64-linux (there are a fair number of
FAILures in the testsuite, but none in the Fortran area, so maybe
it's the normal state?).
Thanks,
FX
[-- Attachment #2: gdb-types.ChangeLog --]
[-- Type: application/octet-stream, Size: 214 bytes --]
2007-11-17 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* f-typeprint.c (print_equivalent_f77_float_type): Remove function.
(f_type_print_base): Output the type names directly for real and
complex types.
[-- Attachment #3: gdb-types.diff --]
[-- Type: application/octet-stream, Size: 1939 bytes --]
Index: f-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/f-typeprint.c,v
retrieving revision 1.19
diff -p -u -r1.19 f-typeprint.c
--- f-typeprint.c 23 Aug 2007 18:08:31 -0000 1.19
+++ f-typeprint.c 17 Nov 2007 20:33:47 -0000
@@ -39,9 +39,6 @@
static void f_type_print_args (struct type *, struct ui_file *);
#endif
-static void print_equivalent_f77_float_type (int level, struct type *,
- struct ui_file *);
-
static void f_type_print_varspec_suffix (struct type *, struct ui_file *,
int, int, int);
@@ -254,17 +251,6 @@ f_type_print_varspec_suffix (struct type
}
}
-static void
-print_equivalent_f77_float_type (int level, struct type *type,
- struct ui_file *stream)
-{
- /* Override type name "float" and make it the
- appropriate real. XLC stupidly outputs -12 as a type
- for real when it really should be outputting -18 */
-
- fprintfi_filtered (level, stream, "real*%d", TYPE_LENGTH (type));
-}
-
/* Print the name of the type (or the ultimate pointer target,
function value or array element), or the description of a
structure or union.
@@ -301,10 +287,7 @@ f_type_print_base (struct type *type, st
if ((show <= 0) && (TYPE_NAME (type) != NULL))
{
- if (TYPE_CODE (type) == TYPE_CODE_FLT)
- print_equivalent_f77_float_type (level, type, stream);
- else
- fputs_filtered (TYPE_NAME (type), stream);
+ fputs_filtered (TYPE_NAME (type), stream);
return;
}
@@ -365,14 +348,6 @@ f_type_print_base (struct type *type, st
goto default_case;
break;
- case TYPE_CODE_COMPLEX:
- fprintfi_filtered (level, stream, "complex*%d", TYPE_LENGTH (type));
- break;
-
- case TYPE_CODE_FLT:
- print_equivalent_f77_float_type (level, type, stream);
- break;
-
case TYPE_CODE_STRING:
/* Strings may have dynamic upperbounds (lengths) like arrays. */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Name of Fortran intrinsic types
2007-11-17 20:56 Name of Fortran intrinsic types FX Coudert
@ 2007-12-16 20:59 ` Daniel Jacobowitz
2007-12-16 21:25 ` FX Coudert
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-12-16 20:59 UTC (permalink / raw)
To: FX Coudert; +Cc: gdb-patches, fortran@gcc.gnu.org List
On Sat, Nov 17, 2007 at 08:55:51PM +0000, FX Coudert wrote:
> Built and regtested on x86_64-linux (there are a fair number of FAILures
> in the testsuite, but none in the Fortran area, so maybe it's the normal
> state?).
OK. Do you have commit access already (membership in the src group)?
If not, please ask overseers@ for it; CC me and say I approved it.
Then add yourself to gdb/MAINTAINERS in the obvious place.
Yes, a number of failures are normal. I dislike this, but it's hard
to stay on top of all the different configurations. Any time you want
to fix one of them or add appropriate XFAILs for conditions outside of
GDB's control, be my guest and I'll be happy to help. Until then, I
recommend running the testsuite with and without your patches.
Also, if you could find a way to put your patches in plain text
instead of application/octet-stream... thanks.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Name of Fortran intrinsic types
2007-12-16 20:59 ` Daniel Jacobowitz
@ 2007-12-16 21:25 ` FX Coudert
2007-12-16 21:28 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: FX Coudert @ 2007-12-16 21:25 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches, fortran@gcc.gnu.org List
> OK. Do you have commit access already (membership in the src group)?
> If not, please ask overseers@ for it; CC me and say I approved it.
> Then add yourself to gdb/MAINTAINERS in the obvious place.
I won't be in a position to commit until mid-January. Feel free to
commit it if you want, otherwise I'll do it then.
Thanks for reviewing the patch,
FX
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Name of Fortran intrinsic types
2007-12-16 21:25 ` FX Coudert
@ 2007-12-16 21:28 ` Daniel Jacobowitz
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-12-16 21:28 UTC (permalink / raw)
To: FX Coudert; +Cc: gdb-patches, fortran@gcc.gnu.org List
On Sun, Dec 16, 2007 at 09:14:41PM +0000, FX Coudert wrote:
>> OK. Do you have commit access already (membership in the src group)?
>> If not, please ask overseers@ for it; CC me and say I approved it.
>> Then add yourself to gdb/MAINTAINERS in the obvious place.
>
> I won't be in a position to commit until mid-January. Feel free to commit
> it if you want, otherwise I'll do it then.
I checked it in.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-12-16 21:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-17 20:56 Name of Fortran intrinsic types FX Coudert
2007-12-16 20:59 ` Daniel Jacobowitz
2007-12-16 21:25 ` FX Coudert
2007-12-16 21:28 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox