diff mbox

[v2,03/13] S390: Migrate to regcache_supply/collect_regset.

Message ID 87mwcaeus6.fsf@br87z6lw.de.ibm.com
State New
Headers show

Commit Message

Andreas Arnez July 15, 2014, 11:16 a.m. UTC
On Tue, Jul 15 2014, Ulrich Weigand wrote:

> This is OK, except that:
>
>> -const short s390_regmap_last_break[] =
>> -  {
>> -    0x04, S390_LAST_BREAK_REGNUM,
>> -    -1, -1
>> -  };
>> -
>> -const short s390x_regmap_last_break[] =
>> -  {
>> -    0x00, S390_LAST_BREAK_REGNUM,
>> -    -1, -1
>> -  };
>
> These two are deliberately different, but the replacements
> are identical:
>
>> +static const struct regcache_map_entry s390_regmap_last_break[] =
>> +  {
>> +    { 1, S390_LAST_BREAK_REGNUM },
>> +    { 0 }
>> +  };
>>  
>> +static const struct regcache_map_entry s390x_regmap_last_break[] =
>> +  {
>> +    { 1, S390_LAST_BREAK_REGNUM },
>> +    { 0 }
>> +  };
>
> That seems wrong, I think s390_regmap_last_break needs to
> skip the initial 4 bytes.

Good catch!  With my original patch the register was always shown as
zero for 31-bit ABI inferiors.  After the correction below we get real
values again.
diff mbox

Patch

diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index f67ba9c..a4e9342 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -445,6 +445,7 @@  static const struct regcache_map_entry s390_regmap_upper[] =
 
 static const struct regcache_map_entry s390_regmap_last_break[] =
   {
+    { 4, REGCACHE_MAP_SKIP_BYTES },
     { 1, S390_LAST_BREAK_REGNUM },
     { 0 }
   };