This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Remove MAX_REGISTER_SIZE from sol-thread.c
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: Alan Hayward <Alan dot Hayward at arm dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 2 Mar 2017 09:52:31 +0000
- Subject: Re: [PATCH] Remove MAX_REGISTER_SIZE from sol-thread.c
- Authentication-results: sourceware.org; auth=none
- References: <9C2B8A71-1050-4B8B-A27A-C620E46AB9A2@arm.com> <86d1e0rkam.fsf@gmail.com> <20170301172400.GM7871@redhat.com> <20170301211039.aagkvmdlkqn7jf5u@localhost> <20170301215928.GP7871@redhat.com>
On Wed, Mar 1, 2017 at 9:59 PM, Frank Ch. Eigler <fche@redhat.com> wrote:
> Hold on! Personal email archives to the rescue. gdb/14571 was an
> internal Cygnus PRMS bug number. This was solaris 2.5.1 era.
>
> Here are some excerpts from emails on the topic. Please excuse the
> goofy "autoethnography", I'm just so weirdly gratified to have found
> some traces of this old work!
>
They look great.
> ------------------------------------------------------------------------
>
> The problem was caused by sol-thread.c's inability to write to
> individual registers in the target. The updated value got lost in
> sol_thread_store_registers before being written out. The following
> patch corrects the problem.
> - a bug in the threads/procfs code caused the register cache
> to be invalidated (re-read), if not all registers were
> desired to be updated
Now, I understand the problem you fixed 19 years ago. That is,
before we write out the new value in global buffer "registers", we have
p_td_thr_getgregs call, like this,
val = p_td_thr_getgregs (&thandle, regset);
if (val != TD_OK)
error ("sol_thread_store_registers: td_thr_getgregs %s",
td_err_string (val));
val = p_td_thr_getfpregs (&thandle, &fpregset);
if (val != TD_OK)
error ("sol_thread_store_registers: td_thr_getfpregs %s",
td_err_string (val));
td_thr_getgregs in thread_db calls ps_lgetregs (in sol-threads.c) which
fetches registers again and save it in global buffer "registers" (in
findvar.c:supply_register), so that the new value to be written out in
"registers" is lost. The save/restore across td_thr_getgregs/td_thr_getfpregs
fixes this problem.
Nowadays, we don't have the global buffer any more, so the save/restore
is no longer needed.
--
Yao (齐尧)