From: Andrew Cagney Date: Wed, 29 May 2002 16:39:56 +0000 (+0000) Subject: * Makefile.in (arch-utils.o): Add $(sim_regno_h). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4182591fce9f672b648e8dcfcf33d0df556b7a22;p=binutils-gdb.git * Makefile.in (arch-utils.o): Add $(sim_regno_h). * arch-utils.c: Include "sim-regno.h". * gdbarch.sh: Don't include "sim-regno.h". * gdbarch.h, gdbarch.c: Regenerate. * sim-regno.h (legacy_register_sim_regno): Move declaration from here. * arch-utils.h (legacy_register_sim_regno): To here. * remote-sim.c (legacy_register_sim_regno): Move function from here. * arch-utils.c (legacy_register_sim_regno): To here. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index abe98269fab..f766c2cdbf8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,16 @@ +2002-05-29 Andrew Cagney + + * Makefile.in (arch-utils.o): Add $(sim_regno_h). + * arch-utils.c: Include "sim-regno.h". + * gdbarch.sh: Don't include "sim-regno.h". + * gdbarch.h, gdbarch.c: Regenerate. + * sim-regno.h (legacy_register_sim_regno): Move declaration from + here. + * arch-utils.h (legacy_register_sim_regno): To here. + * remote-sim.c (legacy_register_sim_regno): Move function from + here. + * arch-utils.c (legacy_register_sim_regno): To here. + 2002-05-28 Andrew Cagney * sim-regno.h: New file. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 6711ca2e130..c8dba9150d2 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1586,7 +1586,7 @@ arch-utils.o: arch-utils.c $(defs_h) $(bfd_h) $(gdbcmd_h) \ $(arch_utils_h) $(gdb_assert_h) $(inferior_h) \ $(gdb_string_h) $(symtab.h) $(frame_h) $(breakpoint_h) $(gdb_wait_h) \ $(gdbcore_h) $(target_h) $(annotate_h) $(regcache_h) $(gdb_assert_h) \ - $(version_h) $(floatformat_h) + $(version_h) $(floatformat_h) $(sim_regno_h) gdbtypes.o: gdbtypes.c $(bfd_h) $(complaints_h) $(defs_h) $(expression_h) \ $(gdbtypes_h) $(language_h) $(objfiles_h) $(symfile_h) $(symtab_h) \ diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 5d13a2dd1ad..8e69a6127ad 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -42,6 +42,7 @@ #endif #include "regcache.h" #include "gdb_assert.h" +#include "sim-regno.h" #include "version.h" @@ -90,6 +91,22 @@ legacy_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) return NULL; } +int +legacy_register_sim_regno (int regnum) +{ + /* Only makes sense to supply raw registers. */ + gdb_assert (regnum >= 0 && regnum < NUM_REGS); + /* NOTE: cagney/2002-05-13: The old code did it this way and it is + suspected that some GDB/SIM combinations may rely on this + behavour. The default should be one2one_register_sim_regno + (below). */ + if (REGISTER_NAME (regnum) != NULL + && REGISTER_NAME (regnum)[0] != '\0') + return regnum; + else + return LEGACY_SIM_REGNO_IGNORE; +} + int generic_frameless_function_invocation_not (struct frame_info *fi) { diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index f4b2d02939a..3b3e615ffc3 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -161,6 +161,12 @@ extern int legacy_convert_register_p (int regnum); extern void legacy_register_to_value (int regnum, struct type *type, char *from, char *to); extern void legacy_value_to_register (struct type *type, int regnum, char *from, char *to); +/* For compatibility with older architectures, returns + (LEGACY_SIM_REGNO_IGNORE) when the register doesn't have a valid + name. */ + +extern int legacy_register_sim_regno (int regnum); + /* Initialize a ``struct info''. Can't use memset(0) since some default values are not zero. */ extern void gdbarch_info_init (struct gdbarch_info *info); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index baeea9f4b9d..9307f2502ed 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -39,7 +39,6 @@ #if GDB_MULTI_ARCH #include "gdbcmd.h" #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */ -#include "sim-regno.h" /* For legacy_register_sim_regno(). */ #else /* Just include everything in sight so that the every old definition of macro is visible. */ diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index ac42d29a50b..2d749561e3c 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -759,7 +759,6 @@ cat <= 0 && regnum < NUM_REGS); - /* NOTE: cagney/2002-05-13: The old code did it this way and it is - suspected that some GDB/SIM combinations may rely on this - behavour. The default should be one2one_register_sim_regno - (below). */ - if (REGISTER_NAME (regnum) != NULL - && REGISTER_NAME (regnum)[0] != '\0') - return regnum; - else - return LEGACY_SIM_REGNO_IGNORE; -} - int one2one_register_sim_regno (int regnum) { diff --git a/gdb/sim-regno.h b/gdb/sim-regno.h index 7791ac4c360..5a7057b6b04 100644 --- a/gdb/sim-regno.h +++ b/gdb/sim-regno.h @@ -38,11 +38,6 @@ enum sim_regno { LEGACY_SIM_REGNO_IGNORE = -2 }; -/* For compatibility with older architectures, returns - (LEGACY_SIM_REGNO_IGNORE) when a register doesn't have. */ - -extern int legacy_register_sim_regno (int regnum); - /* Treat all raw registers as valid. */ extern int one2one_register_sim_regno (int regnum);