[rfc] Eliminate current_regcache global variable
Daniel Jacobowitz
drow@false.org
Tue Jun 12 14:27:00 GMT 2007
On Tue, Jun 12, 2007 at 04:20:30PM +0200, Ulrich Weigand wrote:
> 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.
It will if ptrace fails, or remote communication (the stub crashes),
et cetera. Of course if either of those happens it will not much
matter what inferior_ptid is.
> > Why'd the return value go?
>
> That's already dead code, note the other "return" statement immediately
> before it ...
Whoops.
--
Daniel Jacobowitz
CodeSourcery
More information about the Gdb-patches
mailing list