This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] 64-bit support for Irix 6
On Aug 1, 4:28pm, Andrew Cagney wrote:
> > + set_gdbarch_register_virtual_type (gdbarch, mips_register_virtual_type);
>
> Can you please add a comment here explaining that many MIPS targets do
> not yet use this method because they are still defining the macro.
Done. (Separate patch committed a little while ago.)
> As a separate patch, could you please update things so that:
>
> > +static struct type *
> > +mips_register_virtual_type (int reg)
> > +{
> > + if (FP0_REGNUM <= reg && reg < FP0_REGNUM + 32)
> > + return builtin_type_double;
>
> This returns ieee_double big/little.
>
> > + else if (reg == PS_REGNUM /* CR */)
> > + return builtin_type_uint32;
> > + else if (FCRCS_REGNUM <= reg && reg <= LAST_EMBED_REGNUM)
> > + return builtin_type_uint32;
> > + else
> > + {
> > + /* Everything else... return ``long long'' when registers
> > + are 64-bits wide, ``int'' otherwise. */
> > + if (MIPS_REGSIZE == TYPE_LENGTH (builtin_type_long_long))
> > + return builtin_type_long_long;
>
> This returns builtin_type_uint64.
>
> > + else
>
> > + return builtin_type_int;
>
> This returns builtin_type_uint32.
Done. See below:
* mips-tdep.c (mips_register_virtual_type): Use architecture
invariant return values.
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.87
diff -u -p -r1.87 mips-tdep.c
--- mips-tdep.c 1 Aug 2002 21:36:27 -0000 1.87
+++ mips-tdep.c 1 Aug 2002 23:02:18 -0000
@@ -497,19 +497,25 @@ static struct type *
mips_register_virtual_type (int reg)
{
if (FP0_REGNUM <= reg && reg < FP0_REGNUM + 32)
- return builtin_type_double;
+ {
+ /* Floating point registers... */
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ return builtin_type_ieee_double_big;
+ else
+ return builtin_type_ieee_double_little;
+ }
else if (reg == PS_REGNUM /* CR */)
return builtin_type_uint32;
else if (FCRCS_REGNUM <= reg && reg <= LAST_EMBED_REGNUM)
return builtin_type_uint32;
else
{
- /* Everything else... return ``long long'' when registers
- are 64-bits wide, ``int'' otherwise. */
- if (MIPS_REGSIZE == TYPE_LENGTH (builtin_type_long_long))
- return builtin_type_long_long;
+ /* Everything else...
+ Return type appropriate for width of register. */
+ if (MIPS_REGSIZE == TYPE_LENGTH (builtin_type_uint64))
+ return builtin_type_uint64;
else
- return builtin_type_int;
+ return builtin_type_uint32;
}
}