[GOLD] Modify script_test_12
[external/binutils.git] / gdb / m68hc11-tdep.c
index 882f37f..c30e682 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for Motorola 68HC11 & 68HC12
 
-   Copyright (C) 1999-2013 Free Software Foundation, Inc.
+   Copyright (C) 1999-2016 Free Software Foundation, Inc.
 
    Contributed by Stephane Carrez, stcarrez@nerim.fr
 
@@ -30,7 +30,6 @@
 #include "gdbtypes.h"
 #include "gdbcmd.h"
 #include "gdbcore.h"
-#include "gdb_string.h"
 #include "value.h"
 #include "inferior.h"
 #include "dis-asm.h"  
@@ -199,12 +198,12 @@ static int soft_reg_initialized = 0;
 static void
 m68hc11_get_register_info (struct m68hc11_soft_reg *reg, const char *name)
 {
-  struct minimal_symbol *msymbol;
+  struct bound_minimal_symbol msymbol;
 
   msymbol = lookup_minimal_symbol (name, NULL, NULL);
-  if (msymbol)
+  if (msymbol.minsym)
     {
-      reg->addr = SYMBOL_VALUE_ADDRESS (msymbol);
+      reg->addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
       reg->name = xstrdup (name);
 
       /* Keep track of the address range for soft registers.  */
@@ -338,7 +337,7 @@ m68hc11_pseudo_register_write (struct gdbarch *gdbarch,
   if (regno == M68HC12_HARD_PC_REGNUM)
     {
       const int regsize = 4;
-      char *tmp = alloca (regsize);
+      gdb_byte *tmp = (gdb_byte *) alloca (regsize);
       CORE_ADDR pc;
 
       memcpy (tmp, buf, regsize);
@@ -363,7 +362,7 @@ m68hc11_pseudo_register_write (struct gdbarch *gdbarch,
   if (soft_regs[regno].name)
     {
       const int regsize = 2;
-      char *tmp = alloca (regsize);
+      gdb_byte *tmp = (gdb_byte *) alloca (regsize);
       memcpy (tmp, buf, regsize);
       target_write_memory (soft_regs[regno].addr, tmp, regsize);
     }
@@ -587,18 +586,18 @@ m68hc11_analyze_instruction (struct gdbarch *gdbarch,
 static enum insn_return_kind
 m68hc11_get_return_insn (CORE_ADDR pc)
 {
-  struct minimal_symbol *sym;
+  struct bound_minimal_symbol sym;
 
   /* A flag indicating that this is a STO_M68HC12_FAR or STO_M68HC12_INTERRUPT
      function is stored by elfread.c in the high bit of the info field.
      Use this to decide which instruction the function uses to return.  */
   sym = lookup_minimal_symbol_by_pc (pc);
-  if (sym == 0)
+  if (sym.minsym == 0)
     return RETURN_RTS;
 
-  if (MSYMBOL_IS_RTC (sym))
+  if (MSYMBOL_IS_RTC (sym.minsym))
     return RETURN_RTC;
-  else if (MSYMBOL_IS_RTI (sym))
+  else if (MSYMBOL_IS_RTI (sym.minsym))
     return RETURN_RTI;
   else
     return RETURN_RTS;
@@ -793,7 +792,7 @@ m68hc11_frame_unwind_cache (struct frame_info *this_frame,
   int i;
 
   if ((*this_prologue_cache))
-    return (*this_prologue_cache);
+    return (struct m68hc11_unwind_cache *) (*this_prologue_cache);
 
   info = FRAME_OBSTACK_ZALLOC (struct m68hc11_unwind_cache);
   (*this_prologue_cache) = info;
@@ -1173,7 +1172,7 @@ m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   int argnum;
   int first_stack_argnum;
   struct type *type;
-  char *val;
+  const gdb_byte *val;
   gdb_byte buf[2];
   
   first_stack_argnum = 0;
@@ -1209,12 +1208,12 @@ m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 
       if (TYPE_LENGTH (type) & 1)
         {
-          static char zero = 0;
+          static gdb_byte zero = 0;
 
           sp--;
           write_memory (sp, &zero, 1);
         }
-      val = (char*) value_contents (args[argnum]);
+      val = value_contents (args[argnum]);
       sp -= TYPE_LENGTH (type);
       write_memory (sp, val, TYPE_LENGTH (type));
     }
@@ -1261,7 +1260,7 @@ m68hc11_register_type (struct gdbarch *gdbarch, int reg_nr)
 
 static void
 m68hc11_store_return_value (struct type *type, struct regcache *regcache,
-                            const void *valbuf)
+                            const gdb_byte *valbuf)
 {
   int len;
 
@@ -1274,7 +1273,7 @@ m68hc11_store_return_value (struct type *type, struct regcache *regcache,
     {
       regcache_raw_write_part (regcache, HARD_X_REGNUM, 4 - len,
                                len - 2, valbuf);
-      regcache_raw_write (regcache, HARD_D_REGNUM, (char*) valbuf + (len - 2));
+      regcache_raw_write (regcache, HARD_D_REGNUM, valbuf + (len - 2));
     }
   else
     error (_("return of value > 4 is not supported."));
@@ -1452,7 +1451,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
     }
 
   /* Need a new architecture.  Fill in a target specific vector.  */
-  tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
+  tdep = XNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
   tdep->elf_flags = elf_flags;