From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31665 invoked by alias); 7 Jun 2007 20:58:37 -0000 Received: (qmail 31656 invoked by uid 22791); 7 Jun 2007 20:58:36 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate4.de.ibm.com (HELO mtagate4.de.ibm.com) (195.212.29.153) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 07 Jun 2007 20:58:34 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.13.8/8.13.8) with ESMTP id l57KwWEv185770 for ; Thu, 7 Jun 2007 20:58:32 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 l57KwVUA3915946 for ; Thu, 7 Jun 2007 22:58: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 l57KwVW9019803 for ; Thu, 7 Jun 2007 22:58: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 l57KwV3u019800 for ; Thu, 7 Jun 2007 22:58:31 +0200 Message-Id: <200706072058.l57KwV3u019800@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 7 Jun 2007 22:58:31 +0200 Subject: [rfc][4/13] Eliminate read_register: read_register in deprecated_mips_set_processor_regs_hack To: gdb-patches@sourceware.org Date: Thu, 07 Jun 2007 20:58:00 -0000 From: "Ulrich Weigand" 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/msg00083.txt.bz2 Hello, one more weird global register access in a tdep file: deprecated_mips_set_processor_regs_hack in mips-tdep.c. (Not sure if this is still required, or if it could be replaced by the new XML register mechanism ...) To be able to continue elimination of read_register, this patch simply inlines the definition and reads from current_regcache. This should obviously have no change in behaviour. Bye, Ulrich ChangeLog: * mips-tdep.c (deprecated_mips_set_processor_regs_hack): Read from current regcache instead of calling read_register. diff -urNp gdb-orig/gdb/mips-tdep.c gdb-head/gdb/mips-tdep.c --- gdb-orig/gdb/mips-tdep.c 2007-06-06 18:57:02.982185081 +0200 +++ gdb-head/gdb/mips-tdep.c 2007-06-06 18:56:16.508824426 +0200 @@ -4314,10 +4314,10 @@ void deprecated_mips_set_processor_regs_hack (void) { struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - CORE_ADDR prid; - - prid = read_register (MIPS_PRID_REGNUM); + ULONGEST prid; + regcache_cooked_read_unsigned (current_regcache, + MIPS_PRID_REGNUM, &prid); if ((prid & ~0xf) == 0x700) tdep->mips_processor_reg_names = mips_r3041_reg_names; } -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com