This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: long long considered harmful?

> > > This is a target entity isn't it?  You've got no business using
> > > "double" for a target float.  Use the gdb type mechanism instead.
> >
> > Can you point to an example of how this is done?
> Check out floatformat_to_doublest.  You may not even need it if you
> only pass the data to supply_register...

Exactly.  All we do is throw the bits around to supply register.  I'm just
looking for a way to make the structures the right size without being
completely ugly.

> > I believe it's padding to handle whether we're dealing with a little or
> > endian target.  I'll ask the kernel guys when I find them.  Regardless
> > whether it does anything, the structure has to be the appropriate size
> > the kernel to fill in.  "Mine is not to reason why, mine is just to do
> > die."
> We're talking about code in the host now though, right?  You can not
> rely on any structure alignment to match.  If any of these must match
> target structures, you must use gdbarch and the type mechanism for
> them.  See gnu-v3-abi.c for an example; or just define the offsets that
> you need.

Well, at the moment, the only host we build gdb for is i386 and Sparc
(Neutrino, Solaris and Win32) but conceivably we might want to build a gdb
for Neutrino on ppc or mips or some such.  Once again, as far as gdb is
concerned, none of it really matters because this is just data coming over
the wire (or from a system call) and all it needs to know is which offset
into the structure to call supply_register on.

Do  you think it will be sufficient just to get rid of the long longs?



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]