From 474c1661763ea406e7b76ba49718330a6b8ade94 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Tue, 12 Jun 2007 16:47:06 +0000 Subject: [PATCH] 2007-06-12 Markus Deuling * 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. --- gdb/ChangeLog | 8 ++++++++ gdb/gdbarch.c | 6 ------ gdb/gdbarch.h | 6 ------ gdb/gdbarch.sh | 2 +- gdb/remote-sim.c | 17 +++++++++++------ gdb/sim-regno.h | 2 +- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 781034e1e72..15ca1d25987 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2007-06-12 Markus Deuling + + * 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. + 2007-06-12 Markus Deuling * gdbarch.sh (TARGET_VIRTUAL_FRAME_POINTER): Replace by diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index b75f280e67d..20a7bb3bed1 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -1101,12 +1101,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) 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 --git a/gdb/gdbarch.h b/gdb/gdbarch.h index f8bb5099cb6..3a5d3ce3882 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -424,12 +424,6 @@ extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_prin 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 --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 1efaaa7366e..37e9f498e67 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -479,7 +479,7 @@ M::void:print_float_info:struct ui_file *file, struct frame_info *frame, const c 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 --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 8c13888f651..48bb1277b5a 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -288,7 +288,7 @@ gdbsim_fetch_register (struct regcache *regcache, int regno) return; } - switch (REGISTER_SIM_REGNO (regno)) + switch (gdbarch_register_sim_regno (current_gdbarch, regno)) { case LEGACY_SIM_REGNO_IGNORE: break; @@ -311,14 +311,18 @@ gdbsim_fetch_register (struct regcache *regcache, int regno) 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 (struct regcache *regcache, int regno) 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 --git a/gdb/sim-regno.h b/gdb/sim-regno.h index 974c96590d7..dfa9a8b02ac 100644 --- a/gdb/sim-regno.h +++ b/gdb/sim-regno.h @@ -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. */ -- 2.30.2