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: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: arnez at linux dot vnet dot ibm dot com (Andreas Arnez)
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 10 Dec 2014 20:13:50 +0100 (CET)
- Subject: Re: [PATCH v3 2/3] gdbserver: Prevent stale/random values in register cache
- Authentication-results: sourceware.org; auth=none
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.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com