This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] 'union' handling for Fortran (in GDB)
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Markus Deuling <deuling at de dot ibm dot com>, fortran at gcc dot gnu dot org, GDB Patches <gdb-patches at sourceware dot org>, Ulrich Weigand <uweigand at de dot ibm dot com>
- Date: Tue, 3 Jul 2007 18:34:05 -0700
- Subject: Re: [rfc] 'union' handling for Fortran (in GDB)
- References: <466AA121.1020202@de.ibm.com> <20070612153754.GG16068@caradoc.them.org> <46701B57.2080403@de.ibm.com> <20070701221550.GA31680@caradoc.them.org>
On Sun, Jul 01, 2007 at 06:15:50PM -0400, Daniel Jacobowitz wrote:
> I can't make a sensible decision about this; I know roughly nothing
> of what Fortran programmers would expect. So I'm copying your message
> to the GCC Fortran list, and I hope someone there has a suggestion.
>
> For fortran@, the context starts here:
> http://sourceware.org/ml/gdb-patches/2007-06/msg00131.html
>
> The SPU has a number of vector registers. Their type is represented
> in GDB as a union of useful views. When you're in Fortran mode,
> there's no way to handle unions, and it's hard to see the registers.
>
> I think that we could add union handling if someone familiar with
> Fortran wants to pick a fake syntax, suitably unlikely to mean
> something in a later revision of Fortran, or something equivalent from
> the current Fortran. Equivalences don't seem to be quite the same
> thing.
>
> Or we could come up with an entirely different way to represent vector
> registers in GDB. The current representation is not very helpful
> sometimes. Maybe we should display the register in only one type
> by default, as a giant hex string, and provide built-in functions
> to convert it to other types.
>
> I'm open to ideas :-)
>
Hi Daniel,
Technically, this is outside the scope of the Fortran language
in that the language has no concept of register. If these registers
are accessed through a union, then the nearest construct in the Fortran
language is EQUIVALENCE. But as you said, EQUIVALENCE does feel
quite right. Unfortunately, I suspect most gfortran contributors
know very little about gdb internals.
I personally like your idea of printing registers as a hex string.
The verbose syntax could be 'print register 1'. It someone wanted
all the registers, then 'print registers' or 'print register all'.
One could sub 'show' for 'print'.
--
Steve