diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-06-12 21:19:43 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-06-12 21:19:43 +0000 |
commit | 26216b98222fd93bf11128859575552d180d0576 (patch) | |
tree | f3d46998c54fe5e44afa3f6e225222b1ccdadf36 /gdb | |
parent | 9b17aab6276db153d0fb91e347ed74cc2586b06c (diff) | |
download | gdb-26216b98222fd93bf11128859575552d180d0576.zip gdb-26216b98222fd93bf11128859575552d180d0576.tar.gz gdb-26216b98222fd93bf11128859575552d180d0576.tar.bz2 |
Add the file include/gdb/sim-arm.h defining an enum that specifies the
register numbering used by the GDB<->SIM interface.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/Makefile.in | 3 | ||||
-rw-r--r-- | gdb/arm-tdep.c | 27 |
3 files changed, 38 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index af937aa..19dd935 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2002-06-12 Andrew Cagney <ac131313@redhat.com> + + * Makefile.in (sim_arm_h): Define. + (arm-tdep.o): Add $(sim_arm_h) and $(gdb_assert_h). + * arm-tdep.c: Include "gdb/sim-arm.h" and "gdb_assert.h". + (arm_register_sim_regno): New function, map an internal REGNUM + onto a simulator register number. + (arm_gdbarch_init): Set register_sim_regno. + 2002-06-09 Aldy Hernandez <aldyh@redhat.com> * MAINTAINERS: Add self. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 1d5492a..a95117e 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -573,6 +573,7 @@ dis_asm_h = $(INCLUDE_DIR)/dis-asm.h remote_sim_h = $(INCLUDE_DIR)/gdb/remote-sim.h demangle_h = $(INCLUDE_DIR)/demangle.h obstack_h = $(INCLUDE_DIR)/obstack.h +sim_arm_h = $(INCLUDE_DIR)/gdb/sim-arm.h sim_d10v_h = $(INCLUDE_DIR)/gdb/sim-d10v.h splay_tree_h = $(INCLUDE_DIR)/splay-tree.h @@ -1307,7 +1308,7 @@ arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \ $(gdbcore_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) $(doublest_h) \ $(value_h) $(arch_utils_h) $(solib_svr4_h) $(arm_tdep_h) \ $(BFD_SRC)/elf-bfd.h $(INCLUDE_DIR)/coff/internal.h \ - $(INCLUDE_DIR)/elf/arm.h + $(INCLUDE_DIR)/elf/arm.h $(sim_arm_h) $(gdb_assert_h) armnbsd-nat.o: armnbsd-nat.c $(defs_h) $(arm_tdep_h) $(inferior_h) \ $(regcache_h) $(gdbcore_h) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 1ce0a5b..f4b84fa 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -36,11 +36,14 @@ #include "solib-svr4.h" #include "arm-tdep.h" +#include "gdb/sim-arm.h" #include "elf-bfd.h" #include "coff/internal.h" #include "elf/arm.h" +#include "gdb_assert.h" + /* Each OS has a different mechanism for accessing the various registers stored in the sigcontext structure. @@ -1636,6 +1639,27 @@ arm_register_virtual_size (int regnum) return STATUS_REGISTER_SIZE; } +/* Map GDB internal REGNUM onto the Arm simulator register numbers. */ +static int +arm_register_sim_regno (int regnum) +{ + int reg = regnum; + gdb_assert (reg >= 0 && reg < NUM_REGS); + + if (reg < NUM_GREGS) + return SIM_ARM_R0_REGNUM + reg; + reg -= NUM_GREGS; + + if (reg < NUM_FREGS) + return SIM_ARM_FP0_REGNUM + reg; + reg -= NUM_FREGS; + + if (reg < NUM_SREGS) + return SIM_ARM_FPS_REGNUM + reg; + reg -= NUM_SREGS; + + internal_error (__FILE__, __LINE__, "Bad REGNUM %d", regnum); +} /* NOTE: cagney/2001-08-20: Both convert_from_extended() and convert_to_extended() use floatformat_arm_ext_littlebyte_bigword. @@ -2870,6 +2894,9 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_max_register_virtual_size (gdbarch, FP_REGISTER_VIRTUAL_SIZE); set_gdbarch_register_virtual_type (gdbarch, arm_register_type); + /* Internal <-> external register number maps. */ + set_gdbarch_register_sim_regno (gdbarch, arm_register_sim_regno); + /* Integer registers are 4 bytes. */ set_gdbarch_register_size (gdbarch, 4); set_gdbarch_register_name (gdbarch, arm_register_name); |