1 Oct 2010 03:51
Re: PATCH: gdbserver: Clear regcache if buf is NULL
H.J. Lu <hjl.tools <at> gmail.com>
2010-10-01 01:51:07 GMT
2010-10-01 01:51:07 GMT
On Tue, Sep 28, 2010 at 1:23 PM, Pedro Alves <pedro <at> codesourcery.com> wrote:
> On Wednesday 03 February 2010 17:44:14, H.J. Lu wrote:
>> If xstate_bv bits are zero, XSAVE extended state is in init state and
>> gdbserver should treat XMM/YMM registers as 0. This patch clears regcache
>> if buf is NULL. OK to install?
>>
>> Thanks.
>>
>>
>> H.J.
>> ---
>> 2010-02-03 H.J. Lu <hongjiu.lu <at> intel.com>
>>
>> * regcache.c (supply_register): Clear regcache if buf is NULL.
>>
>> diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c
>> index 2082604..d6cdc46 100644
>> --- a/gdb/gdbserver/regcache.c
>> +++ b/gdb/gdbserver/regcache.c
>> <at> <at> -215,7 +215,10 <at> <at> register_data (struct regcache *regcache, int n, int fetch)
>> void
>> supply_register (struct regcache *regcache, int n, const void *buf)
>> {
>> - memcpy (register_data (regcache, n, 0), buf, register_size (n));
>> + if (buf)
>> + memcpy (register_data (regcache, n, 0), buf, register_size (n));
>> + else
>> + memset (register_data (regcache, n, 0), 0, register_size (n));
>> }
>
(Continue reading)
RSS Feed