From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4914 invoked by alias); 18 Jun 2007 17:48:43 -0000 Received: (qmail 4902 invoked by uid 22791); 18 Jun 2007 17:48:42 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate2.de.ibm.com (HELO mtagate2.de.ibm.com) (195.212.29.151) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 18 Jun 2007 17:48:40 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.8/8.13.8) with ESMTP id l5IHmbEA157190 for ; Mon, 18 Jun 2007 17:48:37 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 l5IHmbec4087908 for ; Mon, 18 Jun 2007 19:48:37 +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 l5IHmaGZ018538 for ; Mon, 18 Jun 2007 19:48:36 +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 l5IHmaZN018535; Mon, 18 Jun 2007 19:48:36 +0200 Message-Id: <200706181748.l5IHmaZN018535@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 18 Jun 2007 19:48:36 +0200 Subject: Re: [rfc] Remove macros {SP,PC,PS,FP0}_REGNUM from gdbarch.sh To: deuling@de.ibm.com (Markus Deuling) Date: Mon, 18 Jun 2007 17:48:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (GDB Patches) In-Reply-To: <467629FA.7030204@de.ibm.com> from "Markus Deuling" at Jun 18, 2007 08:45:14 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/msg00337.txt.bz2 Markus Deuling wrote: > there were lots of changes to various parts of GDB so it was necessary to rebase the REGNUM patch. So here it > is again. Build and tested on x86. Build with gdb_mbuild.sh Thanks for re-doing that patch. It looks like a small number of places were overlooked; I've now committed this patch together with those (see patch below). Longer-term, most uses of those gdbarch callbacks -in particular those in platform-specific code- are probably bogus and should be removed. But that's a different issue ... Bye, Ulrich diff -urNp gdb-orig/gdb/core-regset.c gdb-head/gdb/core-regset.c --- gdb-orig/gdb/core-regset.c 2007-06-18 19:36:30.333801855 +0200 +++ gdb-head/gdb/core-regset.c 2007-06-18 19:33:09.217153836 +0200 @@ -85,7 +85,7 @@ fetch_core_registers (struct regcache *r else { memcpy (&fpregset, core_reg_sect, sizeof (fpregset)); - if (FP0_REGNUM >= 0) + if (gdbarch_fp0_regnum (current_gdbarch) >= 0) supply_fpregset (regcache, (const gdb_fpregset_t *) &fpregset); } break; diff -urNp gdb-orig/gdb/i386v4-nat.c gdb-head/gdb/i386v4-nat.c --- gdb-orig/gdb/i386v4-nat.c 2007-06-18 19:36:30.475781429 +0200 +++ gdb-head/gdb/i386v4-nat.c 2007-06-18 19:32:49.853013932 +0200 @@ -139,7 +139,7 @@ fill_gregset (const struct regcache *reg void supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp) { - if (FP0_REGNUM == 0) + if (gdbarch_fp0_regnum (current_gdbarch) == 0) return; i387_supply_fsave (regcache, -1, fpregsetp); @@ -153,7 +153,7 @@ void fill_fpregset (const struct regcache *regcache, fpregset_t *fpregsetp, int regno) { - if (FP0_REGNUM == 0) + if (gdbarch_fp0_regnum (current_gdbarch) == 0) return; i387_collect_fsave (regcache, regno, fpregsetp); diff -urNp gdb-orig/gdb/libunwind-frame.c gdb-head/gdb/libunwind-frame.c --- gdb-orig/gdb/libunwind-frame.c 2007-06-18 19:36:30.505777114 +0200 +++ gdb-head/gdb/libunwind-frame.c 2007-06-18 19:31:19.648301803 +0200 @@ -179,7 +179,7 @@ libunwind_frame_cache (struct frame_info } /* To get base address, get sp from previous frame. */ - uw_sp_regnum = descr->gdb2uw (SP_REGNUM); + uw_sp_regnum = descr->gdb2uw (gdbarch_sp_regnum (current_gdbarch)); ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &fp); if (ret < 0) { diff -urNp gdb-orig/gdb/mips-linux-tdep.c gdb-head/gdb/mips-linux-tdep.c --- gdb-orig/gdb/mips-linux-tdep.c 2007-06-18 19:36:35.255759461 +0200 +++ gdb-head/gdb/mips-linux-tdep.c 2007-06-18 19:32:08.925656282 +0200 @@ -1067,7 +1067,8 @@ mips_linux_n32n64_sigframe_init (const s static void mips_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) { - regcache_cooked_write_unsigned (regcache, PC_REGNUM, pc); + regcache_cooked_write_unsigned (regcache, + gdbarch_pc_regnum (current_gdbarch), pc); /* Clear the syscall restart flag. */ if (mips_linux_restart_reg_p (current_gdbarch)) -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com