From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24767 invoked by alias); 20 May 2003 23:56:49 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24756 invoked from network); 20 May 2003 23:56:49 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 20 May 2003 23:56:49 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h4KNunH21628 for ; Tue, 20 May 2003 19:56:49 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h4KNunI15742 for ; Tue, 20 May 2003 19:56:49 -0400 Received: from localhost.localdomain (vpn50-3.rdu.redhat.com [172.16.50.3]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h4KNumo17933 for ; Tue, 20 May 2003 19:56:48 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h4KNugK03933 for gdb-patches@sources.redhat.com; Tue, 20 May 2003 16:56:42 -0700 Date: Tue, 20 May 2003 23:56:00 -0000 From: Kevin Buettner Message-Id: <1030520235642.ZM3932@localhost.localdomain> To: gdb-patches@sources.redhat.com Subject: [PATCH] mips-nat.c: Convert REGISTER_PTRACE_ADDR into a function MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-05/txt/msg00379.txt.bz2 I've just committed the patch below. * mips-nat.c (REGISTER_PTRACE_ADDR): Convert macro to function register_ptrace_addr(). Fix all callers. Index: mips-nat.c =================================================================== RCS file: /cvs/src/src/gdb/mips-nat.c,v retrieving revision 1.11 diff -u -p -r1.11 mips-nat.c --- mips-nat.c 8 May 2003 22:33:14 -0000 1.11 +++ mips-nat.c 20 May 2003 23:50:51 -0000 @@ -51,16 +51,19 @@ /* Map gdb internal register number to ptrace ``address''. These ``addresses'' are defined in DECstation */ -#define REGISTER_PTRACE_ADDR(regno) \ - (regno < 32 ? GPR_BASE + regno \ - : regno == PC_REGNUM ? PC \ - : regno == CAUSE_REGNUM ? CAUSE \ - : regno == HI_REGNUM ? MMHI \ - : regno == LO_REGNUM ? MMLO \ - : regno == FCRCS_REGNUM ? FPC_CSR \ - : regno == FCRIR_REGNUM ? FPC_EIR \ - : regno >= FP0_REGNUM ? FPR_BASE + (regno - FP0_REGNUM) \ - : 0) +static int +register_ptrace_addr (int regno) +{ + return (regno < 32 ? GPR_BASE + regno + : regno == PC_REGNUM ? PC + : regno == CAUSE_REGNUM ? CAUSE + : regno == HI_REGNUM ? MMHI + : regno == LO_REGNUM ? MMLO + : regno == FCRCS_REGNUM ? FPC_CSR + : regno == FCRIR_REGNUM ? FPC_EIR + : regno >= FP0_REGNUM ? FPR_BASE + (regno - FP0_REGNUM) + : 0); +} static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); @@ -79,7 +82,7 @@ fetch_inferior_registers (int regno) for (regno = 1; regno < NUM_REGS; regno++) { - regaddr = REGISTER_PTRACE_ADDR (regno); + regaddr = register_ptrace_addr (regno); for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) { *(int *) &buf[i] = ptrace (PT_READ_U, PIDGET (inferior_ptid), @@ -111,7 +114,7 @@ store_inferior_registers (int regno) || regno == FCRIR_REGNUM || regno == DEPRECATED_FP_REGNUM || (regno >= FIRST_EMBED_REGNUM && regno <= LAST_EMBED_REGNUM)) return; - regaddr = REGISTER_PTRACE_ADDR (regno); + regaddr = register_ptrace_addr (regno); errno = 0; ptrace (PT_WRITE_U, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr, read_register (regno));