Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: Alan Hayward <Alan.Hayward@arm.com>,
		"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Remove MAX_REGISTER_SIZE from sol-thread.c
Date: Thu, 02 Mar 2017 09:52:00 -0000	[thread overview]
Message-ID: <CAH=s-PMGc+0xvBbDFdprZXje+OcAGN6S_RXbnob1uMLfG=Hdkw@mail.gmail.com> (raw)
In-Reply-To: <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 (齐尧)


      reply	other threads:[~2017-03-02  9:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24 10:12 Alan Hayward
2017-03-01 17:14 ` Yao Qi
2017-03-01 17:24   ` Frank Ch. Eigler
2017-03-01 18:35     ` Alan Hayward
2017-03-01 21:15       ` Yao Qi
     [not found]     ` <20170301211039.aagkvmdlkqn7jf5u@localhost>
2017-03-01 21:59       ` Frank Ch. Eigler
2017-03-02  9:52         ` Yao Qi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH=s-PMGc+0xvBbDFdprZXje+OcAGN6S_RXbnob1uMLfG=Hdkw@mail.gmail.com' \
    --to=qiyaoltc@gmail.com \
    --cc=Alan.Hayward@arm.com \
    --cc=fche@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox