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

Andreas Arnez
2014-07-15T11:17:14Z

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 --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 }
};