From: Daniel Jacobowitz <drow@false.org>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc] Eliminate current_regcache global variable
Date: Tue, 12 Jun 2007 14:10:00 -0000 [thread overview]
Message-ID: <20070612141035.GF7815@caradoc.them.org> (raw)
In-Reply-To: <200706072119.l57LJJ3j030038@d12av02.megacenter.de.ibm.com>
On Thu, Jun 07, 2007 at 11:19:19PM +0200, Ulrich Weigand wrote:
> Hello,
>
> as a follow-on to the patch set eliminating read_register, this patch
> gets rid of the global current_regcache variable, and makes a first step
> into the direction of real per-thread register caches.
The idea sounds fine. I just looked at the Linux bits.
> diff -urNp gdb-orig/gdb/linux-nat.c gdb-head/gdb/linux-nat.c
> --- gdb-orig/gdb/linux-nat.c 2007-06-01 18:51:01.000000000 +0200
> +++ gdb-head/gdb/linux-nat.c 2007-06-06 19:49:08.553079253 +0200
> @@ -2580,19 +2580,26 @@ linux_nat_do_thread_registers (bfd *obfd
> gdb_fpxregset_t fpxregs;
> #endif
> unsigned long lwp = ptid_get_lwp (ptid);
> - struct gdbarch *gdbarch = current_gdbarch;
> + struct regcache *regcache = get_thread_regcache (ptid);
> + struct gdbarch *gdbarch = get_regcache_arch (regcache);
> const struct regset *regset;
> int core_regset_p;
> + ptid_t saved_ptid;
> +
> + saved_ptid = inferior_ptid;
> + inferior_ptid = ptid;
> + target_fetch_registers (regcache, -1);
> + inferior_ptid = saved_ptid;
Shouldn't we use a cleanup for this?
> @@ -2672,15 +2670,11 @@ static char *
> linux_nat_do_registers (bfd *obfd, ptid_t ptid,
> char *note_data, int *note_size)
> {
> - registers_changed ();
> - /* FIXME should not be necessary; fill_gregset should do it automatically. */
> - target_fetch_registers (current_regcache, -1);
> return linux_nat_do_thread_registers (obfd,
> ptid_build (ptid_get_pid (inferior_ptid),
> ptid_get_pid (inferior_ptid),
> 0),
> note_data, note_size);
> - return note_data;
> }
Why'd the return value go?
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2007-06-12 14:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-07 21:19 Ulrich Weigand
2007-06-12 14:10 ` Daniel Jacobowitz [this message]
2007-06-12 14:20 ` Ulrich Weigand
2007-06-12 14:27 ` Daniel Jacobowitz
2007-06-16 17:19 ` Ulrich Weigand
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=20070612141035.GF7815@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.com \
/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