* Makefile.in (arch-utils.o): Add $(sim_regno_h).
[deliverable/binutils-gdb.git] / gdb / arch-utils.c
index 5d13a2dd1ad74413d4496c3f9d88a4e947f37242..8e69a6127ade495f4ef1c04a873825a1d64d3cba 100644 (file)
@@ -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)
 {
This page took 0.02401 seconds and 4 git commands to generate.