Index: ChangeLog
[deliverable/binutils-gdb.git] / gdb / vax-tdep.c
index eda740fe71a9aeea07f3c6af7ef8856ab5a57703..939c32713430cdde3a163f76b531eed161f65689 100644 (file)
@@ -1,6 +1,7 @@
 /* Print VAX instructions for GDB, the GNU debugger.
-   Copyright 1986, 1989, 1991, 1992, 1995, 1996, 1998, 1999, 2000, 2002, 2003
-   Free Software Foundation, Inc.
+
+   Copyright 1986, 1989, 1991, 1992, 1995, 1996, 1998, 1999, 2000,
+   2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "arch-utils.h"
 #include "gdb_string.h"
 #include "osabi.h"
+#include "dis-asm.h"
 
 #include "vax-tdep.h"
 
 static gdbarch_register_name_ftype vax_register_name;
-static gdbarch_register_byte_ftype vax_register_byte;
-static gdbarch_register_raw_size_ftype vax_register_raw_size;
-static gdbarch_register_virtual_size_ftype vax_register_virtual_size;
-static gdbarch_register_virtual_type_ftype vax_register_virtual_type;
 
 static gdbarch_skip_prologue_ftype vax_skip_prologue;
 static gdbarch_frame_num_args_ftype vax_frame_num_args;
 static gdbarch_deprecated_frame_chain_ftype vax_frame_chain;
-static gdbarch_frame_args_address_ftype vax_frame_args_address;
-static gdbarch_frame_locals_address_ftype vax_frame_locals_address;
 
 static gdbarch_deprecated_extract_return_value_ftype vax_extract_return_value;
-static gdbarch_deprecated_extract_struct_value_address_ftype
-    vax_extract_struct_value_address;
 
 static gdbarch_deprecated_push_dummy_frame_ftype vax_push_dummy_frame;
 \f
@@ -98,7 +92,7 @@ vax_frame_init_saved_regs (struct frame_info *frame)
   int regnum, regmask;
   CORE_ADDR next_addr;
 
-  if (get_frame_saved_regs (frame))
+  if (deprecated_get_frame_saved_regs (frame))
     return;
 
   frame_saved_regs_zalloc (frame);
@@ -112,18 +106,18 @@ vax_frame_init_saved_regs (struct frame_info *frame)
   for (regnum = 0; regnum < VAX_AP_REGNUM; regnum++)
     {
       if (regmask & (1 << regnum))
-        get_frame_saved_regs (frame)[regnum] = next_addr += 4;
+        deprecated_get_frame_saved_regs (frame)[regnum] = next_addr += 4;
     }
 
-  get_frame_saved_regs (frame)[SP_REGNUM] = next_addr + 4;
+  deprecated_get_frame_saved_regs (frame)[SP_REGNUM] = next_addr + 4;
   if (regmask & (1 << DEPRECATED_FP_REGNUM))
-    get_frame_saved_regs (frame)[SP_REGNUM] +=
+    deprecated_get_frame_saved_regs (frame)[SP_REGNUM] +=
       4 + (4 * read_memory_integer (next_addr + 4, 4));
 
-  get_frame_saved_regs (frame)[PC_REGNUM] = get_frame_base (frame) + 16;
-  get_frame_saved_regs (frame)[DEPRECATED_FP_REGNUM] = get_frame_base (frame) + 12;
-  get_frame_saved_regs (frame)[VAX_AP_REGNUM] = get_frame_base (frame) + 8;
-  get_frame_saved_regs (frame)[PS_REGNUM] = get_frame_base (frame) + 4;
+  deprecated_get_frame_saved_regs (frame)[PC_REGNUM] = get_frame_base (frame) + 16;
+  deprecated_get_frame_saved_regs (frame)[DEPRECATED_FP_REGNUM] = get_frame_base (frame) + 12;
+  deprecated_get_frame_saved_regs (frame)[VAX_AP_REGNUM] = get_frame_base (frame) + 8;
+  deprecated_get_frame_saved_regs (frame)[PS_REGNUM] = get_frame_base (frame) + 4;
 }
 
 /* Get saved user PC for sigtramp from sigcontext for BSD style sigtramp.  */
@@ -140,7 +134,7 @@ vax_sigtramp_saved_pc (struct frame_info *frame)
   /* Get sigcontext address, it is the third parameter on the stack.  */
   if (get_next_frame (frame))
     sigcontext_addr = read_memory_typed_address
-      (FRAME_ARGS_ADDRESS (get_next_frame (frame))
+      (DEPRECATED_FRAME_ARGS_ADDRESS (get_next_frame (frame))
        + FRAME_ARGS_SKIP + sigcontext_offs,
        builtin_type_void_data_ptr);
   else
@@ -182,16 +176,10 @@ vax_frame_args_address (struct frame_info *frame)
   return 0;
 }
 
-static CORE_ADDR
-vax_frame_locals_address (struct frame_info *frame)
-{
-  return (get_frame_base (frame));
-}
-
 static int
 vax_frame_num_args (struct frame_info *fi)
 {
-  return (0xff & read_memory_integer (FRAME_ARGS_ADDRESS (fi), 1));
+  return (0xff & read_memory_integer (DEPRECATED_FRAME_ARGS_ADDRESS (fi), 1));
 }
 
 static CORE_ADDR
@@ -199,7 +187,7 @@ vax_frame_chain (struct frame_info *frame)
 {
   /* In the case of the VAX, the frame's nominal address is the FP value,
      and 12 bytes later comes the saved previous FP value as a 4-byte word.  */
-  if (inside_entry_file (get_frame_pc (frame)))
+  if (deprecated_inside_entry_file (get_frame_pc (frame)))
     return (0);
 
   return (read_memory_integer (get_frame_base (frame) + 12, 4));
@@ -278,7 +266,7 @@ vax_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
 static void
 vax_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
 {
-  memcpy (valbuf, regbuf + REGISTER_BYTE (0), TYPE_LENGTH (valtype));
+  memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (0), TYPE_LENGTH (valtype));
 }
 
 static void
@@ -286,13 +274,6 @@ vax_store_return_value (struct type *valtype, char *valbuf)
 {
   deprecated_write_register_bytes (0, valbuf, TYPE_LENGTH (valtype));
 }
-
-static CORE_ADDR
-vax_extract_struct_value_address (char *regbuf)
-{
-  return (extract_unsigned_integer (regbuf + REGISTER_BYTE (0),
-                                   REGISTER_RAW_SIZE (0)));
-}
 \f
 static const unsigned char *
 vax_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
@@ -309,7 +290,7 @@ vax_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 static CORE_ADDR
 vax_skip_prologue (CORE_ADDR pc)
 {
-  register int op = (unsigned char) read_memory_integer (pc, 1);
+  int op = (unsigned char) read_memory_integer (pc, 1);
   if (op == 0x11)
     pc += 2;                   /* skip brb */
   if (op == 0x31)
@@ -359,7 +340,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* NOTE: cagney/2002-12-06: This can be deleted when this arch is
      ready to unwind the PC first (see frame.c:get_prev_frame()).  */
-  set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default);
+  set_gdbarch_deprecated_init_frame_pc (gdbarch, deprecated_init_frame_pc_default);
 
   /* Register info */
   set_gdbarch_num_regs (gdbarch, VAX_NUM_REGS);
@@ -371,13 +352,13 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_register_name (gdbarch, vax_register_name);
   set_gdbarch_deprecated_register_size (gdbarch, VAX_REGISTER_SIZE);
   set_gdbarch_deprecated_register_bytes (gdbarch, VAX_REGISTER_BYTES);
-  set_gdbarch_register_byte (gdbarch, vax_register_byte);
-  set_gdbarch_register_raw_size (gdbarch, vax_register_raw_size);
+  set_gdbarch_deprecated_register_byte (gdbarch, vax_register_byte);
+  set_gdbarch_deprecated_register_raw_size (gdbarch, vax_register_raw_size);
   set_gdbarch_deprecated_max_register_raw_size (gdbarch, VAX_MAX_REGISTER_RAW_SIZE);
-  set_gdbarch_register_virtual_size (gdbarch, vax_register_virtual_size);
+  set_gdbarch_deprecated_register_virtual_size (gdbarch, vax_register_virtual_size);
   set_gdbarch_deprecated_max_register_virtual_size (gdbarch,
                                          VAX_MAX_REGISTER_VIRTUAL_SIZE);
-  set_gdbarch_register_virtual_type (gdbarch, vax_register_virtual_type);
+  set_gdbarch_deprecated_register_virtual_type (gdbarch, vax_register_virtual_type);
 
   /* Frame and stack info */
   set_gdbarch_skip_prologue (gdbarch, vax_skip_prologue);
@@ -390,8 +371,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_frame_chain (gdbarch, vax_frame_chain);
   set_gdbarch_deprecated_frame_saved_pc (gdbarch, vax_frame_saved_pc);
 
-  set_gdbarch_frame_args_address (gdbarch, vax_frame_args_address);
-  set_gdbarch_frame_locals_address (gdbarch, vax_frame_locals_address);
+  set_gdbarch_deprecated_frame_args_address (gdbarch, vax_frame_args_address);
 
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, vax_frame_init_saved_regs);
 
@@ -403,7 +383,6 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_store_struct_return (gdbarch, vax_store_struct_return);
   set_gdbarch_deprecated_extract_return_value (gdbarch, vax_extract_return_value);
   set_gdbarch_deprecated_store_return_value (gdbarch, vax_store_return_value);
-  set_gdbarch_deprecated_extract_struct_value_address (gdbarch, vax_extract_struct_value_address);
 
   /* Call dummy info */
   set_gdbarch_deprecated_push_dummy_frame (gdbarch, vax_push_dummy_frame);
@@ -418,7 +397,6 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* Breakpoint info */
   set_gdbarch_breakpoint_from_pc (gdbarch, vax_breakpoint_from_pc);
-  set_gdbarch_decr_pc_after_break (gdbarch, 0);
 
   /* Misc info */
   set_gdbarch_function_start_offset (gdbarch, 2);
@@ -435,6 +413,8 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   return (gdbarch);
 }
 
+extern initialize_file_ftype _initialize_vax_tdep; /* -Wmissing-prototypes */
+
 void
 _initialize_vax_tdep (void)
 {
This page took 0.027054 seconds and 4 git commands to generate.