Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] mips-tdep.c: Set mips_default_saved_regsize to 8 for N32
@ 2002-07-31 16:02 Kevin Buettner
  2002-07-31 16:16 ` Michael Snyder
  2002-08-01 17:11 ` Michael Snyder
  0 siblings, 2 replies; 6+ messages in thread
From: Kevin Buettner @ 2002-07-31 16:02 UTC (permalink / raw)
  To: gdb-patches

For the N32 ABI, registers are 64 bits wide, and all 64-bits are
sometimes used for certain data types (e.g. when passing structs). 
So, when a register is saved in a function prologue, it is necessary
to save all 64 bits of the register.  I've verified this by looking at
some function prologues created by SGI's compiler; the "sd" (which
saves the entire 64-bit register) instruction is used to save
registers.

With this change in place, the following FAILs are fixed for n32:

FAIL: gdb.base/call-ar-st.exp: print print_small_structs, pattern 1
FAIL: gdb.base/call-ar-st.exp: print print_ten_doubles, pattern 5 + sentinel
FAIL: gdb.base/call-ar-st.exp: print print_small_structs from print_long_arg_list, pattern 1
FAIL: gdb.base/call-ar-st.exp: print print_bit_flags_combo from init_bit_flags_combo
FAIL: gdb.base/call-ar-st.exp: print print_long_arg_list, pattern 7
FAIL: gdb.base/call-ar-st.exp: print sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)
FAIL: gdb.base/call-ar-st.exp: print print_struct_rep(*struct1, *struct2, *struct3), pattern 2
FAIL: gdb.base/call-ar-st.exp: print print_one_large_struct(*list1)

Okay to commit?

	* mips-tdep.c (mips_gdbarch_init): For the N32 ABI, set
	mips_default_saved_regsize to 8.

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	31 Jul 2002 22:34:59 -0000
@@ -4480,7 +4480,7 @@ mips_gdbarch_init (struct gdbarch_info i
       set_gdbarch_long_long_bit (gdbarch, 64);
       break;
     case MIPS_ABI_N32:
-      tdep->mips_default_saved_regsize = 4;
+      tdep->mips_default_saved_regsize = 8;
       tdep->mips_default_stack_argsize = 8;
       tdep->mips_fp_register_double = 1;
       tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA] mips-tdep.c: Set mips_default_saved_regsize to 8 for N32
  2002-07-31 16:02 [RFA] mips-tdep.c: Set mips_default_saved_regsize to 8 for N32 Kevin Buettner
@ 2002-07-31 16:16 ` Michael Snyder
  2002-08-01 17:11 ` Michael Snyder
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Snyder @ 2002-07-31 16:16 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

Kevin Buettner wrote:
> 
> For the N32 ABI, registers are 64 bits wide, and all 64-bits are
> sometimes used for certain data types (e.g. when passing structs).
> So, when a register is saved in a function prologue, it is necessary
> to save all 64 bits of the register.  I've verified this by looking at
> some function prologues created by SGI's compiler; the "sd" (which
> saves the entire 64-bit register) instruction is used to save
> registers.
> 
> With this change in place, the following FAILs are fixed for n32:
> 
> FAIL: gdb.base/call-ar-st.exp: print print_small_structs, pattern 1
> FAIL: gdb.base/call-ar-st.exp: print print_ten_doubles, pattern 5 + sentinel
> FAIL: gdb.base/call-ar-st.exp: print print_small_structs from print_long_arg_list, pattern 1
> FAIL: gdb.base/call-ar-st.exp: print print_bit_flags_combo from init_bit_flags_combo
> FAIL: gdb.base/call-ar-st.exp: print print_long_arg_list, pattern 7
> FAIL: gdb.base/call-ar-st.exp: print sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)
> FAIL: gdb.base/call-ar-st.exp: print print_struct_rep(*struct1, *struct2, *struct3), pattern 2
> FAIL: gdb.base/call-ar-st.exp: print print_one_large_struct(*list1)
> 
> Okay to commit?

I've been testing it on the n32, and it seems to work for me.



> 
>         * mips-tdep.c (mips_gdbarch_init): For the N32 ABI, set
>         mips_default_saved_regsize to 8.
> 
> 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 31 Jul 2002 22:34:59 -0000
> @@ -4480,7 +4480,7 @@ mips_gdbarch_init (struct gdbarch_info i
>        set_gdbarch_long_long_bit (gdbarch, 64);
>        break;
>      case MIPS_ABI_N32:
> -      tdep->mips_default_saved_regsize = 4;
> +      tdep->mips_default_saved_regsize = 8;
>        tdep->mips_default_stack_argsize = 8;
>        tdep->mips_fp_register_double = 1;
>        tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA] mips-tdep.c: Set mips_default_saved_regsize to 8 for N32
  2002-07-31 16:02 [RFA] mips-tdep.c: Set mips_default_saved_regsize to 8 for N32 Kevin Buettner
  2002-07-31 16:16 ` Michael Snyder
@ 2002-08-01 17:11 ` Michael Snyder
  2002-08-01 17:23   ` Kevin Buettner
  2002-08-05 20:14   ` Andrew Cagney
  1 sibling, 2 replies; 6+ messages in thread
From: Michael Snyder @ 2002-08-01 17:11 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches, cagney

Kevin Buettner wrote:
> 
> For the N32 ABI, registers are 64 bits wide, and all 64-bits are
> sometimes used for certain data types (e.g. when passing structs).
> So, when a register is saved in a function prologue, it is necessary
> to save all 64 bits of the register.  I've verified this by looking at
> some function prologues created by SGI's compiler; the "sd" (which
> saves the entire 64-bit register) instruction is used to save
> registers.
> 
> With this change in place, the following FAILs are fixed for n32:

That's all?  When I tried it, it fixed almost 300 fails for me, 
and caused only one (possible) regression.

Andrew, I'd recommend this one for approval.  Surely setting
it to 4 for N32 was an oversight?

Michael

> 
> FAIL: gdb.base/call-ar-st.exp: print print_small_structs, pattern 1
> FAIL: gdb.base/call-ar-st.exp: print print_ten_doubles, pattern 5 + sentinel
> FAIL: gdb.base/call-ar-st.exp: print print_small_structs from print_long_arg_list, pattern 1
> FAIL: gdb.base/call-ar-st.exp: print print_bit_flags_combo from init_bit_flags_combo
> FAIL: gdb.base/call-ar-st.exp: print print_long_arg_list, pattern 7
> FAIL: gdb.base/call-ar-st.exp: print sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)
> FAIL: gdb.base/call-ar-st.exp: print print_struct_rep(*struct1, *struct2, *struct3), pattern 2
> FAIL: gdb.base/call-ar-st.exp: print print_one_large_struct(*list1)
> 
> Okay to commit?
> 
>         * mips-tdep.c (mips_gdbarch_init): For the N32 ABI, set
>         mips_default_saved_regsize to 8.
> 
> 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 31 Jul 2002 22:34:59 -0000
> @@ -4480,7 +4480,7 @@ mips_gdbarch_init (struct gdbarch_info i
>        set_gdbarch_long_long_bit (gdbarch, 64);
>        break;
>      case MIPS_ABI_N32:
> -      tdep->mips_default_saved_regsize = 4;
> +      tdep->mips_default_saved_regsize = 8;
>        tdep->mips_default_stack_argsize = 8;
>        tdep->mips_fp_register_double = 1;
>        tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA] mips-tdep.c: Set mips_default_saved_regsize to 8 for N32
  2002-08-01 17:11 ` Michael Snyder
@ 2002-08-01 17:23   ` Kevin Buettner
  2002-08-05 20:14   ` Andrew Cagney
  1 sibling, 0 replies; 6+ messages in thread
From: Kevin Buettner @ 2002-08-01 17:23 UTC (permalink / raw)
  To: Michael Snyder, Kevin Buettner; +Cc: gdb-patches, cagney

On Aug 1,  4:53pm, Michael Snyder wrote:

> > With this change in place, the following FAILs are fixed for n32:
> 
> That's all?  When I tried it, it fixed almost 300 fails for me, 
> and caused only one (possible) regression.

This change was more critical than I remembered.  You're right, it
does fix a lot more failures than I listed.

Kevin


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA] mips-tdep.c: Set mips_default_saved_regsize to 8 for N32
  2002-08-01 17:11 ` Michael Snyder
  2002-08-01 17:23   ` Kevin Buettner
@ 2002-08-05 20:14   ` Andrew Cagney
  2002-08-06 12:04     ` Kevin Buettner
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2002-08-05 20:14 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Kevin Buettner, gdb-patches, cagney

> With this change in place, the following FAILs are fixed for n32:
> 
> 
> That's all?  When I tried it, it fixed almost 300 fails for me, 
> and caused only one (possible) regression.
> 
> Andrew, I'd recommend this one for approval.  Surely setting
> it to 4 for N32 was an oversight?

I'd suspect a multi-arch conversion error.

Yes, ok.  It is definitly more correct then ``4''.

Andrew



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA] mips-tdep.c: Set mips_default_saved_regsize to 8 for N32
  2002-08-05 20:14   ` Andrew Cagney
@ 2002-08-06 12:04     ` Kevin Buettner
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Buettner @ 2002-08-06 12:04 UTC (permalink / raw)
  To: Andrew Cagney, Michael Snyder; +Cc: gdb-patches

On Aug 5, 11:14pm, Andrew Cagney wrote:

> > With this change in place, the following FAILs are fixed for n32:
> > 
> > 
> > That's all?  When I tried it, it fixed almost 300 fails for me, 
> > and caused only one (possible) regression.
> > 
> > Andrew, I'd recommend this one for approval.  Surely setting
> > it to 4 for N32 was an oversight?
> 
> I'd suspect a multi-arch conversion error.
> 
> Yes, ok.  It is definitly more correct then ``4''.

Committed.

Kevin


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-08-06 19:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-31 16:02 [RFA] mips-tdep.c: Set mips_default_saved_regsize to 8 for N32 Kevin Buettner
2002-07-31 16:16 ` Michael Snyder
2002-08-01 17:11 ` Michael Snyder
2002-08-01 17:23   ` Kevin Buettner
2002-08-05 20:14   ` Andrew Cagney
2002-08-06 12:04     ` Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox