This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC]: Document patch for F90 derived type support
Maybe we can do this:
case TYPE_CODE_INT:
/* There may be some character types that attempt to come
through as TYPE_CODE_INT since dbxstclass.h is so
C-oriented, we must change these to "character" from "char". */
if (strcmp (TYPE_NAME (type), "char") == 0)
fprintfi_filtered (level, stream, "character");
else
fprintfi_filtered (level, stream, "integer (%d)", TYPE_LENGTH (type));
break;
The basic idea is to let the TYPE_CODE (type) and TYPE_LENGTH (type) to
determine what should be displayed.
This might be inconsistent with what the compiler generats (there is also
a benefit in this too, we don't need't adapt to all these different
compilers, which might generate different names for these types). But it
is acceptable by the programmer I believe. And also conform to the
language standard.
Any comment on this?
Regards
- Wu Zhou
On Wed, 1 Mar 2006, Daniel Jacobowitz wrote:
> On Wed, Mar 01, 2006 at 09:02:34PM +0200, Eli Zaretskii wrote:
> > > Date: Wed, 1 Mar 2006 00:05:01 -0500
> > > From: Daniel Jacobowitz <drow@false.org>
> > > Cc: Wu Zhou <woodzltc@cn.ibm.com>, gdb-patches@sources.redhat.com
> > >
> > > This is the same name that, e.g., gfortran probably uses in some
> > > error messages.
> >
> > If "int4" is the official gfortran name (is it?), then I agree we
> > should leave it alone.
>
> I'm not sure if "official" is really strong enough; I suspect it will
> use it in some user messages, as well as in debug information.
>
> > > No, it can't be quite that simple, because current versions of Fortran
> > > do support user-named types - "int4" does not necessarily imply
> > > integer(4).
> >
> > Perhaps I'm confused: isn't "int4" a 32-bit integer? I thought it
> > was, but if I was mistaken, my apologies for the noise.
>
> It's not reserved at all in the input to the compiler - it might be
> something different than a type, or it might be the name of a record
> type (whatever the correct name for that is).
>
> > > Paul also corrected me on the naming - this would be integer(4)
> > > apparently, integer*4 is something different.
> >
> > Can you (or someone else) elaborate, or point me to some document that
> > does?
>
> I believe integer(4) is an integer with kind == 4. Paul wrote:
>
> > integer(4) is the standard way, though the "4" has no particular meaning.
> > integer*4 is a nonstandard (but common) extension saying "I want an
> > integer 4 somthings wide". This may or may not be the same as integer(4).
>
> Make of that whatever you want to...
>
> --
> Daniel Jacobowitz
> CodeSourcery
>