This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3 2/3] gdbserver: Prevent stale/random values in register cache


On Wed, Dec 10 2014, Ulrich Weigand wrote:

> Andreas Arnez wrote:
>
>> @@ -52,6 +52,11 @@ get_thread_regcache (struct thread_info *thread, int fetch)
>>        struct thread_info *saved_thread = current_thread;
>>  
>>        current_thread = thread;
>> +#ifndef IN_PROCESS_AGENT
>> +      /* Invalidate all registers, to prevent stale left-overs.  */
>> +      memset (regcache->register_status, REG_UNAVAILABLE,
>> +	      regcache->tdesc->num_registers);
>> +#endif
>>        fetch_inferior_registers (regcache, -1);
>>        current_thread = saved_thread;
>>        regcache->registers_valid = 1;
>
> The whole get_thread_regcache routine is already under #ifndef IN_PROCESS_AGENT,
> so the ifdef seems redundant here.

Correct ;-)  Will be removed in the next version.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]