libiberty/ChangeLog:
[deliverable/binutils-gdb.git] / gdb / h8300-tdep.c
index 471a3c0f84c3cf559eb07fb881c63835c9eb71b2..3e12afdb7ff7c0c74eb5fc15dcd64a2158de72a2 100644 (file)
@@ -440,11 +440,11 @@ h8300_examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit,
     }
 
   /* The args are always reffed based from the stack pointer */
-  fi->extra_info->args_pointer = after_prolog_fp;
+  get_frame_extra_info (fi)->args_pointer = after_prolog_fp;
   /* Locals are always reffed based from the fp */
-  fi->extra_info->locals_pointer = after_prolog_fp;
+  get_frame_extra_info (fi)->locals_pointer = after_prolog_fp;
   /* The PC is at a known place */
-  fi->extra_info->from_pc =
+  get_frame_extra_info (fi)->from_pc =
     read_memory_unsigned_integer (after_prolog_fp + BINWORD, BINWORD);
 
   /* Rememeber any others too */
@@ -475,7 +475,8 @@ h8300_frame_init_saved_regs (struct frame_info *fi)
          struct symtab_and_line sal = find_pc_line (func_addr, 0);
          CORE_ADDR limit = (sal.end && sal.end < get_frame_pc (fi)) ? sal.end : get_frame_pc (fi);
          /* This will fill in fields in fi. */
-         h8300_examine_prologue (func_addr, limit, fi->frame, get_frame_saved_regs (fi), fi);
+         h8300_examine_prologue (func_addr, limit, get_frame_base (fi),
+                                 get_frame_saved_regs (fi), fi);
        }
       /* Else we're out of luck (can't debug completely stripped code). 
         FIXME. */
@@ -484,8 +485,8 @@ h8300_frame_init_saved_regs (struct frame_info *fi)
 
 /* Given a GDB frame, determine the address of the calling function's
    frame.  This will be used to create a new GDB frame struct, and
-   then INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC will be
-   called for the new frame.
+   then DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC
+   will be called for the new frame.
 
    For us, the frame address is its stack pointer value, so we look up
    the function prologue to determine the caller's sp value, and return it.  */
@@ -493,12 +494,15 @@ h8300_frame_init_saved_regs (struct frame_info *fi)
 static CORE_ADDR
 h8300_frame_chain (struct frame_info *thisframe)
 {
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (thisframe), thisframe->frame, thisframe->frame))
+  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (thisframe),
+                                  get_frame_base (thisframe),
+                                  get_frame_base (thisframe)))
     {                          /* initialize the from_pc now */
-      thisframe->extra_info->from_pc =
-       deprecated_read_register_dummy (get_frame_pc (thisframe), thisframe->frame,
+      get_frame_extra_info (thisframe)->from_pc =
+       deprecated_read_register_dummy (get_frame_pc (thisframe),
+                                       get_frame_base (thisframe),
                                        E_PC_REGNUM);
-      return thisframe->frame;
+      return get_frame_base (thisframe);
     }
   return get_frame_saved_regs (thisframe)[E_SP_REGNUM];
 }
@@ -511,27 +515,30 @@ h8300_frame_chain (struct frame_info *thisframe)
 static CORE_ADDR
 h8300_frame_saved_pc (struct frame_info *frame)
 {
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
-    return deprecated_read_register_dummy (get_frame_pc (frame), frame->frame,
+  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+                                  get_frame_base (frame),
+                                  get_frame_base (frame)))
+    return deprecated_read_register_dummy (get_frame_pc (frame),
+                                          get_frame_base (frame),
                                           E_PC_REGNUM);
   else
-    return frame->extra_info->from_pc;
+    return get_frame_extra_info (frame)->from_pc;
 }
 
 static void
 h8300_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));
-      fi->extra_info->from_pc = 0;
-      fi->extra_info->args_pointer = 0;                /* Unknown */
-      fi->extra_info->locals_pointer = 0;      /* Unknown */
+      get_frame_extra_info (fi)->from_pc = 0;
+      get_frame_extra_info (fi)->args_pointer = 0;             /* Unknown */
+      get_frame_extra_info (fi)->locals_pointer = 0;   /* Unknown */
       
       if (!get_frame_pc (fi))
         {
-         if (fi->next)
-           deprecated_update_frame_pc_hack (fi, h8300_frame_saved_pc (fi->next));
+         if (get_next_frame (fi))
+           deprecated_update_frame_pc_hack (fi, h8300_frame_saved_pc (get_next_frame (fi)));
        }
       h8300_frame_init_saved_regs (fi);
     }
@@ -540,9 +547,10 @@ h8300_init_extra_frame_info (int fromleaf, struct frame_info *fi)
 static CORE_ADDR
 h8300_frame_locals_address (struct frame_info *fi)
 {
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+                                  get_frame_base (fi)))
     return (CORE_ADDR) 0;      /* Not sure what else to do... */
-  return fi->extra_info->locals_pointer;
+  return get_frame_extra_info (fi)->locals_pointer;
 }
 
 /* Return the address of the argument block for the frame
@@ -551,9 +559,10 @@ h8300_frame_locals_address (struct frame_info *fi)
 static CORE_ADDR
 h8300_frame_args_address (struct frame_info *fi)
 {
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+                                  get_frame_base (fi)))
     return (CORE_ADDR) 0;      /* Not sure what else to do... */
-  return fi->extra_info->args_pointer;
+  return get_frame_extra_info (fi)->args_pointer;
 }
 
 /* Round N up or down to the nearest multiple of UNIT.
@@ -746,7 +755,9 @@ h8300_pop_frame (void)
   unsigned regno;
   struct frame_info *frame = get_current_frame ();
 
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+                                  get_frame_base (frame),
+                                  get_frame_base (frame)))
     {
       generic_pop_dummy_frame ();
     }
@@ -761,11 +772,11 @@ h8300_pop_frame (void)
                            read_memory_integer (get_frame_saved_regs (frame)[regno],
                                                 BINWORD));
          else if (get_frame_saved_regs (frame)[regno] && regno == E_SP_REGNUM)
-           write_register (regno, frame->frame + 2 * BINWORD);
+           write_register (regno, get_frame_base (frame) + 2 * BINWORD);
        }
 
       /* Don't forget to update the PC too!  */
-      write_register (E_PC_REGNUM, frame->extra_info->from_pc);
+      write_register (E_PC_REGNUM, get_frame_extra_info (frame)->from_pc);
     }
   flush_cached_frames ();
 }
@@ -1090,16 +1101,16 @@ h8300_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_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, h8300_register_name);
-  set_gdbarch_register_size (gdbarch, BINWORD);
+  set_gdbarch_deprecated_register_size (gdbarch, BINWORD);
   set_gdbarch_register_bytes (gdbarch, E_NUM_REGS * BINWORD);
   set_gdbarch_register_byte (gdbarch, h8300_register_byte);
   set_gdbarch_register_raw_size (gdbarch, h8300_register_raw_size);
-  set_gdbarch_max_register_raw_size (gdbarch, h8300h_reg_size);
+  set_gdbarch_deprecated_max_register_raw_size (gdbarch, h8300h_reg_size);
   set_gdbarch_register_virtual_size (gdbarch, h8300_register_raw_size);
-  set_gdbarch_max_register_virtual_size (gdbarch, h8300h_reg_size);
+  set_gdbarch_deprecated_max_register_virtual_size (gdbarch, h8300h_reg_size);
   set_gdbarch_register_virtual_type (gdbarch, h8300_register_virtual_type);
   set_gdbarch_print_registers_info (gdbarch, h8300_print_registers_info);
   set_gdbarch_print_float_info (gdbarch, h8300_print_float_info);
@@ -1107,11 +1118,11 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /*
    * Frame Info
    */
-  set_gdbarch_init_extra_frame_info (gdbarch, h8300_init_extra_frame_info);
-  set_gdbarch_frame_init_saved_regs (gdbarch, h8300_frame_init_saved_regs);
-  set_gdbarch_frame_chain (gdbarch, h8300_frame_chain);
-  set_gdbarch_saved_pc_after_call (gdbarch, h8300_saved_pc_after_call);
-  set_gdbarch_frame_saved_pc (gdbarch, h8300_frame_saved_pc);
+  set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, h8300_frame_init_saved_regs);
+  set_gdbarch_deprecated_init_extra_frame_info (gdbarch, h8300_init_extra_frame_info);
+  set_gdbarch_deprecated_frame_chain (gdbarch, h8300_frame_chain);
+  set_gdbarch_deprecated_saved_pc_after_call (gdbarch, h8300_saved_pc_after_call);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, h8300_frame_saved_pc);
   set_gdbarch_skip_prologue (gdbarch, h8300_skip_prologue);
   set_gdbarch_frame_args_address (gdbarch, h8300_frame_args_address);
   set_gdbarch_frame_locals_address (gdbarch, h8300_frame_locals_address);
@@ -1137,26 +1148,16 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
    * 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, h8300_push_return_address);
+  set_gdbarch_deprecated_push_return_address (gdbarch, h8300_push_return_address);
   set_gdbarch_deprecated_extract_return_value (gdbarch, h8300_extract_return_value);
-  set_gdbarch_push_arguments (gdbarch, h8300_push_arguments);
-  set_gdbarch_pop_frame (gdbarch, h8300_pop_frame);
-  set_gdbarch_store_struct_return (gdbarch, h8300_store_struct_return);
+  set_gdbarch_deprecated_push_arguments (gdbarch, h8300_push_arguments);
+  set_gdbarch_deprecated_pop_frame (gdbarch, h8300_pop_frame);
+  set_gdbarch_deprecated_store_struct_return (gdbarch, h8300_store_struct_return);
   set_gdbarch_deprecated_store_return_value (gdbarch, h8300_store_return_value);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, h8300_extract_struct_value_address);
   set_gdbarch_use_struct_convention (gdbarch, h8300_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, h8300_breakpoint_from_pc);
 
   set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT);
@@ -1165,15 +1166,17 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_addr_bit (gdbarch, BINWORD * TARGET_CHAR_BIT);
 
   /* set_gdbarch_stack_align (gdbarch, SOME_stack_align); */
-  set_gdbarch_extra_stack_alignment_needed (gdbarch, 0);
   set_gdbarch_believe_pcc_promotion (gdbarch, 1);
 
+  /* Should be using push_dummy_call.  */
+  set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
+
   return gdbarch;
 }
 
 void
 _initialize_h8300_tdep (void)
 {
-  tm_print_insn = gdb_print_insn_h8300;
+  deprecated_tm_print_insn = gdb_print_insn_h8300;
   register_gdbarch_init (bfd_arch_h8300, h8300_gdbarch_init);
 }
This page took 0.027538 seconds and 4 git commands to generate.