s/value_ptr/struct value */
[deliverable/binutils-gdb.git] / gdb / alpha-tdep.c
index 664b131ab828d2f70b166455354a2f06efabb3c2..aa0eb5d100e76b4b8293f016008a0314d47f8e75 100644 (file)
@@ -1,5 +1,6 @@
 /* Target-dependent code for the ALPHA architecture, for GDB, the GNU Debugger.
-   Copyright 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "symfile.h"
 #include "objfiles.h"
 #include "gdb_string.h"
+#include "linespec.h"
+#include "regcache.h"
 
 /* FIXME: Some of this code should perhaps be merged with mips-tdep.c.  */
 
 /* Prototypes for local functions. */
 
-static alpha_extra_func_info_t push_sigtramp_desc PARAMS ((CORE_ADDR low_addr));
+static alpha_extra_func_info_t push_sigtramp_desc (CORE_ADDR low_addr);
 
-static CORE_ADDR read_next_frame_reg PARAMS ((struct frame_info *, int));
+static CORE_ADDR read_next_frame_reg (struct frame_info *, int);
 
-static CORE_ADDR heuristic_proc_start PARAMS ((CORE_ADDR));
+static CORE_ADDR heuristic_proc_start (CORE_ADDR);
 
-static alpha_extra_func_info_t heuristic_proc_desc PARAMS ((CORE_ADDR,
-                                                           CORE_ADDR,
-                                                     struct frame_info *));
+static alpha_extra_func_info_t heuristic_proc_desc (CORE_ADDR,
+                                                   CORE_ADDR,
+                                                   struct frame_info *);
 
-static alpha_extra_func_info_t find_proc_desc PARAMS ((CORE_ADDR,
-                                                      struct frame_info *));
+static alpha_extra_func_info_t find_proc_desc (CORE_ADDR,
+                                              struct frame_info *);
 
 #if 0
-static int alpha_in_lenient_prologue PARAMS ((CORE_ADDR, CORE_ADDR));
+static int alpha_in_lenient_prologue (CORE_ADDR, CORE_ADDR);
 #endif
 
-static void reinit_frame_cache_sfunc PARAMS ((char *, int,
-                                             struct cmd_list_element *));
+static void reinit_frame_cache_sfunc (char *, int, struct cmd_list_element *);
 
-static CORE_ADDR after_prologue PARAMS ((CORE_ADDR pc,
-                                        alpha_extra_func_info_t proc_desc));
+static CORE_ADDR after_prologue (CORE_ADDR pc,
+                                alpha_extra_func_info_t proc_desc);
 
-static int alpha_in_prologue PARAMS ((CORE_ADDR pc,
-                                     alpha_extra_func_info_t proc_desc));
+static int alpha_in_prologue (CORE_ADDR pc,
+                             alpha_extra_func_info_t proc_desc);
 
-static int alpha_about_to_return PARAMS ((CORE_ADDR pc));
+static int alpha_about_to_return (CORE_ADDR pc);
 
-void _initialize_alpha_tdep PARAMS ((void));
+void _initialize_alpha_tdep (void);
 
 /* Heuristic_proc_start may hunt through the text section for a long
    time across a 2400 baud serial line.  Allows the user to limit this
@@ -169,11 +171,10 @@ struct linked_proc_info
 #ifndef TM_LINUXALPHA_H
 /* HACK: Provide a prototype when compiling this file for non
    linuxalpha targets. */
-long alpha_linux_sigtramp_offset PARAMS ((CORE_ADDR pc));
+long alpha_linux_sigtramp_offset (CORE_ADDR pc);
 #endif
 long
-alpha_linux_sigtramp_offset (pc)
-     CORE_ADDR pc;
+alpha_linux_sigtramp_offset (CORE_ADDR pc)
 {
   unsigned int i[3], w;
   long off;
@@ -216,9 +217,7 @@ alpha_linux_sigtramp_offset (pc)
 /* Under OSF/1, the __sigtramp routine is frameless and has a frame
    size of zero, but we are able to backtrace through it.  */
 CORE_ADDR
-alpha_osf_skip_sigtramp_frame (frame, pc)
-     struct frame_info *frame;
-     CORE_ADDR pc;
+alpha_osf_skip_sigtramp_frame (struct frame_info *frame, CORE_ADDR pc)
 {
   char *name;
   find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
@@ -234,8 +233,7 @@ alpha_osf_skip_sigtramp_frame (frame, pc)
    descriptor is added to the linked_proc_desc_table.  */
 
 static alpha_extra_func_info_t
-push_sigtramp_desc (low_addr)
-     CORE_ADDR low_addr;
+push_sigtramp_desc (CORE_ADDR low_addr)
 {
   struct linked_proc_info *link;
   alpha_extra_func_info_t proc_desc;
@@ -266,8 +264,7 @@ push_sigtramp_desc (low_addr)
    NULL).  */
 
 void
-alpha_find_saved_regs (frame)
-     struct frame_info *frame;
+alpha_find_saved_regs (struct frame_info *frame)
 {
   int ireg;
   CORE_ADDR reg_position;
@@ -355,9 +352,7 @@ alpha_find_saved_regs (frame)
 }
 
 static CORE_ADDR
-read_next_frame_reg (fi, regno)
-     struct frame_info *fi;
-     int regno;
+read_next_frame_reg (struct frame_info *fi, int regno)
 {
   for (; fi; fi = fi->next)
     {
@@ -377,8 +372,7 @@ read_next_frame_reg (fi, regno)
 }
 
 CORE_ADDR
-alpha_frame_saved_pc (frame)
-     struct frame_info *frame;
+alpha_frame_saved_pc (struct frame_info *frame)
 {
   alpha_extra_func_info_t proc_desc = frame->proc_desc;
   /* We have to get the saved pc from the sigcontext
@@ -392,8 +386,7 @@ alpha_frame_saved_pc (frame)
 }
 
 CORE_ADDR
-alpha_saved_pc_after_call (frame)
-     struct frame_info *frame;
+alpha_saved_pc_after_call (struct frame_info *frame)
 {
   CORE_ADDR pc = frame->pc;
   CORE_ADDR tmp;
@@ -422,8 +415,7 @@ static struct frame_saved_regs temp_saved_regs;
    $zero,($ra),1" on alpha. */
 
 static int
-alpha_about_to_return (pc)
-     CORE_ADDR pc;
+alpha_about_to_return (CORE_ADDR pc)
 {
   return read_memory_integer (pc, 4) == 0x6bfa8001;
 }
@@ -435,8 +427,7 @@ alpha_about_to_return (pc)
    lines.  */
 
 static CORE_ADDR
-heuristic_proc_start (pc)
-     CORE_ADDR pc;
+heuristic_proc_start (CORE_ADDR pc)
 {
   CORE_ADDR start_pc = pc;
   CORE_ADDR fence = start_pc - heuristic_fence_post;
@@ -465,7 +456,7 @@ heuristic_proc_start (pc)
            else
              warning ("Hit heuristic-fence-post without finding");
 
-           warning ("enclosing function for address 0x%lx", pc);
+           warning ("enclosing function for address 0x%s", paddr_nz (pc));
            if (!blurb_printed)
              {
                printf_filtered ("\
@@ -489,9 +480,8 @@ Otherwise, you told GDB there was a function where there isn't one, or\n\
 }
 
 static alpha_extra_func_info_t
-heuristic_proc_desc (start_pc, limit_pc, next_frame)
-     CORE_ADDR start_pc, limit_pc;
-     struct frame_info *next_frame;
+heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
+                    struct frame_info *next_frame)
 {
   CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM);
   CORE_ADDR cur_pc;
@@ -613,9 +603,7 @@ heuristic_proc_desc (start_pc, limit_pc, next_frame)
    find the prologue, then return 0.  */
 
 static CORE_ADDR
-after_prologue (pc, proc_desc)
-     CORE_ADDR pc;
-     alpha_extra_func_info_t proc_desc;
+after_prologue (CORE_ADDR pc, alpha_extra_func_info_t proc_desc)
 {
   struct symtab_and_line sal;
   CORE_ADDR func_addr, func_end;
@@ -653,9 +641,7 @@ after_prologue (pc, proc_desc)
    are definitively *not* in a function prologue.  */
 
 static int
-alpha_in_prologue (pc, proc_desc)
-     CORE_ADDR pc;
-     alpha_extra_func_info_t proc_desc;
+alpha_in_prologue (CORE_ADDR pc, alpha_extra_func_info_t proc_desc)
 {
   CORE_ADDR after_prologue_pc;
 
@@ -669,9 +655,7 @@ alpha_in_prologue (pc, proc_desc)
 }
 
 static alpha_extra_func_info_t
-find_proc_desc (pc, next_frame)
-     CORE_ADDR pc;
-     struct frame_info *next_frame;
+find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame)
 {
   alpha_extra_func_info_t proc_desc;
   struct block *b;
@@ -793,8 +777,7 @@ find_proc_desc (pc, next_frame)
 alpha_extra_func_info_t cached_proc_desc;
 
 CORE_ADDR
-alpha_frame_chain (frame)
-     struct frame_info *frame;
+alpha_frame_chain (struct frame_info *frame)
 {
   alpha_extra_func_info_t proc_desc;
   CORE_ADDR saved_pc = FRAME_SAVED_PC (frame);
@@ -828,8 +811,7 @@ alpha_frame_chain (frame)
 }
 
 void
-init_extra_frame_info (frame)
-     struct frame_info *frame;
+init_extra_frame_info (struct frame_info *frame)
 {
   /* Use proc_desc calculated in frame_chain */
   alpha_extra_func_info_t proc_desc =
@@ -901,9 +883,7 @@ init_extra_frame_info (frame)
    arguments without difficulty.  */
 
 struct frame_info *
-setup_arbitrary_frame (argc, argv)
-     int argc;
-     CORE_ADDR *argv;
+setup_arbitrary_frame (int argc, CORE_ADDR *argv)
 {
   if (argc != 2)
     error ("ALPHA frame specifications require two arguments: sp and pc");
@@ -922,12 +902,8 @@ setup_arbitrary_frame (argc, argv)
    structure to be returned is passed as a hidden first argument.  */
 
 CORE_ADDR
-alpha_push_arguments (nargs, args, sp, struct_return, struct_addr)
-     int nargs;
-     value_ptr *args;
-     CORE_ADDR sp;
-     int struct_return;
-     CORE_ADDR struct_addr;
+alpha_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+                     int struct_return, CORE_ADDR struct_addr)
 {
   int i;
   int accumulate_size = struct_return ? 8 : 0;
@@ -946,7 +922,7 @@ alpha_push_arguments (nargs, args, sp, struct_return, struct_addr)
 
   for (i = 0, m_arg = alpha_args; i < nargs; i++, m_arg++)
     {
-      value_ptr arg = args[i];
+      struct value *arg = args[i];
       struct type *arg_type = check_typedef (VALUE_TYPE (arg));
       /* Cast argument to long if necessary as the compiler does it too.  */
       switch (TYPE_CODE (arg_type))
@@ -1008,7 +984,7 @@ alpha_push_arguments (nargs, args, sp, struct_return, struct_addr)
 }
 
 void
-alpha_push_dummy_frame ()
+alpha_push_dummy_frame (void)
 {
   int ireg;
   struct linked_proc_info *link;
@@ -1124,7 +1100,7 @@ alpha_push_dummy_frame ()
 }
 
 void
-alpha_pop_frame ()
+alpha_pop_frame (void)
 {
   register int regnum;
   struct frame_info *frame = get_current_frame ();
@@ -1180,7 +1156,7 @@ alpha_pop_frame ()
       else
        linked_proc_desc_table = pi_ptr->next;
 
-      free (pi_ptr);
+      xfree (pi_ptr);
     }
 }
 \f
@@ -1190,13 +1166,11 @@ alpha_pop_frame ()
    LENIENT, then we must skip everything which is involved in setting
    up the frame (it's OK to skip more, just so long as we don't skip
    anything which might clobber the registers which are being saved.
-   Currently we must not skip more on the alpha, but we might the lenient
-   stuff some day.  */
+   Currently we must not skip more on the alpha, but we might need the
+   lenient stuff some day.  */
 
 CORE_ADDR
-alpha_skip_prologue (pc, lenient)
-     CORE_ADDR pc;
-     int lenient;
+alpha_skip_prologue (CORE_ADDR pc, int lenient)
 {
   unsigned long inst;
   int offset;
@@ -1273,9 +1247,7 @@ alpha_skip_prologue (pc, lenient)
    STARTADDR?  */
 
 static int
-alpha_in_lenient_prologue (startaddr, pc)
-     CORE_ADDR startaddr;
-     CORE_ADDR pc;
+alpha_in_lenient_prologue (CORE_ADDR startaddr, CORE_ADDR pc)
 {
   CORE_ADDR end_prologue = alpha_skip_prologue (startaddr, 1);
   return pc >= startaddr && pc < end_prologue;
@@ -1289,11 +1261,8 @@ alpha_in_lenient_prologue (startaddr, pc)
    memory format is an integer with 4 bytes or less, as the representation
    of integers in floating point registers is different. */
 void
-alpha_register_convert_to_virtual (regnum, valtype, raw_buffer, virtual_buffer)
-     int regnum;
-     struct type *valtype;
-     char *raw_buffer;
-     char *virtual_buffer;
+alpha_register_convert_to_virtual (int regnum, struct type *valtype,
+                                  char *raw_buffer, char *virtual_buffer)
 {
   if (TYPE_LENGTH (valtype) >= REGISTER_RAW_SIZE (regnum))
     {
@@ -1318,11 +1287,8 @@ alpha_register_convert_to_virtual (regnum, valtype, raw_buffer, virtual_buffer)
 }
 
 void
-alpha_register_convert_to_raw (valtype, regnum, virtual_buffer, raw_buffer)
-     struct type *valtype;
-     int regnum;
-     char *virtual_buffer;
-     char *raw_buffer;
+alpha_register_convert_to_raw (struct type *valtype, int regnum,
+                              char *virtual_buffer, char *raw_buffer)
 {
   if (TYPE_LENGTH (valtype) >= REGISTER_RAW_SIZE (regnum))
     {
@@ -1353,10 +1319,8 @@ alpha_register_convert_to_raw (valtype, regnum, virtual_buffer, raw_buffer)
    extract and copy its value into `valbuf'.  */
 
 void
-alpha_extract_return_value (valtype, regbuf, valbuf)
-     struct type *valtype;
-     char regbuf[REGISTER_BYTES];
-     char *valbuf;
+alpha_extract_return_value (struct type *valtype,
+                           char regbuf[REGISTER_BYTES], char *valbuf)
 {
   if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
     alpha_register_convert_to_virtual (FP0_REGNUM, valtype,
@@ -1370,9 +1334,7 @@ alpha_extract_return_value (valtype, regbuf, valbuf)
    write its value into the appropriate register.  */
 
 void
-alpha_store_return_value (valtype, valbuf)
-     struct type *valtype;
-     char *valbuf;
+alpha_store_return_value (struct type *valtype, char *valbuf)
 {
   char raw_buffer[MAX_REGISTER_RAW_SIZE];
   int regnum = V0_REGNUM;
@@ -1394,10 +1356,7 @@ alpha_store_return_value (valtype, valbuf)
    callable as an sfunc.  */
 
 static void
-reinit_frame_cache_sfunc (args, from_tty, c)
-     char *args;
-     int from_tty;
-     struct cmd_list_element *c;
+reinit_frame_cache_sfunc (char *args, int from_tty, struct cmd_list_element *c)
 {
   reinit_frame_cache ();
 }
@@ -1408,7 +1367,7 @@ reinit_frame_cache_sfunc (args, from_tty, c)
  */
 
 CORE_ADDR
-alpha_call_dummy_address ()
+alpha_call_dummy_address (void)
 {
   CORE_ADDR entry;
   struct minimal_symbol *sym;
@@ -1427,7 +1386,7 @@ alpha_call_dummy_address ()
 }
 
 void
-_initialize_alpha_tdep ()
+_initialize_alpha_tdep (void)
 {
   struct cmd_list_element *c;
 
This page took 0.075573 seconds and 4 git commands to generate.