[rfc] 'union' handling for Fortran (in GDB)
Steve Kargl
sgk@troutmask.apl.washington.edu
Wed Jul 4 01:34:00 GMT 2007
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
More information about the Gdb-patches
mailing list