Add support for target specific command line switches to old-style simualtors.
[deliverable/binutils-gdb.git] / gdb / sh-tdep.c
index 8c0c811d15ca0cbbab888c2ac2e048c488e6eb6a..55909e20dd76a6522c718f3a8f37b577feb4c69d 100644 (file)
 #include "regcache.h"
 #include "doublest.h"
 
-#include "elf-bfd.h"
+#include "sh-tdep.h"
 
+#include "elf-bfd.h"
 #include "solib-svr4.h"
 
-#include "elf-bfd.h"
 /* sh64 flags */
 #include "elf/sh.h"
 /* registers numbers shared with the simulator */
 #include "gdb/sim-sh.h"
 
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
 void (*sh_show_regs) (void);
 CORE_ADDR (*skip_prologue_hard_way) (CORE_ADDR);
 void (*do_pseudo_register) (int);
@@ -911,29 +908,8 @@ sh_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
 static int
 gdb_print_insn_sh (bfd_vma memaddr, disassemble_info *info)
 {
-  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
-    return print_insn_sh (memaddr, info);
-  else
-    return print_insn_shl (memaddr, info);
-}
-
-/* Disassemble an instruction.  */
-static int
-gdb_print_insn_sh64 (bfd_vma memaddr, disassemble_info *info)
-{
-  if (pc_is_isa32 (memaddr))
-    {
-      /* Round down the instruction address to the appropriate boundary
-        before disassembling it. */
-      return print_insn_sh64x_media (UNMAKE_ISA32_ADDR (memaddr), info);
-    }
-  else
-    {
-      if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
-       return print_insn_sh (memaddr, info);
-      else
-       return print_insn_shl (memaddr, info);
-    }
+  info->endian = TARGET_BYTE_ORDER;
+  return print_insn_sh (memaddr, info);
 }
 
 /* Given a GDB frame, determine the address of the calling function's frame.
@@ -1395,7 +1371,7 @@ sign_extend (int value, int bits)
 static void
 sh64_nofp_frame_init_saved_regs (struct frame_info *fi)
 {
-  int *where = (int *) alloca ((NUM_REGS + NUM_PSEUDO_REGS) * sizeof(int));
+  int *where = (int *) alloca ((NUM_REGS + NUM_PSEUDO_REGS) * sizeof (int));
   int rn;
   int have_fp = 0;
   int fp_regnum;
@@ -1602,7 +1578,7 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi)
 static void
 sh_fp_frame_init_saved_regs (struct frame_info *fi)
 {
-  int where[NUM_REGS + NUM_PSEUDO_REGS];
+  int *where = (int *) alloca ((NUM_REGS + NUM_PSEUDO_REGS) * sizeof (int));
   int rn;
   int have_fp = 0;
   int depth;
@@ -3310,18 +3286,6 @@ sh_default_register_virtual_type (int reg_nr)
    The other pseudo registers (the FVs) also don't pose a problem
    because they are stored as 4 individual FP elements. */
 
-int
-sh_sh4_register_convertible (int nr)
-{
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); 
-
-  if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
-    return (tdep->DR0_REGNUM <= nr
-           && nr <= tdep->DR_LAST_REGNUM);
-  else 
-    return 0;
-}
-
 static void
 sh_sh4_register_convert_to_virtual (int regnum, struct type *type,
                                   char *from, char *to)
@@ -4699,7 +4663,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       sh_store_return_value = sh64_store_return_value;
       skip_prologue_hard_way = sh64_skip_prologue_hard_way;
       do_pseudo_register = sh64_do_pseudo_register;
-      set_gdbarch_print_insn (gdbarch, gdb_print_insn_sh64);
       set_gdbarch_register_raw_size (gdbarch, sh_sh64_register_raw_size);
       set_gdbarch_register_virtual_size (gdbarch, sh_sh64_register_raw_size);
       set_gdbarch_register_byte (gdbarch, sh_sh64_register_byte);
This page took 0.041962 seconds and 4 git commands to generate.