Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: gdb-patches@sources.redhat.com
Subject: [commit/mips] Cleanup register name/number initialization
Date: Thu, 08 Jan 2004 01:50:00 -0000	[thread overview]
Message-ID: <3FFCB756.4010805@gnu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 77 bytes --]

This consolidates MIPS's name/number initialization code.

committed,
Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 2963 bytes --]

2004-01-07  Andrew Cagney  <cagney@redhat.com>

	* 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.  */

                 reply	other threads:[~2004-01-08  1:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FFCB756.4010805@gnu.org \
    --to=cagney@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox