From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4344 invoked by alias); 8 Jan 2004 01:50:36 -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 3966 invoked from network); 8 Jan 2004 01:50:28 -0000 Received: from unknown (HELO localhost.redhat.com) (65.49.3.48) by sources.redhat.com with SMTP; 8 Jan 2004 01:50:28 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id B97E92B8F; Wed, 7 Jan 2004 20:50:14 -0500 (EST) Message-ID: <3FFCB756.4010805@gnu.org> Date: Thu, 08 Jan 2004 01:50:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [commit/mips] Cleanup register name/number initialization Content-Type: multipart/mixed; boundary="------------040504030001060908090403" X-SW-Source: 2004-01/txt/msg00189.txt.bz2 This is a multi-part message in MIME format. --------------040504030001060908090403 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 77 This consolidates MIPS's name/number initialization code. committed, Andrew --------------040504030001060908090403 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 2963 2004-01-07 Andrew Cagney * mips-tdep.c: Update copyright. (mips_gdbarch_init): Merge two code blocks handling the register name and number layout. Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.263 diff -u -r1.263 mips-tdep.c --- mips-tdep.c 5 Jan 2004 23:09:45 -0000 1.263 +++ mips-tdep.c 8 Jan 2004 01:42:59 -0000 @@ -1,7 +1,8 @@ /* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger. Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, - 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin. @@ -5775,11 +5776,11 @@ set_gdbarch_elf_make_msymbol_special (gdbarch, mips_elf_make_msymbol_special); - /* Fill in the OS dependant register numbers. */ + /* Fill in the OS dependant register numbers and names. */ { + const char **reg_names; struct mips_regnum *regnum = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct mips_regnum); - tdep->regnum = regnum; if (info.osabi == GDB_OSABI_IRIX) { regnum->fp0 = 32; @@ -5791,6 +5792,7 @@ regnum->fp_control_status = 69; regnum->fp_implementation_revision = 70; num_regs = 71; + reg_names = mips_irix_reg_names; } else { @@ -5803,6 +5805,11 @@ regnum->fp_control_status = 70; regnum->fp_implementation_revision = 71; num_regs = 90; + if (info.bfd_arch_info != NULL + && info.bfd_arch_info->mach == bfd_mach_mips3900) + reg_names = mips_tx39_reg_names; + else + reg_names = mips_generic_reg_names; } /* FIXME: cagney/2003-11-15: For MIPS, hasn't PC_REGNUM been replaced by read_pc? */ @@ -5810,6 +5817,9 @@ set_gdbarch_fp0_regnum (gdbarch, regnum->fp0); set_gdbarch_num_regs (gdbarch, num_regs); set_gdbarch_num_pseudo_regs (gdbarch, num_regs); + set_gdbarch_register_name (gdbarch, mips_register_name); + tdep->mips_processor_reg_names = reg_names; + tdep->regnum = regnum; } switch (mips_abi) @@ -5960,14 +5970,6 @@ else tdep->mips_fpu_type = MIPS_FPU_DOUBLE; - /* MIPS version of register names. */ - set_gdbarch_register_name (gdbarch, mips_register_name); - if (info.osabi == GDB_OSABI_IRIX) - tdep->mips_processor_reg_names = mips_irix_reg_names; - else if (info.bfd_arch_info != NULL && info.bfd_arch_info->mach == bfd_mach_mips3900) - tdep->mips_processor_reg_names = mips_tx39_reg_names; - else - tdep->mips_processor_reg_names = mips_generic_reg_names; set_gdbarch_read_pc (gdbarch, mips_read_pc); set_gdbarch_write_pc (gdbarch, generic_target_write_pc); set_gdbarch_deprecated_target_read_fp (gdbarch, mips_read_sp); /* Draft FRAME base. */ --------------040504030001060908090403--