Reviewed and approved by Kevin Buettner <kevinb@redhat.com>
[deliverable/binutils-gdb.git] / gdb / arch-utils.c
index b79a02a76abb40b3546b667ee3d6d38ea34867b4..ecdecaf9a1a2bd46b2c84ca310d830106bc161a4 100644 (file)
@@ -29,7 +29,6 @@
 #else
 /* Just include everything in sight so that the every old definition
    of macro is visible. */
-#include "gdb_string.h"
 #include "symtab.h"
 #include "frame.h"
 #include "inferior.h"
@@ -40,6 +39,7 @@
 #include "target.h"
 #include "annotate.h"
 #endif
+#include "gdb_string.h"
 #include "regcache.h"
 #include "gdb_assert.h"
 #include "sim-regno.h"
@@ -95,12 +95,26 @@ legacy_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
    register cache.  */
 void
 legacy_extract_return_value (struct type *type, struct regcache *regcache,
-                            char *valbuf)
+                            void *valbuf)
 {
   char *registers = deprecated_grub_regcache_for_registers (regcache);
-  DEPRECATED_EXTRACT_RETURN_VALUE (type, registers, valbuf);
+  bfd_byte *buf = valbuf;
+  DEPRECATED_EXTRACT_RETURN_VALUE (type, registers, buf);
 }
 
+/* Implementation of store return value that grubs the register cache.
+   Takes a local copy of the buffer to avoid const problems.  */
+void
+legacy_store_return_value (struct type *type, struct regcache *regcache,
+                          const void *buf)
+{
+  bfd_byte *b = alloca (TYPE_LENGTH (type));
+  gdb_assert (regcache == current_regcache);
+  memcpy (b, buf, TYPE_LENGTH (type));
+  DEPRECATED_STORE_RETURN_VALUE (type, b);
+}
+
+
 int
 legacy_register_sim_regno (int regnum)
 {
@@ -141,6 +155,12 @@ generic_in_solib_call_trampoline (CORE_ADDR pc, char *name)
   return 0;
 }
 
+int
+generic_in_solib_return_trampoline (CORE_ADDR pc, char *name)
+{
+  return 0;
+}
+
 int
 generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
@@ -250,21 +270,6 @@ default_double_format (struct gdbarch *gdbarch)
     }
 }
 
-void
-default_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
-                         struct frame_info *frame)
-{
-#ifdef FLOAT_INFO
-#if GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL
-#error "FLOAT_INFO defined in multi-arch"
-#endif
-  FLOAT_INFO;
-#else
-  fprintf_filtered (file, "\
-No floating point info available for this processor.\n");
-#endif
-}
-
 /* Misc helper functions for targets. */
 
 int
@@ -444,6 +449,23 @@ generic_register_size (int regnum)
        (name && STREQ ("_sigtramp", name))
 #endif
 #endif
+
+/* Assume all registers are adjacent.  */
+
+int
+generic_register_byte (int regnum)
+{
+  int byte;
+  int i;
+  gdb_assert (regnum >= 0 && regnum < NUM_REGS + NUM_PSEUDO_REGS);
+  byte = 0;
+  for (i = 0; i < regnum; i++)
+    {
+      byte += TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (i));
+    }
+  return byte;
+}
+
 \f
 int
 legacy_pc_in_sigtramp (CORE_ADDR pc, char *name)
This page took 0.0245 seconds and 4 git commands to generate.