From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9519 invoked by alias); 12 Jun 2007 14:20:41 -0000 Received: (qmail 9511 invoked by uid 22791); 12 Jun 2007 14:20:40 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate7.de.ibm.com (HELO mtagate7.de.ibm.com) (195.212.29.156) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 12 Jun 2007 14:20:34 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.13.8/8.13.8) with ESMTP id l5CEKVWu025070 for ; Tue, 12 Jun 2007 14:20:31 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l5CEKVEt3436654 for ; Tue, 12 Jun 2007 16:20:31 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l5CEKU5v031300 for ; Tue, 12 Jun 2007 16:20:31 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l5CEKUKG031296; Tue, 12 Jun 2007 16:20:30 +0200 Message-Id: <200706121420.l5CEKUKG031296@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 12 Jun 2007 16:20:30 +0200 Subject: Re: [rfc] Eliminate current_regcache global variable To: drow@false.org (Daniel Jacobowitz) Date: Tue, 12 Jun 2007 14:20:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <20070612141035.GF7815@caradoc.them.org> from "Daniel Jacobowitz" at Jun 12, 2007 10:10:35 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00164.txt.bz2 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