* [PATCH] 64-bit support for Irix 6
@ 2002-07-31 11:23 Kevin Buettner
2002-08-01 8:11 ` Andrew Cagney
0 siblings, 1 reply; 11+ messages in thread
From: Kevin Buettner @ 2002-07-31 11:23 UTC (permalink / raw)
To: gdb-patches
I've just committed the change below.
This change (along with some other changes coming soon) allow us to
debug 64-bit applications on Irix 6.X. I've verified that this change
does not affect our ability to debug o32 and n32 applications.
* config/mips/tm-irix6.h (MIPS_REGSIZE): Define to be 8.
(REGISTER_VIRTUAL_TYPE): Some registers are now 64 bits wide.
Index: config/mips/tm-irix6.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-irix6.h,v
retrieving revision 1.2
diff -u -p -r1.2 tm-irix6.h
--- config/mips/tm-irix6.h 11 Jun 2002 17:51:56 -0000 1.2
+++ config/mips/tm-irix6.h 31 Jul 2002 17:04:03 -0000
@@ -21,6 +21,9 @@
#include "mips/tm-bigmips.h"
+#undef MIPS_REGSIZE
+#define MIPS_REGSIZE 8
+
/* SGI's assembler doesn't grok dollar signs in identifiers.
So we use dots instead. This item must be coordinated with G++. */
#undef CPLUS_MARKER
@@ -89,11 +92,12 @@
32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE)
#undef REGISTER_VIRTUAL_TYPE
+/* define 8 byte register type */
#define REGISTER_VIRTUAL_TYPE(N) \
(((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \
: ((N) == 32 /*SR*/) ? builtin_type_uint32 \
: ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \
- : builtin_type_int)
+ : builtin_type_long_long)
/* Force N32 ABI as the default. */
#define MIPS_DEFAULT_ABI MIPS_ABI_N32
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] 64-bit support for Irix 6
2002-07-31 11:23 [PATCH] 64-bit support for Irix 6 Kevin Buettner
@ 2002-08-01 8:11 ` Andrew Cagney
2002-08-01 9:53 ` Kevin Buettner
2002-08-01 13:54 ` Michael Snyder
0 siblings, 2 replies; 11+ messages in thread
From: Andrew Cagney @ 2002-08-01 8:11 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
>
> #include "mips/tm-bigmips.h"
>
> +#undef MIPS_REGSIZE
> +#define MIPS_REGSIZE 8
> +
> /* SGI's assembler doesn't grok dollar signs in identifiers.
> So we use dots instead. This item must be coordinated with G++. */
> #undef CPLUS_MARKER
> @@ -89,11 +92,12 @@
> 32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE)
>
> #undef REGISTER_VIRTUAL_TYPE
> +/* define 8 byte register type */
> #define REGISTER_VIRTUAL_TYPE(N) \
> (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \
> : ((N) == 32 /*SR*/) ? builtin_type_uint32 \
> : ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \
> - : builtin_type_int)
> + : builtin_type_long_long)
>
> /* Force N32 ABI as the default. */
> #define MIPS_DEFAULT_ABI MIPS_ABI_N32
>
Kevin, this is wrong.
It is no longer acceptable to add support for an additional sub-target
using non-multi-arch mechanisms.
Andrew
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] 64-bit support for Irix 6
2002-08-01 8:11 ` Andrew Cagney
@ 2002-08-01 9:53 ` Kevin Buettner
2002-08-01 10:42 ` Andrew Cagney
2002-08-01 13:54 ` Michael Snyder
1 sibling, 1 reply; 11+ messages in thread
From: Kevin Buettner @ 2002-08-01 9:53 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Aug 1, 11:11am, Andrew Cagney wrote:
> Kevin, this is wrong.
>
> It is no longer acceptable to add support for an additional sub-target
> using non-multi-arch mechanisms.
How about this then?
* config/mips/tm-irix6.h: Include mips/tm-bigmips64.h instead of
mips/tm-bigmips.h.
(MIPS_REGSIZE, REGISTER_VIRTUAL_SIZE): Delete.
Index: config/mips/tm-irix6.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-irix6.h,v
retrieving revision 1.3
diff -u -p -r1.3 tm-irix6.h
--- config/mips/tm-irix6.h 31 Jul 2002 17:22:06 -0000 1.3
+++ config/mips/tm-irix6.h 1 Aug 2002 16:33:24 -0000
@@ -19,10 +19,7 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "mips/tm-bigmips.h"
-
-#undef MIPS_REGSIZE
-#define MIPS_REGSIZE 8
+#include "mips/tm-bigmips64.h"
/* SGI's assembler doesn't grok dollar signs in identifiers.
So we use dots instead. This item must be coordinated with G++. */
@@ -90,14 +87,6 @@
FP0_REGNUM * MIPS_REGSIZE + \
((N) - FP0_REGNUM) * sizeof(double) : \
32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE)
-
-#undef REGISTER_VIRTUAL_TYPE
-/* define 8 byte register type */
-#define REGISTER_VIRTUAL_TYPE(N) \
- (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \
- : ((N) == 32 /*SR*/) ? builtin_type_uint32 \
- : ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \
- : builtin_type_long_long)
/* Force N32 ABI as the default. */
#define MIPS_DEFAULT_ABI MIPS_ABI_N32
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] 64-bit support for Irix 6
2002-08-01 9:53 ` Kevin Buettner
@ 2002-08-01 10:42 ` Andrew Cagney
2002-08-01 13:08 ` Kevin Buettner
0 siblings, 1 reply; 11+ messages in thread
From: Andrew Cagney @ 2002-08-01 10:42 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
> On Aug 1, 11:11am, Andrew Cagney wrote:
>
>
>> Kevin, this is wrong.
>>
>> It is no longer acceptable to add support for an additional sub-target
>> using non-multi-arch mechanisms.
>
>
> How about this then?
>
> * config/mips/tm-irix6.h: Include mips/tm-bigmips64.h instead of
> mips/tm-bigmips.h.
> (MIPS_REGSIZE, REGISTER_VIRTUAL_SIZE): Delete.
Even though it removes a macro, I think it is still fudging things. The
patch should be converting REGISTER_VIRTUAL_TYPE() to a function and
then adding it to the multi-arch vector.
Add an #undef to tm-irix6.h.
Andrew
> Index: config/mips/tm-irix6.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/config/mips/tm-irix6.h,v
> retrieving revision 1.3
> diff -u -p -r1.3 tm-irix6.h
> --- config/mips/tm-irix6.h 31 Jul 2002 17:22:06 -0000 1.3
> +++ config/mips/tm-irix6.h 1 Aug 2002 16:33:24 -0000
> @@ -19,10 +19,7 @@
> Foundation, Inc., 59 Temple Place - Suite 330,
> Boston, MA 02111-1307, USA. */
>
> -#include "mips/tm-bigmips.h"
> -
> -#undef MIPS_REGSIZE
> -#define MIPS_REGSIZE 8
> +#include "mips/tm-bigmips64.h"
>
> /* SGI's assembler doesn't grok dollar signs in identifiers.
> So we use dots instead. This item must be coordinated with G++. */
> @@ -90,14 +87,6 @@
> FP0_REGNUM * MIPS_REGSIZE + \
> ((N) - FP0_REGNUM) * sizeof(double) : \
> 32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE)
> -
> -#undef REGISTER_VIRTUAL_TYPE
> -/* define 8 byte register type */
> -#define REGISTER_VIRTUAL_TYPE(N) \
> - (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \
> - : ((N) == 32 /*SR*/) ? builtin_type_uint32 \
> - : ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \
> - : builtin_type_long_long)
>
> /* Force N32 ABI as the default. */
> #define MIPS_DEFAULT_ABI MIPS_ABI_N32
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] 64-bit support for Irix 6
2002-08-01 10:42 ` Andrew Cagney
@ 2002-08-01 13:08 ` Kevin Buettner
2002-08-01 13:28 ` Andrew Cagney
0 siblings, 1 reply; 11+ messages in thread
From: Kevin Buettner @ 2002-08-01 13:08 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Aug 1, 1:42pm, Andrew Cagney wrote:
> Even though it removes a macro, I think it is still fudging things.
Okay.
> The patch should be converting REGISTER_VIRTUAL_TYPE() to a function and
> then adding it to the multi-arch vector.
>
> Add an #undef to tm-irix6.h.
I've committed the change below. As the MIPS maintainer, you may want
to ponder my note in the mips_register_virtual_type() comment. (It
doesn't affect Irix because (for good or ill) Irix redefines
FP_REGNUM.)
* mips-tdep.c (mips_register_virtual_type): New function.
(mips_gdbarch_init): Register mips_register_virtual_type()
with gdbarch machinery.
* config/mips/tm-irix6.h (mips/tm-bigmips64.h): Include
this file instead of tm-bigmips.h.
(MIPS_REGSIZE): Delete this macro.
(REGISTER_VIRTUAL_TYPE): Delete macro. Undef macro so that
multiarch version in mips-tdep.c will be found.
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.85
diff -u -p -r1.85 mips-tdep.c
--- mips-tdep.c 31 Jul 2002 20:26:49 -0000 1.85
+++ mips-tdep.c 1 Aug 2002 19:49:59 -0000
@@ -483,6 +483,36 @@ mips_register_convert_to_raw (struct typ
TYPE_LENGTH (virtual_type));
}
+/* Return the GDB type object for the "standard" data type
+ of data in register REG.
+
+ Note: kevinb/2002-08-01: The definition below should faithfully
+ reproduce the behavior of each of the REGISTER_VIRTUAL_TYPE
+ definitions found in config/mips/tm-*.h. I'm concerned about
+ the ``FCRCS_REGNUM <= reg && reg <= LAST_EMBED_REGNUM'' clause
+ though. In some cases FP_REGNUM is in this range, and I doubt
+ that this code is correct for the 64-bit case. */
+
+static struct type *
+mips_register_virtual_type (int reg)
+{
+ if (FP0_REGNUM <= reg && reg < FP0_REGNUM + 32)
+ return builtin_type_double;
+ 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;
+ else
+ return builtin_type_int;
+ }
+}
+
/* Should the upper word of 64-bit addresses be zeroed? */
enum auto_boolean mask_address_var = AUTO_BOOLEAN_AUTO;
@@ -4634,6 +4664,8 @@ mips_gdbarch_init (struct gdbarch_info i
set_gdbarch_pointer_to_address (gdbarch, signed_pointer_to_address);
set_gdbarch_address_to_pointer (gdbarch, address_to_signed_pointer);
set_gdbarch_integer_to_address (gdbarch, mips_integer_to_address);
+
+ set_gdbarch_register_virtual_type (gdbarch, mips_register_virtual_type);
/* Hook in OS ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch, osabi);
Index: config/mips/tm-irix6.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-irix6.h,v
retrieving revision 1.3
diff -u -p -r1.3 tm-irix6.h
--- config/mips/tm-irix6.h 31 Jul 2002 17:22:06 -0000 1.3
+++ config/mips/tm-irix6.h 1 Aug 2002 19:49:59 -0000
@@ -19,10 +19,7 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "mips/tm-bigmips.h"
-
-#undef MIPS_REGSIZE
-#define MIPS_REGSIZE 8
+#include "mips/tm-bigmips64.h"
/* SGI's assembler doesn't grok dollar signs in identifiers.
So we use dots instead. This item must be coordinated with G++. */
@@ -91,14 +88,6 @@
((N) - FP0_REGNUM) * sizeof(double) : \
32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE)
-#undef REGISTER_VIRTUAL_TYPE
-/* define 8 byte register type */
-#define REGISTER_VIRTUAL_TYPE(N) \
- (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \
- : ((N) == 32 /*SR*/) ? builtin_type_uint32 \
- : ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \
- : builtin_type_long_long)
-
/* Force N32 ABI as the default. */
#define MIPS_DEFAULT_ABI MIPS_ABI_N32
@@ -129,3 +118,6 @@
/* Select the disassembler */
#undef TM_PRINT_INSN_MACH
#define TM_PRINT_INSN_MACH bfd_mach_mips8000
+
+/* Undefine those methods which have been multiarched. */
+#undef REGISTER_VIRTUAL_TYPE
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] 64-bit support for Irix 6
2002-08-01 13:08 ` Kevin Buettner
@ 2002-08-01 13:28 ` Andrew Cagney
2002-08-01 16:17 ` Kevin Buettner
0 siblings, 1 reply; 11+ messages in thread
From: Andrew Cagney @ 2002-08-01 13:28 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
>
> I've committed the change below.
Where is the fire?
> set_gdbarch_integer_to_address (gdbarch, mips_integer_to_address);
> +
> + 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.
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.
Andrew
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] 64-bit support for Irix 6
2002-08-01 8:11 ` Andrew Cagney
2002-08-01 9:53 ` Kevin Buettner
@ 2002-08-01 13:54 ` Michael Snyder
2002-08-01 14:25 ` Andrew Cagney
1 sibling, 1 reply; 11+ messages in thread
From: Michael Snyder @ 2002-08-01 13:54 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Kevin Buettner, gdb-patches
Andrew Cagney wrote:
>
> >
> > #include "mips/tm-bigmips.h"
> >
> > +#undef MIPS_REGSIZE
> > +#define MIPS_REGSIZE 8
> > +
> > /* SGI's assembler doesn't grok dollar signs in identifiers.
> > So we use dots instead. This item must be coordinated with G++. */
> > #undef CPLUS_MARKER
> > @@ -89,11 +92,12 @@
> > 32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE)
> >
> > #undef REGISTER_VIRTUAL_TYPE
> > +/* define 8 byte register type */
> > #define REGISTER_VIRTUAL_TYPE(N) \
> > (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \
> > : ((N) == 32 /*SR*/) ? builtin_type_uint32 \
> > : ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \
> > - : builtin_type_int)
> > + : builtin_type_long_long)
> >
> > /* Force N32 ABI as the default. */
> > #define MIPS_DEFAULT_ABI MIPS_ABI_N32
> >
>
> Kevin, this is wrong.
>
> It is no longer acceptable to add support for an additional sub-target
> using non-multi-arch mechanisms.
Does that mean that if we touch a macro, we have to multi-arch it?
For instance, if we touch the PUSH_ARGUMENTS function, and
PUSH_ARGUMENTS
hasn't been multi-arched, do we have to multi-arch it?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] 64-bit support for Irix 6
2002-08-01 13:54 ` Michael Snyder
@ 2002-08-01 14:25 ` Andrew Cagney
2002-08-01 14:47 ` Michael Snyder
0 siblings, 1 reply; 11+ messages in thread
From: Andrew Cagney @ 2002-08-01 14:25 UTC (permalink / raw)
To: Michael Snyder, Kevin Buettner; +Cc: gdb-patches
> Andrew Cagney wrote:
>
>>
>
>> >
>> > #include "mips/tm-bigmips.h"
>> >
>> > +#undef MIPS_REGSIZE
>> > +#define MIPS_REGSIZE 8
>> > +
>> > /* SGI's assembler doesn't grok dollar signs in identifiers.
>> > So we use dots instead. This item must be coordinated with G++. */
>> > #undef CPLUS_MARKER
>> > @@ -89,11 +92,12 @@
>> > 32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE)
>> >
>> > #undef REGISTER_VIRTUAL_TYPE
>> > +/* define 8 byte register type */
>> > #define REGISTER_VIRTUAL_TYPE(N) \
>> > (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \
>> > : ((N) == 32 /*SR*/) ? builtin_type_uint32 \
>> > : ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \
>> > - : builtin_type_int)
>> > + : builtin_type_long_long)
>> >
>> > /* Force N32 ABI as the default. */
>> > #define MIPS_DEFAULT_ABI MIPS_ABI_N32
>> >
>
>>
>> Kevin, this is wrong.
>>
>> It is no longer acceptable to add support for an additional sub-target
>> using non-multi-arch mechanisms.
>
>
> Does that mean that if we touch a macro, we have to multi-arch it?
If you want to fix a bug in a macro then you should first (separatly)
convert it to a macro/function pair. I believe this is accepted as
``current best pratice''.
If you want to change a bunch of macros to support an additional
architecture variant then they need to be multi-arch. GDB no longer
accepts an architecture variants that isn't multi-arch.
> For instance, if we touch the PUSH_ARGUMENTS function, and
> PUSH_ARGUMENTS
> hasn't been multi-arched, do we have to multi-arch it?
If you mean mips_push_arguments, then that is already part of the
multi-arch vector. Just don't forget that any changes to that function
should be multi-arch friendly.
enjoy,
Andrew
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] 64-bit support for Irix 6
2002-08-01 14:25 ` Andrew Cagney
@ 2002-08-01 14:47 ` Michael Snyder
2002-08-01 16:38 ` Andrew Cagney
0 siblings, 1 reply; 11+ messages in thread
From: Michael Snyder @ 2002-08-01 14:47 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Kevin Buettner, gdb-patches
Andrew Cagney wrote:
>
> > Andrew Cagney wrote:
> >
> >>
> >
> >> >
> >> > #include "mips/tm-bigmips.h"
> >> >
> >> > +#undef MIPS_REGSIZE
> >> > +#define MIPS_REGSIZE 8
> >> > +
> >> > /* SGI's assembler doesn't grok dollar signs in identifiers.
> >> > So we use dots instead. This item must be coordinated with G++. */
> >> > #undef CPLUS_MARKER
> >> > @@ -89,11 +92,12 @@
> >> > 32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE)
> >> >
> >> > #undef REGISTER_VIRTUAL_TYPE
> >> > +/* define 8 byte register type */
> >> > #define REGISTER_VIRTUAL_TYPE(N) \
> >> > (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \
> >> > : ((N) == 32 /*SR*/) ? builtin_type_uint32 \
> >> > : ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \
> >> > - : builtin_type_int)
> >> > + : builtin_type_long_long)
> >> >
> >> > /* Force N32 ABI as the default. */
> >> > #define MIPS_DEFAULT_ABI MIPS_ABI_N32
> >> >
> >
> >>
> >> Kevin, this is wrong.
> >>
> >> It is no longer acceptable to add support for an additional sub-target
> >> using non-multi-arch mechanisms.
> >
> >
> > Does that mean that if we touch a macro, we have to multi-arch it?
>
> If you want to fix a bug in a macro then you should first (separatly)
> convert it to a macro/function pair. I believe this is accepted as
> ``current best pratice''.
>
> If you want to change a bunch of macros to support an additional
> architecture variant then they need to be multi-arch. GDB no longer
> accepts an architecture variants that isn't multi-arch.
>
> > For instance, if we touch the PUSH_ARGUMENTS function, and
> > PUSH_ARGUMENTS
> > hasn't been multi-arched, do we have to multi-arch it?
>
> If you mean mips_push_arguments, then that is already part of the
> multi-arch vector.
Umm... no it isn't. I can see why you think it is
(set_gdbarch_push_arguments is called), but the call to
PUSH_ARGUMENTS is still going thru the macro in tm-mips.h.
> Just don't forget that any changes to that function
> should be multi-arch friendly.
So I can use code similar to what is already there
(eg. "if (tdep->mips_abi == MIPS_ABI_N32)")
rather than splitting the function into variously
mips_n32_push_argument etc.?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] 64-bit support for Irix 6
2002-08-01 13:28 ` Andrew Cagney
@ 2002-08-01 16:17 ` Kevin Buettner
0 siblings, 0 replies; 11+ messages in thread
From: Kevin Buettner @ 2002-08-01 16:17 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
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;
}
}
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] 64-bit support for Irix 6
2002-08-01 14:47 ` Michael Snyder
@ 2002-08-01 16:38 ` Andrew Cagney
0 siblings, 0 replies; 11+ messages in thread
From: Andrew Cagney @ 2002-08-01 16:38 UTC (permalink / raw)
To: Michael Snyder, Kevin Buettner; +Cc: gdb-patches
> If you mean mips_push_arguments, then that is already part of the
>> multi-arch vector.
>
>
> Umm... no it isn't. I can see why you think it is
> (set_gdbarch_push_arguments is called), but the call to
> PUSH_ARGUMENTS is still going thru the macro in tm-mips.h.
I think the macro can be yanked. Not sure why it has remained.
>> Just don't forget that any changes to that function
>> should be multi-arch friendly.
>
>
> So I can use code similar to what is already there
> (eg. "if (tdep->mips_abi == MIPS_ABI_N32)")
> rather than splitting the function into variously
> mips_n32_push_argument etc.?
Adding ``if (.. == MIPS_ABI_N32)'' wouldn't be multi-arch unfriendly.
However, it would definitly be GDB developer/maintainer unfriendly. The
MIPS is held up as an example of how to not implement the push arguments
function.
If the MIPS doesn't support your new ABI then I think you are way better
off creating a new mips_ABI_push_arguments() function and model its
implementation on the Arm. Even cloning mips_push_arguments() and then
stripping out all the irrelenvant guff would be better.
That way you would be sure it didn't break any of the other ABIs.
enjoy,
Andrew
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2002-08-01 23:38 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-31 11:23 [PATCH] 64-bit support for Irix 6 Kevin Buettner
2002-08-01 8:11 ` Andrew Cagney
2002-08-01 9:53 ` Kevin Buettner
2002-08-01 10:42 ` Andrew Cagney
2002-08-01 13:08 ` Kevin Buettner
2002-08-01 13:28 ` Andrew Cagney
2002-08-01 16:17 ` Kevin Buettner
2002-08-01 13:54 ` Michael Snyder
2002-08-01 14:25 ` Andrew Cagney
2002-08-01 14:47 ` Michael Snyder
2002-08-01 16:38 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox