* linux-low.c (usr_store_inferior_registers): Transfer buf in
[deliverable/binutils-gdb.git] / gdb / xstormy16-tdep.c
index a44a9c3fc91f9e1058e88294c999a90084f28431..f792423a544214f22d497af1690169c09df79f19 100644 (file)
@@ -354,7 +354,7 @@ xstormy16_pop_frame (void)
                                                      xstormy16_reg_size));
          }
       /* Restore the PC */
                                                      xstormy16_reg_size));
          }
       /* Restore the PC */
-      write_register (PC_REGNUM, FRAME_SAVED_PC (fi));
+      write_register (PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (fi));
       flush_cached_frames ();
     }
   return;
       flush_cached_frames ();
     }
   return;
@@ -478,7 +478,7 @@ xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
       fp = xstormy16_frame_saved_register (fi, E_FP_REGNUM);
 
       /* Initialize framesize with size of PC put on stack by CALLF inst. */
       fp = xstormy16_frame_saved_register (fi, E_FP_REGNUM);
 
       /* Initialize framesize with size of PC put on stack by CALLF inst. */
-      fi->extra_info->framesize = xstormy16_pc_size;
+      get_frame_extra_info (fi)->framesize = xstormy16_pc_size;
     }
   for (next_addr = start_addr;
        next_addr < end_addr; next_addr += xstormy16_inst_size)
     }
   for (next_addr = start_addr;
        next_addr < end_addr; next_addr += xstormy16_inst_size)
@@ -492,8 +492,8 @@ xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
          if (fi)
            {
              regnum = inst & 0x000f;
          if (fi)
            {
              regnum = inst & 0x000f;
-             get_frame_saved_regs (fi)[regnum] = fi->extra_info->framesize;
-             fi->extra_info->framesize += xstormy16_reg_size;
+             get_frame_saved_regs (fi)[regnum] = get_frame_extra_info (fi)->framesize;
+             get_frame_extra_info (fi)->framesize += xstormy16_reg_size;
            }
        }
 
            }
        }
 
@@ -501,28 +501,28 @@ xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
       else if (inst == 0x301f || inst == 0x303f)       /* inc r15, #0x1/#0x3 */
        {
          if (fi)               /* Record the frame size. */
       else if (inst == 0x301f || inst == 0x303f)       /* inc r15, #0x1/#0x3 */
        {
          if (fi)               /* Record the frame size. */
-           fi->extra_info->framesize += ((inst & 0x0030) >> 4) + 1;
+           get_frame_extra_info (fi)->framesize += ((inst & 0x0030) >> 4) + 1;
        }
 
       /* optional stack allocation for args and local vars > 4 && < 16 byte */
       else if ((inst & 0xff0f) == 0x510f)      /* 51Hf   add r15, #0xH */
        {
          if (fi)               /* Record the frame size. */
        }
 
       /* optional stack allocation for args and local vars > 4 && < 16 byte */
       else if ((inst & 0xff0f) == 0x510f)      /* 51Hf   add r15, #0xH */
        {
          if (fi)               /* Record the frame size. */
-           fi->extra_info->framesize += (inst & 0x00f0) >> 4;
+           get_frame_extra_info (fi)->framesize += (inst & 0x00f0) >> 4;
        }
 
       /* optional stack allocation for args and local vars >= 16 byte */
       else if (inst == 0x314f && inst2 >= 0x0010)      /* 314f HHHH  add r15, #0xH */
        {
          if (fi)               /* Record the frame size. */
        }
 
       /* optional stack allocation for args and local vars >= 16 byte */
       else if (inst == 0x314f && inst2 >= 0x0010)      /* 314f HHHH  add r15, #0xH */
        {
          if (fi)               /* Record the frame size. */
-           fi->extra_info->framesize += inst2;
+           get_frame_extra_info (fi)->framesize += inst2;
          next_addr += xstormy16_inst_size;
        }
 
       else if (inst == 0x46fd) /* mov r13, r15 */
        {
          if (fi)               /* Record that the frame pointer is in use. */
          next_addr += xstormy16_inst_size;
        }
 
       else if (inst == 0x46fd) /* mov r13, r15 */
        {
          if (fi)               /* Record that the frame pointer is in use. */
-           fi->extra_info->frameless_p = 0;
+           get_frame_extra_info (fi)->frameless_p = 0;
          if (frameless)
            *frameless = 0;
        }
          if (frameless)
            *frameless = 0;
        }
@@ -548,7 +548,7 @@ xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
              if (offset & 0x0800)
                offset -= 0x1000;
 
              if (offset & 0x0800)
                offset -= 0x1000;
 
-             get_frame_saved_regs (fi)[regnum] = fi->extra_info->framesize + offset;
+             get_frame_saved_regs (fi)[regnum] = get_frame_extra_info (fi)->framesize + offset;
            }
          next_addr += xstormy16_inst_size;
        }
            }
          next_addr += xstormy16_inst_size;
        }
@@ -593,14 +593,14 @@ xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
          by convention what we put here is simply the previous 
          _value_ of the SP (as opposed to an address where the
          previous value would have been pushed).  */
          by convention what we put here is simply the previous 
          _value_ of the SP (as opposed to an address where the
          previous value would have been pushed).  */
-      if (fi->extra_info->frameless_p)
+      if (get_frame_extra_info (fi)->frameless_p)
        {
        {
-         get_frame_saved_regs (fi)[E_SP_REGNUM] = sp - fi->extra_info->framesize;
+         get_frame_saved_regs (fi)[E_SP_REGNUM] = sp - get_frame_extra_info (fi)->framesize;
          deprecated_update_frame_base_hack (fi, sp);
        }
       else
        {
          deprecated_update_frame_base_hack (fi, sp);
        }
       else
        {
-         get_frame_saved_regs (fi)[E_SP_REGNUM] = fp - fi->extra_info->framesize;
+         get_frame_saved_regs (fi)[E_SP_REGNUM] = fp - get_frame_extra_info (fi)->framesize;
          deprecated_update_frame_base_hack (fi, fp);
        }
 
          deprecated_update_frame_base_hack (fi, fp);
        }
 
@@ -648,7 +648,7 @@ xstormy16_skip_prologue (CORE_ADDR pc)
         return plg_end;
 
       /* Found a function.  */
         return plg_end;
 
       /* Found a function.  */
-      sym = lookup_symbol (func_name, NULL, VAR_NAMESPACE, NULL, NULL);
+      sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL, NULL);
       /* Don't use line number debug info for assembly source files. */
       if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
        {
       /* Don't use line number debug info for assembly source files. */
       if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
        {
@@ -723,11 +723,10 @@ xstormy16_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
    actual value of the previous frame's stack register. 
 
    This function may be called in any context where the saved register
    actual value of the previous frame's stack register. 
 
    This function may be called in any context where the saved register
-   values may be needed (backtrace, frame_info, get_saved_register).
-   On many targets, it is called directly by init_extra_frame_info, 
-   in part because the information may be needed immediately by 
-   frame_chain.
-*/
+   values may be needed (backtrace, frame_info, frame_register).  On
+   many targets, it is called directly by init_extra_frame_info, in
+   part because the information may be needed immediately by
+   frame_chain.  */
 
 static void
 xstormy16_frame_init_saved_regs (struct frame_info *fi)
 
 static void
 xstormy16_frame_init_saved_regs (struct frame_info *fi)
@@ -749,9 +748,8 @@ xstormy16_frame_init_saved_regs (struct frame_info *fi)
 
 /* Function: xstormy16_frame_saved_pc
    Returns the return address for the selected frame. 
 
 /* Function: xstormy16_frame_saved_pc
    Returns the return address for the selected frame. 
-   Called by frame_info, frame_chain_valid, and sometimes by
-   get_prev_frame.
-*/
+   Called by frame_info, legacy_frame_chain_valid, and sometimes by
+   get_prev_frame.  */
 
 static CORE_ADDR
 xstormy16_frame_saved_pc (struct frame_info *fi)
 
 static CORE_ADDR
 xstormy16_frame_saved_pc (struct frame_info *fi)
@@ -783,11 +781,11 @@ xstormy16_frame_saved_pc (struct frame_info *fi)
 static void
 xstormy16_init_extra_frame_info (int fromleaf, struct frame_info *fi)
 {
 static void
 xstormy16_init_extra_frame_info (int fromleaf, struct frame_info *fi)
 {
-  if (!fi->extra_info)
+  if (!get_frame_extra_info (fi))
     {
       frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
     {
       frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
-      fi->extra_info->framesize = 0;
-      fi->extra_info->frameless_p = 1; /* Default frameless, detect framed */
+      get_frame_extra_info (fi)->framesize = 0;
+      get_frame_extra_info (fi)->frameless_p = 1;      /* Default frameless, detect framed */
 
       /* By default, the fi->frame is set to the value of the FP reg by gdb.
          This may not always be right; we may be in a frameless function,
 
       /* By default, the fi->frame is set to the value of the FP reg by gdb.
          This may not always be right; we may be in a frameless function,
@@ -829,24 +827,23 @@ xstormy16_frame_chain (struct frame_info *fi)
   else
     {
       /* Return computed offset from this frame's fp. */
   else
     {
       /* Return computed offset from this frame's fp. */
-      return get_frame_base (fi) - fi->extra_info->framesize;
+      return get_frame_base (fi) - get_frame_extra_info (fi)->framesize;
     }
 }
 
 static int
 xstormy16_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
 {
     }
 }
 
 static int
 xstormy16_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
 {
-  return chain < 0x8000 && FRAME_SAVED_PC (thisframe) >= 0x8000 &&
-    (thisframe->extra_info->frameless_p ||
-     get_frame_base (thisframe) - thisframe->extra_info->framesize == chain);
+  return chain < 0x8000 && DEPRECATED_FRAME_SAVED_PC (thisframe) >= 0x8000 &&
+    (get_frame_extra_info (thisframe)->frameless_p ||
+     get_frame_base (thisframe) - get_frame_extra_info (thisframe)->framesize == chain);
 }
 
 }
 
-/* Function: xstormy16_saved_pc_after_call
-   Returns the previous PC immediately after a function call.
-   This function is meant to bypass the regular get_saved_register
-   mechanism, ie. it is meant to work even if the frame isn't complete. 
-   Called by step_over_function, and sometimes by get_prev_frame.
-*/
+/* Function: xstormy16_saved_pc_after_call Returns the previous PC
+   immediately after a function call.  This function is meant to
+   bypass the regular frame_register() mechanism, ie. it is meant to
+   work even if the frame isn't complete.  Called by
+   step_over_function, and sometimes by get_prev_frame.  */
 
 static CORE_ADDR
 xstormy16_saved_pc_after_call (struct frame_info *ignore)
 
 static CORE_ADDR
 xstormy16_saved_pc_after_call (struct frame_info *ignore)
@@ -988,7 +985,7 @@ xstormy16_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr)
       if (addr2)
        addr = addr2;
     }
       if (addr2)
        addr = addr2;
     }
-  store_address (buf, TYPE_LENGTH (type), addr);
+  store_unsigned_integer (buf, TYPE_LENGTH (type), addr);
 }
 
 static CORE_ADDR
 }
 
 static CORE_ADDR
@@ -1038,31 +1035,31 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_num_regs (gdbarch, E_NUM_REGS);
   set_gdbarch_num_pseudo_regs (gdbarch, 0);
   set_gdbarch_sp_regnum (gdbarch, E_SP_REGNUM);
   set_gdbarch_num_regs (gdbarch, E_NUM_REGS);
   set_gdbarch_num_pseudo_regs (gdbarch, 0);
   set_gdbarch_sp_regnum (gdbarch, E_SP_REGNUM);
-  set_gdbarch_fp_regnum (gdbarch, E_FP_REGNUM);
+  set_gdbarch_deprecated_fp_regnum (gdbarch, E_FP_REGNUM);
   set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
   set_gdbarch_register_name (gdbarch, xstormy16_register_name);
   set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
   set_gdbarch_register_name (gdbarch, xstormy16_register_name);
-  set_gdbarch_register_size (gdbarch, xstormy16_reg_size);
-  set_gdbarch_register_bytes (gdbarch, E_ALL_REGS_SIZE);
+  set_gdbarch_deprecated_register_size (gdbarch, xstormy16_reg_size);
+  set_gdbarch_deprecated_register_bytes (gdbarch, E_ALL_REGS_SIZE);
   set_gdbarch_register_byte (gdbarch, xstormy16_register_byte);
   set_gdbarch_register_raw_size (gdbarch, xstormy16_register_raw_size);
   set_gdbarch_register_byte (gdbarch, xstormy16_register_byte);
   set_gdbarch_register_raw_size (gdbarch, xstormy16_register_raw_size);
-  set_gdbarch_max_register_raw_size (gdbarch, xstormy16_pc_size);
+  set_gdbarch_deprecated_max_register_raw_size (gdbarch, xstormy16_pc_size);
   set_gdbarch_register_virtual_size (gdbarch, xstormy16_register_raw_size);
   set_gdbarch_register_virtual_size (gdbarch, xstormy16_register_raw_size);
-  set_gdbarch_max_register_virtual_size (gdbarch, 4);
+  set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4);
   set_gdbarch_register_virtual_type (gdbarch, xstormy16_reg_virtual_type);
 
   /*
    * Frame Info
    */
   set_gdbarch_register_virtual_type (gdbarch, xstormy16_reg_virtual_type);
 
   /*
    * Frame Info
    */
-  set_gdbarch_init_extra_frame_info (gdbarch,
+  set_gdbarch_deprecated_init_extra_frame_info (gdbarch,
                                     xstormy16_init_extra_frame_info);
                                     xstormy16_init_extra_frame_info);
-  set_gdbarch_frame_init_saved_regs (gdbarch,
+  set_gdbarch_deprecated_frame_init_saved_regs (gdbarch,
                                     xstormy16_frame_init_saved_regs);
                                     xstormy16_frame_init_saved_regs);
-  set_gdbarch_frame_chain (gdbarch, xstormy16_frame_chain);
-  set_gdbarch_get_saved_register (gdbarch, xstormy16_get_saved_register);
-  set_gdbarch_saved_pc_after_call (gdbarch, xstormy16_saved_pc_after_call);
-  set_gdbarch_frame_saved_pc (gdbarch, xstormy16_frame_saved_pc);
+  set_gdbarch_deprecated_frame_chain (gdbarch, xstormy16_frame_chain);
+  set_gdbarch_deprecated_get_saved_register (gdbarch, xstormy16_get_saved_register);
+  set_gdbarch_deprecated_saved_pc_after_call (gdbarch, xstormy16_saved_pc_after_call);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, xstormy16_frame_saved_pc);
   set_gdbarch_skip_prologue (gdbarch, xstormy16_skip_prologue);
   set_gdbarch_skip_prologue (gdbarch, xstormy16_skip_prologue);
-  set_gdbarch_frame_chain_valid (gdbarch, xstormy16_frame_chain_valid);
+  set_gdbarch_deprecated_frame_chain_valid (gdbarch, xstormy16_frame_chain_valid);
 
   set_gdbarch_in_function_epilogue_p (gdbarch,
                                      xstormy16_in_function_epilogue_p);
 
   set_gdbarch_in_function_epilogue_p (gdbarch,
                                      xstormy16_in_function_epilogue_p);
@@ -1086,29 +1083,20 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
    * Call Dummies
    * 
    * These values and methods are used when gdb calls a target function.  */
    * Call Dummies
    * 
    * These values and methods are used when gdb calls a target function.  */
-  set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
-  set_gdbarch_push_return_address (gdbarch, xstormy16_push_return_address);
+  set_gdbarch_deprecated_push_return_address (gdbarch, xstormy16_push_return_address);
   set_gdbarch_deprecated_extract_return_value (gdbarch, xstormy16_extract_return_value);
   set_gdbarch_deprecated_extract_return_value (gdbarch, xstormy16_extract_return_value);
-  set_gdbarch_push_arguments (gdbarch, xstormy16_push_arguments);
-  set_gdbarch_pop_frame (gdbarch, xstormy16_pop_frame);
-  set_gdbarch_store_struct_return (gdbarch, xstormy16_store_struct_return);
+  set_gdbarch_deprecated_push_arguments (gdbarch, xstormy16_push_arguments);
+  set_gdbarch_deprecated_pop_frame (gdbarch, xstormy16_pop_frame);
+  set_gdbarch_deprecated_store_struct_return (gdbarch, xstormy16_store_struct_return);
   set_gdbarch_deprecated_store_return_value (gdbarch, xstormy16_store_return_value);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address);
   set_gdbarch_use_struct_convention (gdbarch,
                                     xstormy16_use_struct_convention);
   set_gdbarch_deprecated_store_return_value (gdbarch, xstormy16_store_return_value);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address);
   set_gdbarch_use_struct_convention (gdbarch,
                                     xstormy16_use_struct_convention);
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
-  set_gdbarch_call_dummy_start_offset (gdbarch, 0);
-  set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
-  set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
-  set_gdbarch_call_dummy_length (gdbarch, 0);
-  set_gdbarch_call_dummy_p (gdbarch, 1);
-  set_gdbarch_call_dummy_words (gdbarch, call_dummy_words);
-  set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
-  set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
-  /* set_gdbarch_call_dummy_stack_adjust */
-  set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
+  set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words);
+  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
   set_gdbarch_breakpoint_from_pc (gdbarch, xstormy16_breakpoint_from_pc);
 
   set_gdbarch_breakpoint_from_pc (gdbarch, xstormy16_breakpoint_from_pc);
 
+  set_gdbarch_char_signed (gdbarch, 0);
   set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT);
   set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT);
   set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
   set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT);
   set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT);
   set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
@@ -1118,7 +1106,6 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_pointer_to_address (gdbarch, xstormy16_pointer_to_address);
 
   set_gdbarch_stack_align (gdbarch, xstormy16_stack_align);
   set_gdbarch_pointer_to_address (gdbarch, xstormy16_pointer_to_address);
 
   set_gdbarch_stack_align (gdbarch, xstormy16_stack_align);
-  set_gdbarch_extra_stack_alignment_needed (gdbarch, 0);
 
   set_gdbarch_save_dummy_frame_tos (gdbarch, xstormy16_save_dummy_frame_tos);
 
 
   set_gdbarch_save_dummy_frame_tos (gdbarch, xstormy16_save_dummy_frame_tos);
 
@@ -1127,6 +1114,9 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_in_solib_call_trampoline (gdbarch,
                                        xstormy16_in_solib_call_trampoline);
 
   set_gdbarch_in_solib_call_trampoline (gdbarch,
                                        xstormy16_in_solib_call_trampoline);
 
+  /* Should be using push_dummy_call.  */
+  set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
+
   return gdbarch;
 }
 
   return gdbarch;
 }
 
@@ -1140,5 +1130,5 @@ _initialize_xstormy16_tdep (void)
   extern int print_insn_xstormy16 ();
 
   register_gdbarch_init (bfd_arch_xstormy16, xstormy16_gdbarch_init);
   extern int print_insn_xstormy16 ();
 
   register_gdbarch_init (bfd_arch_xstormy16, xstormy16_gdbarch_init);
-  tm_print_insn = print_insn_xstormy16;
+  deprecated_tm_print_insn = print_insn_xstormy16;
 }
 }
This page took 0.030499 seconds and 4 git commands to generate.