This is the mail archive of the
mailing list for the GDB project.
Re: [rfc] Eliminate current_regcache global variable
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 ...