[PATCH] Remove MAX_REGISTER_SIZE from sol-thread.c
Alan Hayward
Alan.Hayward@arm.com
Wed Mar 1 18:35:00 GMT 2017
> 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.
More information about the Gdb-patches
mailing list