From: FX Coudert <fxcoudert@gmail.com>
To: gdb-patches@sourceware.org
Cc: "fortran@gcc.gnu.org List" <fortran@gcc.gnu.org>
Subject: Name of Fortran intrinsic types
Date: Sat, 17 Nov 2007 20:56:00 -0000 [thread overview]
Message-ID: <6E63F9C5-BBBE-4C8D-8FCB-21B6ECF18580@gmail.com> (raw)
[-- 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. */
next reply other threads:[~2007-11-17 20:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-17 20:56 FX Coudert [this message]
2007-12-16 20:59 ` Daniel Jacobowitz
2007-12-16 21:25 ` FX Coudert
2007-12-16 21:28 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6E63F9C5-BBBE-4C8D-8FCB-21B6ECF18580@gmail.com \
--to=fxcoudert@gmail.com \
--cc=fortran@gcc.gnu.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox