This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: long long considered harmful?
On Wed, Apr 23, 2003 at 06:09:40PM -0400, Kris Warkentin wrote:
> > I'd have to see exactly what you meant, but probably not. These things
> > have to be an exact size, right? Barring wackiness like the 32-bit
> > char platforms, which I shouldn't have brought into this. So if you
> > run on a host with 64-bit "int", it will be wrong.
>
> It just has to be AT LEAST a certain size. If I have:
>
> typedef struct x86_cpu_registers
> {
> unsigned edi, esi, ebp, exx, ebx, edx, ecx, eax;
> unsigned eip, cs, efl;
> unsigned esp, ss;
> } X86_CPU_REGISTERS;
>
> typedef union _debug_gregs
> {
> ARM_CPU_REGISTERS arm;
> ...
> X86_CPU_REGISTERS x86;
> qnx_reg64 padding[1024];
> } nto_gregset_t;
>
> Then the padding guarantees a minimum size. If I then calculate edi, esi,
> etc.
> using char offsets, the way the compiler creates the structure is completely
> irrelevant. The only reason for the structure is to maintain visible
> compatability with our system headers.
At that point, the entire contents of this header (for GDB's purposes)
could be:
typedef union _debug_gregs
{
qnx_reg64 padding[1024];
};
Right?
If so, honestly I don't see the point of including it in GDB at all.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer