S390: Fix erroneous offset in fill_gregset

Message ID 87ppji54dh.fsf@br87z6lw.de.ibm.com
State Committed
Headers

Commit Message

Andreas Arnez May 13, 2014, 11:01 a.m. UTC
  This fixes a bug that leads to various failures when debugging a
31-bit inferior with a 64-bit gdb on s390x.

gdb/
	* s390-linux-nat.c (fill_gregset): Remove erroneous offset 4 in
	call to regcache_raw_collect.
---
 gdb/s390-linux-nat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Joel Brobecker May 13, 2014, 12:47 p.m. UTC | #1
> > gdb/
> > 	* s390-linux-nat.c (fill_gregset): Remove erroneous offset 4 in
> > 	call to regcache_raw_collect.
> 
> This is OK.
> 
> The fix probably ought to go to the 7.7 branch as well ...

We are not planning on making another release on the 7.7 branch
but it might still be good to have it there also, so no objection.
But if we backport the change, please make sure that a PR gets
created, and that an entry gets added to the 7.7 release wiki
page: https://sourceware.org/gdb/wiki/GDB_7.7_Release

I will create a "Fixes since GDB 7.7.1" section.

Thanks,
  
Andreas Arnez May 13, 2014, 2:02 p.m. UTC | #2
On Tue, May 13 2014, Joel Brobecker wrote:

>> > gdb/
>> > 	* s390-linux-nat.c (fill_gregset): Remove erroneous offset 4 in
>> > 	call to regcache_raw_collect.
>> 
>> This is OK.
>> 
>> The fix probably ought to go to the 7.7 branch as well ...
>
> We are not planning on making another release on the 7.7 branch
> but it might still be good to have it there also, so no objection.
> But if we backport the change, please make sure that a PR gets
> created, and that an entry gets added to the 7.7 release wiki
> page: https://sourceware.org/gdb/wiki/GDB_7.7_Release
>
> I will create a "Fixes since GDB 7.7.1" section.

OK, I created PR16940:

https://sourceware.org/bugzilla/show_bug.cgi?id=16940
  
Joel Brobecker May 13, 2014, 2:51 p.m. UTC | #3
> OK, I created PR16940:
> https://sourceware.org/bugzilla/show_bug.cgi?id=16940

Great, thanks! The only thing left to do, once the patch is backported,
is to add an entry in the wiki page I mentioned - the relevant section
has been added. I can do that for you if you're not sure or don't have
or want edit credentials.
  
Andreas Krebbel May 13, 2014, 3:07 p.m. UTC | #4
On 05/13/2014 01:01 PM, Andreas Arnez wrote:
> This fixes a bug that leads to various failures when debugging a
> 31-bit inferior with a 64-bit gdb on s390x.
> 
> gdb/
> 	* s390-linux-nat.c (fill_gregset): Remove erroneous offset 4 in
> 	call to regcache_raw_collect.
> ---
>  gdb/s390-linux-nat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
> index 5c38952..45db7c9 100644
> --- a/gdb/s390-linux-nat.c
> +++ b/gdb/s390-linux-nat.c
> @@ -164,7 +164,7 @@ fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno)
>  		  memset (p, 0, 4);
>  		  p += 4;
>  		}
> -	      regcache_raw_collect (regcache, reg, p + 4);
> +	      regcache_raw_collect (regcache, reg, p);
>  	    }
>  	}

I've committed the patch to mainline and gdb-7.7 branch. Thanks!

-Andreas-
  

Patch

diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
index 5c38952..45db7c9 100644
--- a/gdb/s390-linux-nat.c
+++ b/gdb/s390-linux-nat.c
@@ -164,7 +164,7 @@  fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno)
 		  memset (p, 0, 4);
 		  p += 4;
 		}
-	      regcache_raw_collect (regcache, reg, p + 4);
+	      regcache_raw_collect (regcache, reg, p);
 	    }
 	}