This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 8/11] Add FRV_MAX_REGISTER_SIZE
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, Alan Hayward <Alan dot Hayward at arm dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Wed, 3 May 2017 10:27:11 +0100
- Subject: Re: [PATCH 8/11] Add FRV_MAX_REGISTER_SIZE
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B05A761B8F
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B05A761B8F
- References: <3B3BD949-1C9D-44FF-AB6A-03091ECA49D0@arm.com> <867f2rw9br.fsf@gmail.com> <EBF2EEFF-20D5-43F3-B35D-5BB37C3CB153@arm.com> <22BD364F-A9A9-4E21-BC47-96A320760640@arm.com> <86d1bqba87.fsf@gmail.com>
On 05/03/2017 09:44 AM, Yao Qi wrote:
> Alan Hayward <Alan.Hayward@arm.com> writes:
>
> Hi Alan,
> regcache.c is updated, so please update your patch.
>
>> I considered making regcache_raw_supply_zero call regcache_raw_supply, but
>> in the end it made more sense to make it completely separate.
>
> You can call raw_supply (regnum, NULL) and then set the status to REG_VALID.
>
I think I agree with Alan -- if we defer to raw_supply, then I'd still prefer
that the memset is still done in regcache_raw_supply_zero, because whether
unavailable registers actually have a contents buffer at all is
implementation detail. We currently zero REG_UNVAILABLE registers in raw_supply,
but that could change. (And if we reuse raw_supply as is, then memset, we'll
memset twice.)
BTW, note that gdbserver has an equivalent function, called
"supply_register_zeroed".
Thanks,
Pedro Alves