This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] Eliminate current_regcache global variable
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: drow at false dot org (Daniel Jacobowitz)
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 12 Jun 2007 16:20:30 +0200 (CEST)
- Subject: Re: [rfc] Eliminate current_regcache global variable
Daniel Jacobowitz wrote:
> > + saved_ptid = inferior_ptid;
> > + inferior_ptid = ptid;
> > + target_fetch_registers (regcache, -1);
> > + inferior_ptid = saved_ptid;
>
> Shouldn't we use a cleanup for this?
I thought target_fetch_register would never throw an exception ...
But using the cleanup is probably cleaner anyway; I'll change 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?
That's already dead code, note the other "return" statement immediately
before it ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com