This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 03/13] S390: Migrate to regcache_supply/collect_regset.
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 15 Jul 2014 13:16:57 +0200
- Subject: Re: [PATCH v2 03/13] S390: Migrate to regcache_supply/collect_regset.
- Authentication-results: sourceware.org; auth=none
- References: <201407150906 dot s6F96DA5005632 at d06av02 dot portsmouth dot uk dot ibm dot com>
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 }
};