Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Markus Deuling <deuling@de.ibm.com>
To: GDB Patches <gdb-patches@sourceware.org>
Cc: Ulrich Weigand <uweigand@de.ibm.com>
Subject: [rfc] [2/6] Remove macro REGISTER_SIM_REGNO
Date: Tue, 12 Jun 2007 16:06:00 -0000	[thread overview]
Message-ID: <466EC42C.5000105@de.ibm.com> (raw)

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

Hello,

this patch removes REGISTER_SIM_REGNO macro from gdbarch.sh 


ChangeLog:

	* gdbarch.sh (REGISTER_SIM_REGNO): Replace by
	gdbarch_register_sim_regno.
	* sim-regno.h (sim_regno): Likewise (comment).
	* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Likewise.
	* gdbarch.c, gdbarch.h: Regenerate.



Is this ok to commit?
-- 
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com








[-- Attachment #2: diff-remove-REGISTER --]
[-- Type: text/plain, Size: 4752 bytes --]

diff -urN src/gdb/gdbarch.c dev/gdb/gdbarch.c
--- src/gdb/gdbarch.c	2007-06-11 11:31:56.000000000 +0200
+++ dev/gdb/gdbarch.c	2007-06-11 19:45:30.000000000 +0200
@@ -1146,12 +1146,6 @@
   fprintf_unfiltered (file,
                       "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
                       (long) current_gdbarch->register_reggroup_p);
-#ifdef REGISTER_SIM_REGNO
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "REGISTER_SIM_REGNO(reg_nr)",
-                      XSTRING (REGISTER_SIM_REGNO (reg_nr)));
-#endif
   fprintf_unfiltered (file,
                       "gdbarch_dump: register_sim_regno = <0x%lx>\n",
                       (long) current_gdbarch->register_sim_regno);
diff -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h
--- src/gdb/gdbarch.h	2007-06-11 11:31:56.000000000 +0200
+++ dev/gdb/gdbarch.h	2007-06-11 19:45:30.000000000 +0200
@@ -490,12 +490,6 @@
 typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr);
 extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr);
 extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno);
-#if !defined (GDB_TM_FILE) && defined (REGISTER_SIM_REGNO)
-#error "Non multi-arch definition of REGISTER_SIM_REGNO"
-#endif
-#if !defined (REGISTER_SIM_REGNO)
-#define REGISTER_SIM_REGNO(reg_nr) (gdbarch_register_sim_regno (current_gdbarch, reg_nr))
-#endif
 
 typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum);
 extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum);
diff -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh
--- src/gdb/gdbarch.sh	2007-06-11 11:31:56.000000000 +0200
+++ dev/gdb/gdbarch.sh	2007-06-11 19:46:27.000000000 +0200
@@ -479,7 +479,7 @@
 M::void:print_vector_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
 # MAP a GDB RAW register number onto a simulator register number.  See
 # also include/...-sim.h.
-f:=:int:register_sim_regno:int reg_nr:reg_nr::legacy_register_sim_regno::0
+f::int:register_sim_regno:int reg_nr:reg_nr::legacy_register_sim_regno::0
 f::int:cannot_fetch_register:int regnum:regnum::cannot_register_not::0
 f::int:cannot_store_register:int regnum:regnum::cannot_register_not::0
 # setjmp/longjmp support.
diff -urN src/gdb/remote-sim.c dev/gdb/remote-sim.c
--- src/gdb/remote-sim.c	2007-06-11 11:31:58.000000000 +0200
+++ dev/gdb/remote-sim.c	2007-06-11 19:47:58.000000000 +0200
@@ -288,7 +288,7 @@
       return;
     }
 
-  switch (REGISTER_SIM_REGNO (regno))
+  switch (gdbarch_register_sim_regno (current_gdbarch, regno))
     {
     case LEGACY_SIM_REGNO_IGNORE:
       break;
@@ -311,14 +311,18 @@
 	gdb_assert (regno >= 0 && regno < gdbarch_num_regs (current_gdbarch));
 	memset (buf, 0, MAX_REGISTER_SIZE);
 	nr_bytes = sim_fetch_register (gdbsim_desc,
-				       REGISTER_SIM_REGNO (regno),
-				       buf, register_size (current_gdbarch, regno));
+				       gdbarch_register_sim_regno
+					 (current_gdbarch, regno),
+				       buf,
+				       register_size (current_gdbarch, regno));
 	if (nr_bytes > 0 && nr_bytes != register_size (current_gdbarch, regno) && warn_user)
 	  {
 	    fprintf_unfiltered (gdb_stderr,
 				"Size of register %s (%d/%d) incorrect (%d instead of %d))",
 				gdbarch_register_name (current_gdbarch, regno),
-				regno, REGISTER_SIM_REGNO (regno),
+				regno,
+				gdbarch_register_sim_regno
+				  (current_gdbarch, regno),
 				nr_bytes, register_size (current_gdbarch, regno));
 	    warn_user = 0;
 	  }
@@ -349,13 +353,14 @@
 	gdbsim_store_register (regcache, regno);
       return;
     }
-  else if (REGISTER_SIM_REGNO (regno) >= 0)
+  else if (gdbarch_register_sim_regno (current_gdbarch, regno) >= 0)
     {
       char tmp[MAX_REGISTER_SIZE];
       int nr_bytes;
       regcache_cooked_read (regcache, regno, tmp);
       nr_bytes = sim_store_register (gdbsim_desc,
-				     REGISTER_SIM_REGNO (regno),
+				     gdbarch_register_sim_regno
+				       (current_gdbarch, regno),
 				     tmp, register_size (current_gdbarch, regno));
       if (nr_bytes > 0 && nr_bytes != register_size (current_gdbarch, regno))
 	internal_error (__FILE__, __LINE__,
diff -urN src/gdb/sim-regno.h dev/gdb/sim-regno.h
--- src/gdb/sim-regno.h	2007-01-09 18:58:58.000000000 +0100
+++ dev/gdb/sim-regno.h	2007-06-11 19:45:30.000000000 +0200
@@ -24,7 +24,7 @@
 #ifndef SIM_REGNO_H
 #define SIM_REGNO_H
 
-/* The REGISTER_SIM_REGNO(REGNUM) method, when there is a
+/* The gdbarch_register_sim_regno (REGNUM) method, when there is a
    corresponding simulator register, returns that register number as a
    cardinal.  When there is no corresponding register, it returns a
    negative value.  */


                 reply	other threads:[~2007-06-12 16:06 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=466EC42C.5000105@de.ibm.com \
    --to=deuling@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.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