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] Remove MAX_REGISTER_SIZE from sol-thread.c


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 (齐尧)


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