*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / arch-utils.c
index 363595534413b44a1da33d50f19e1a602a0c9665..1ec3c37ff454c926154242f9809d0a943c3e8498 100644 (file)
 
 #include "floatformat.h"
 
-/* Implementation of extract return value that grubs around in the
-   register cache.  */
-void
-legacy_extract_return_value (struct type *type, struct regcache *regcache,
-                            gdb_byte *valbuf)
-{
-  gdb_byte *registers = deprecated_grub_regcache_for_registers (regcache);
-  gdb_byte *buf = valbuf;
-  DEPRECATED_EXTRACT_RETURN_VALUE (type, registers, buf); /* OK */
-}
-
-/* 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 gdb_byte *buf)
-{
-  gdb_byte *b = alloca (TYPE_LENGTH (type));
-  gdb_assert (regcache == current_regcache);
-  memcpy (b, buf, TYPE_LENGTH (type));
-  DEPRECATED_STORE_RETURN_VALUE (type, b);
-}
-
 int
 always_use_struct_convention (int gcc_p, struct type *value_type)
 {
@@ -166,42 +143,6 @@ core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs)
   return (lhs > rhs);
 }
 
-
-/* Helper functions for TARGET_{FLOAT,DOUBLE}_FORMAT */
-
-const struct floatformat *
-default_float_format (struct gdbarch *gdbarch)
-{
-  int byte_order = gdbarch_byte_order (gdbarch);
-  switch (byte_order)
-    {
-    case BFD_ENDIAN_BIG:
-      return &floatformat_ieee_single_big;
-    case BFD_ENDIAN_LITTLE:
-      return &floatformat_ieee_single_little;
-    default:
-      internal_error (__FILE__, __LINE__,
-                     _("default_float_format: bad byte order"));
-    }
-}
-
-
-const struct floatformat *
-default_double_format (struct gdbarch *gdbarch)
-{
-  int byte_order = gdbarch_byte_order (gdbarch);
-  switch (byte_order)
-    {
-    case BFD_ENDIAN_BIG:
-      return &floatformat_ieee_double_big;
-    case BFD_ENDIAN_LITTLE:
-      return &floatformat_ieee_double_little;
-    default:
-      internal_error (__FILE__, __LINE__,
-                     _("default_double_format: bad byte order"));
-    }
-}
-
 /* Misc helper functions for targets. */
 
 CORE_ADDR
@@ -273,7 +214,7 @@ int
 generic_register_size (int regnum)
 {
   gdb_assert (regnum >= 0 && regnum < NUM_REGS + NUM_PSEUDO_REGS);
-  return TYPE_LENGTH (gdbarch_register_type (current_gdbarch, regnum));
+  return TYPE_LENGTH (register_type (current_gdbarch, regnum));
 }
 
 /* Assume all registers are adjacent.  */
@@ -312,17 +253,6 @@ generic_convert_register_p (int regnum, struct type *type)
 int
 default_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
 {
-  if (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()
-      && DEPRECATED_REG_STRUCT_HAS_ADDR (processing_gcc_compilation, type))
-    {
-      CHECK_TYPEDEF (type);
-
-      return (TYPE_CODE (type) == TYPE_CODE_STRUCT
-             || TYPE_CODE (type) == TYPE_CODE_UNION
-             || TYPE_CODE (type) == TYPE_CODE_SET
-             || TYPE_CODE (type) == TYPE_CODE_BITSTRING);
-    }
-
   return 0;
 }
 
@@ -333,6 +263,13 @@ generic_instruction_nullified (struct gdbarch *gdbarch,
   return 0;
 }
 
+int
+default_remote_register_number (struct gdbarch *gdbarch,
+                               int regno)
+{
+  return regno;
+}
+
 \f
 /* Functions to manipulate the endianness of the target.  */
 
@@ -350,13 +287,22 @@ static const char *endian_enum[] =
 };
 static const char *set_endian_string;
 
+enum bfd_endian
+selected_byte_order (void)
+{
+  if (target_byte_order_user != BFD_ENDIAN_UNKNOWN)
+    return TARGET_BYTE_ORDER;
+  else
+    return BFD_ENDIAN_UNKNOWN;
+}
+
 /* Called by ``show endian''.  */
 
 static void
 show_endian (struct ui_file *file, int from_tty, struct cmd_list_element *c,
             const char *value)
 {
-  if (target_byte_order_user != BFD_ENDIAN_UNKNOWN)
+  if (target_byte_order_user == BFD_ENDIAN_UNKNOWN)
     if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
       fprintf_unfiltered (file, _("The target endianness is set automatically "
                                  "(currently big endian)\n"));
This page took 0.025777 seconds and 4 git commands to generate.