Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] MIPS/gdbserver: Fix $f9 access
@ 2011-11-17 20:32 Maciej W. Rozycki
  2011-11-17 20:39 ` Stan Shebs
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej W. Rozycki @ 2011-11-17 20:32 UTC (permalink / raw)
  To: gdb-patches

Hi,

 The following change fixes a problem where $f8 is accessed whenever $f9 
is requested.  The bug has always been there, since MIPS support was added 
back in 2002.  I guess nobody uses gdbserver with MIPS FPU, oh well...

 OK to apply?

2011-11-17  Maciej W. Rozycki  <macro@codesourcery.com>

	gdb/gdbserver/
	* linux-mips-low.c (mips_regmap): Correct the index of $f9.

  Maciej

gdb-gdbserver-linux-mips-fpr-fix.diff
Index: gdb-fsf-trunk-quilt/gdb/gdbserver/linux-mips-low.c
===================================================================
--- gdb-fsf-trunk-quilt.orig/gdb/gdbserver/linux-mips-low.c	2011-11-17 20:10:51.000000000 +0000
+++ gdb-fsf-trunk-quilt/gdb/gdbserver/linux-mips-low.c	2011-11-17 20:11:44.995624756 +0000
@@ -63,7 +63,7 @@ static int mips_regmap[] = {
 
   FPR_BASE,      FPR_BASE + 1,  FPR_BASE + 2,  FPR_BASE + 3,
   FPR_BASE + 4,  FPR_BASE + 5,  FPR_BASE + 6,  FPR_BASE + 7,
-  FPR_BASE + 8,  FPR_BASE + 8,  FPR_BASE + 10, FPR_BASE + 11,
+  FPR_BASE + 8,  FPR_BASE + 9,  FPR_BASE + 10, FPR_BASE + 11,
   FPR_BASE + 12, FPR_BASE + 13, FPR_BASE + 14, FPR_BASE + 15,
   FPR_BASE + 16, FPR_BASE + 17, FPR_BASE + 18, FPR_BASE + 19,
   FPR_BASE + 20, FPR_BASE + 21, FPR_BASE + 22, FPR_BASE + 23,


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

* Re: [PATCH] MIPS/gdbserver: Fix $f9 access
  2011-11-17 20:32 [PATCH] MIPS/gdbserver: Fix $f9 access Maciej W. Rozycki
@ 2011-11-17 20:39 ` Stan Shebs
  2012-02-24 16:28   ` Maciej W. Rozycki
  0 siblings, 1 reply; 3+ messages in thread
From: Stan Shebs @ 2011-11-17 20:39 UTC (permalink / raw)
  To: gdb-patches

On 11/17/11 12:32 PM, Maciej W. Rozycki wrote:
> Hi,
>
>   The following change fixes a problem where $f8 is accessed whenever $f9
> is requested.  The bug has always been there, since MIPS support was added
> back in 2002.  I guess nobody uses gdbserver with MIPS FPU, oh well...

Probably truer than we would like to think. :-)

>
>   OK to apply?

Yep, looks fine.

It would be cool to have a testsuite case that exercises this, but let's 
be honest, that's more work than it would be worth.

Stan

>
> 2011-11-17  Maciej W. Rozycki<macro@codesourcery.com>
>
> 	gdb/gdbserver/
> 	* linux-mips-low.c (mips_regmap): Correct the index of $f9.
>
>    Maciej
>
> gdb-gdbserver-linux-mips-fpr-fix.diff
> Index: gdb-fsf-trunk-quilt/gdb/gdbserver/linux-mips-low.c
> ===================================================================
> --- gdb-fsf-trunk-quilt.orig/gdb/gdbserver/linux-mips-low.c	2011-11-17 20:10:51.000000000 +0000
> +++ gdb-fsf-trunk-quilt/gdb/gdbserver/linux-mips-low.c	2011-11-17 20:11:44.995624756 +0000
> @@ -63,7 +63,7 @@ static int mips_regmap[] = {
>
>     FPR_BASE,      FPR_BASE + 1,  FPR_BASE + 2,  FPR_BASE + 3,
>     FPR_BASE + 4,  FPR_BASE + 5,  FPR_BASE + 6,  FPR_BASE + 7,
> -  FPR_BASE + 8,  FPR_BASE + 8,  FPR_BASE + 10, FPR_BASE + 11,
> +  FPR_BASE + 8,  FPR_BASE + 9,  FPR_BASE + 10, FPR_BASE + 11,
>     FPR_BASE + 12, FPR_BASE + 13, FPR_BASE + 14, FPR_BASE + 15,
>     FPR_BASE + 16, FPR_BASE + 17, FPR_BASE + 18, FPR_BASE + 19,
>     FPR_BASE + 20, FPR_BASE + 21, FPR_BASE + 22, FPR_BASE + 23,
>


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

* Re: [PATCH] MIPS/gdbserver: Fix $f9 access
  2011-11-17 20:39 ` Stan Shebs
@ 2012-02-24 16:28   ` Maciej W. Rozycki
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2012-02-24 16:28 UTC (permalink / raw)
  To: Stan Shebs; +Cc: gdb-patches

Hi Stan,

 I missed your reply, sorry, it wasn't cc-ed to me directly.

On Thu, 17 Nov 2011, Stan Shebs wrote:

> >   The following change fixes a problem where $f8 is accessed whenever $f9
> > is requested.  The bug has always been there, since MIPS support was added
> > back in 2002.  I guess nobody uses gdbserver with MIPS FPU, oh well...
> 
> Probably truer than we would like to think. :-)

 I have meanwhile realised what happened here -- this is traditional 
ptrace POKEUSR/PEEKUSR code while the MIPS target has used regsets for a 
while now.

> >   OK to apply?
> 
> Yep, looks fine.

 Applied now, thanks.

> It would be cool to have a testsuite case that exercises this, but let's be
> honest, that's more work than it would be worth.

 An ancient Linux kernel that does not support regsets would be required 
for that or something.  Or an option for gdbserver to refrain from using 
them.  And that appears problematic too since $zero has special treatment 
now (see mips_cannot_store_register; the slot is reused for that weird 
syscall "restart" register) and further changes would be required in 
generic code to handle that correctly.  Not worth the effort IMO unless 
something changes causing these bits to be required again.

> > 2011-11-17  Maciej W. Rozycki<macro@codesourcery.com>
> > 
> > 	gdb/gdbserver/
> > 	* linux-mips-low.c (mips_regmap): Correct the index of $f9.
> > 
> >    Maciej
> > 
> > gdb-gdbserver-linux-mips-fpr-fix.diff
> > Index: gdb-fsf-trunk-quilt/gdb/gdbserver/linux-mips-low.c
> > ===================================================================
> > --- gdb-fsf-trunk-quilt.orig/gdb/gdbserver/linux-mips-low.c	2011-11-17
> > 20:10:51.000000000 +0000
> > +++ gdb-fsf-trunk-quilt/gdb/gdbserver/linux-mips-low.c	2011-11-17
> > 20:11:44.995624756 +0000
> > @@ -63,7 +63,7 @@ static int mips_regmap[] = {
> > 
> >     FPR_BASE,      FPR_BASE + 1,  FPR_BASE + 2,  FPR_BASE + 3,
> >     FPR_BASE + 4,  FPR_BASE + 5,  FPR_BASE + 6,  FPR_BASE + 7,
> > -  FPR_BASE + 8,  FPR_BASE + 8,  FPR_BASE + 10, FPR_BASE + 11,
> > +  FPR_BASE + 8,  FPR_BASE + 9,  FPR_BASE + 10, FPR_BASE + 11,
> >     FPR_BASE + 12, FPR_BASE + 13, FPR_BASE + 14, FPR_BASE + 15,
> >     FPR_BASE + 16, FPR_BASE + 17, FPR_BASE + 18, FPR_BASE + 19,
> >     FPR_BASE + 20, FPR_BASE + 21, FPR_BASE + 22, FPR_BASE + 23,

  Maciej


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

end of thread, other threads:[~2012-02-24 16:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-17 20:32 [PATCH] MIPS/gdbserver: Fix $f9 access Maciej W. Rozycki
2011-11-17 20:39 ` Stan Shebs
2012-02-24 16:28   ` Maciej W. Rozycki

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