From: Yao Qi <qiyaoltc@gmail.com>
To: Alan Hayward <Alan.Hayward@arm.com>
Cc: "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>,
fche@redhat.com
Subject: Re: [PATCH] Remove MAX_REGISTER_SIZE from sol-thread.c
Date: Wed, 01 Mar 2017 17:14:00 -0000 [thread overview]
Message-ID: <86d1e0rkam.fsf@gmail.com> (raw)
In-Reply-To: <9C2B8A71-1050-4B8B-A27A-C620E46AB9A2@arm.com> (Alan Hayward's message of "Fri, 24 Feb 2017 10:12:39 +0000")
Alan Hayward <Alan.Hayward@arm.com> writes:
> Regcache calls in sol-thread.c are bogus and do nothing.
> The code in between will not change or update regcache.
> Removed.
If we remove code, we need to figure out why the code was there.
The code is about to remove was added by
commit 7cdd6cac82faad2083029b2ac014d44d869f76c0
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Thu Apr 2 18:54:04 1998 +0000
* Fixes for PR 14571.
Thu Apr 2 12:47:41 1998 Frank Ch. Eigler <fche@cygnus.com>
* sol-thread.c (sol_thread_store_registers): Save & restore new
value of single updated register to prevent accidental clobbering.
and there was a global buffer "registers". However, the global buffer
no longer exists in current GDB, so the code is no longer needed, IMO.
Hi, Frank, do you remember how does your patch (above) fix the problem
you described in the ChangeLog? I don't see how p_td_thr_getgregs and
p_td_thr_getfpregs clobber the global buffer 'registers'.
> diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
> index a09a3ab9a8bc56f367e3ba1537f5674f0a7f491f..06b146c314a10be0e360a7242bab229ced1c00b1 100644
> --- a/gdb/sol-thread.c
> +++ b/gdb/sol-thread.c
> @@ -534,12 +534,6 @@ sol_thread_store_registers (struct target_ops *ops,
>
> if (regnum != -1)
> {
> - /* Not writing all the registers. */
> - char old_value[MAX_REGISTER_SIZE];
> -
> - /* Save new register value. */
> - regcache_raw_collect (regcache, regnum, old_value);
> -
> val = p_td_thr_getgregs (&thandle, gregset);
> if (val != TD_OK)
> error (_("sol_thread_store_registers: td_thr_getgregs %s"),
> @@ -548,9 +542,6 @@ sol_thread_store_registers (struct target_ops *ops,
> if (val != TD_OK)
> error (_("sol_thread_store_registers: td_thr_getfpregs %s"),
> td_err_string (val));
> -
> - /* Restore new register value. */
> - regcache_raw_supply (regcache, regnum, old_value);
--
Yao (齐尧)
next prev parent reply other threads:[~2017-03-01 17:14 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 [this message]
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
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=86d1e0rkam.fsf@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