This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Remove MAX_REGISTER_SIZE from sol-thread.c
- From: Alan Hayward <Alan dot Hayward at arm dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Wed, 1 Mar 2017 18:35:36 +0000
- Subject: Re: [PATCH] Remove MAX_REGISTER_SIZE from sol-thread.c
- Authentication-results: sourceware.org; auth=none
- Authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=arm.com;
- Nodisclaimer: True
- References: <9C2B8A71-1050-4B8B-A27A-C620E46AB9A2@arm.com> <86d1e0rkam.fsf@gmail.com> <20170301172400.GM7871@redhat.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
> On 1 Mar 2017, at 17:24, Frank Ch. Eigler <fche@redhat.com> wrote:
>
> Hi -
>
>>
>>> Regcache calls in sol-thread.c are bogus and do nothing.
>>> The code in between will not change or update regcache.
>>> Removed.
>>
>> If we remove code, we need to figure out why the code was there.
>> The code is about to remove was added by
>>
>> commit 7cdd6cac82faad2083029b2ac014d44d869f76c0
>> Author: Frank Ch. Eigler <fche@redhat.com>
>> Date: Thu Apr 2 18:54:04 1998 +0000
>>
>> * Fixes for PR 14571.
>> [...]
>
> Heh, sorry, my recollection of this after 19 years is totally blank.
>
> Interestingly, PR14571 must refer to the pre-bugzilla bug tracker
> system. There was one on sourceware.org, but its web interface is no
> longer operating, and scraps of the database files that are still
> archived seem not to go up to 14571. Likewise, no google hits.
>
> So I'm at a loss, can't find orginal supporting data either, and
> that's a bummer.
>
> - FChE
Reading both the 1998 patch and the code today, it looks to me like the
patch never adding anything.
Unless I’m missing something, the code is doing:
If only backing if 1 register to kernel
then
*Backup the register in regcache into local var old_value.
Read all general registers from kernel into local var gregset.
Read all fp registers from kernel into local var fpregset.
*Restore the register from local var old_value back to regcache.
EndIf
Copy 1 or all general registers from regcache into local var gregset.
Copy 1 or all fp registers from regcache into local var fpregset.
Store gregset to kernel.
Store fpregset to kernel.
Where the lines with the * are the lines no required.
If people are unsure, I’m happy to keep the code and replace the array
with std::vector (or anything else).
Alan.