This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3 2/3] gdbserver: Prevent stale/random values in register cache
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 11 Dec 2014 18:04:55 +0100
- Subject: Re: [PATCH v3 2/3] gdbserver: Prevent stale/random values in register cache
- Authentication-results: sourceware.org; auth=none
- References: <201412101913 dot sBAJDpc9007580 at d03av02 dot boulder dot ibm dot com>
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.