Fix comments on `struct frame_info'.
[deliverable/binutils-gdb.git] / gdb / i960-tdep.c
index eff41361a5fd47303d8e055908f7bf5174ec41b9..197ac103eafad871bf93cc027a67b1d45d81efd8 100644 (file)
@@ -1,5 +1,6 @@
 /* Target-machine dependent code for the Intel 960
-   Copyright 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    examine_prologue and other parts contributed by Wind River Systems.
 
 #include "target.h"
 #include "gdbcore.h"
 #include "inferior.h"
+#include "regcache.h"
 
-static CORE_ADDR next_insn PARAMS ((CORE_ADDR memaddr,
-                                   unsigned int *pword1,
-                                   unsigned int *pword2));
+static CORE_ADDR next_insn (CORE_ADDR memaddr,
+                           unsigned int *pword1, unsigned int *pword2);
 
 /* Does the specified function use the "struct returning" convention
    or the "value returning" convention?  The "value returning" convention
@@ -48,9 +49,7 @@ static CORE_ADDR next_insn PARAMS ((CORE_ADDR memaddr,
    If it's more than 16 bytes long, g13 pointed to it on entry.  */
 
 int
-i960_use_struct_convention (gcc_p, type)
-     int gcc_p;
-     struct type *type;
+i960_use_struct_convention (int gcc_p, struct type *type)
 {
   return (TYPE_LENGTH (type) > 16);
 }
@@ -59,7 +58,7 @@ i960_use_struct_convention (gcc_p, type)
    This routine must be called as part of gdb initialization.  */
 
 static void
-check_host ()
+check_host (void)
 {
   int i;
 
@@ -171,11 +170,8 @@ check_host ()
   (((addr) < (lim)) ? next_insn (addr, pword1, pword2) : 0)
 
 static CORE_ADDR
-examine_prologue (ip, limit, frame_addr, fsr)
-     register CORE_ADDR ip;
-     register CORE_ADDR limit;
-     CORE_ADDR frame_addr;
-     struct frame_saved_regs *fsr;
+examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit,
+                 CORE_ADDR frame_addr, struct frame_saved_regs *fsr)
 {
   register CORE_ADDR next_ip;
   register int src, dst;
@@ -337,8 +333,7 @@ examine_prologue (ip, limit, frame_addr, fsr)
    prologue.  */
 
 CORE_ADDR
-i960_skip_prologue (ip)
-CORE_ADDR (ip);
+i960_skip_prologue (CORE_ADDR ip)
 {
   struct frame_saved_regs saved_regs_dummy;
   struct symtab_and_line sal;
@@ -360,9 +355,7 @@ CORE_ADDR (ip);
    fairly expensive.  */
 
 void
-frame_find_saved_regs (fi, fsr)
-     struct frame_info *fi;
-     struct frame_saved_regs *fsr;
+frame_find_saved_regs (struct frame_info *fi, struct frame_saved_regs *fsr)
 {
   register CORE_ADDR next_addr;
   register CORE_ADDR *saved_regs;
@@ -428,8 +421,7 @@ frame_find_saved_regs (fi, fsr)
    described by FI.  Returns 0 if the address is unknown.  */
 
 CORE_ADDR
-frame_args_address (fi, must_be_correct)
-     struct frame_info *fi;
+frame_args_address (struct frame_info *fi, int must_be_correct)
 {
   struct frame_saved_regs fsr;
   CORE_ADDR ap;
@@ -460,8 +452,7 @@ frame_args_address (fi, must_be_correct)
    described by FI.  Returns 0 if the address is unknown.  */
 
 CORE_ADDR
-frame_struct_result_address (fi)
-     struct frame_info *fi;
+frame_struct_result_address (struct frame_info *fi)
 {
   struct frame_saved_regs fsr;
   CORE_ADDR ap;
@@ -489,9 +480,11 @@ frame_struct_result_address (fi)
 }
 
 /* Return address to which the currently executing leafproc will return,
-   or 0 if ip is not in a leafproc (or if we can't tell if it is).
+   or 0 if IP, the value of the instruction pointer from the currently
+   executing function, is not in a leafproc (or if we can't tell if it
+   is).
 
-   Do this by finding the starting address of the routine in which ip lies.
+   Do this by finding the starting address of the routine in which IP lies.
    If the instruction there is "mov g14, gx" (where x is in [0,7]), this
    is a leafproc and the return address is in register gx.  Well, this is
    true unless the return address points at a RET instruction in the current
@@ -499,8 +492,7 @@ frame_struct_result_address (fi)
    has been entered through the CALL entry point.  */
 
 CORE_ADDR
-leafproc_return (ip)
-     CORE_ADDR ip;             /* ip from currently executing function */
+leafproc_return (CORE_ADDR ip)
 {
   register struct minimal_symbol *msymbol;
   char *p;
@@ -552,8 +544,7 @@ leafproc_return (ip)
    unless the function is a leaf procedure.  */
 
 CORE_ADDR
-saved_pc_after_call (frame)
-     struct frame_info *frame;
+saved_pc_after_call (struct frame_info *frame)
 {
   CORE_ADDR saved_pc;
 
@@ -621,8 +612,7 @@ i960_pop_frame (void)
    corresponds.  */
 
 enum target_signal
-i960_fault_to_signal (fault)
-     int fault;
+i960_fault_to_signal (int fault)
 {
   switch (fault)
     {
@@ -696,12 +686,13 @@ struct tabent
   char numops;
 };
 
-static int                     /* returns instruction length: 4 or 8 */
-mem (memaddr, word1, word2, noprint)
-     unsigned long memaddr;
-     unsigned long word1, word2;
-     int noprint;              /* If TRUE, return instruction length, but
-                                  don't output any text.  */
+/* Return instruction length, either 4 or 8.  When NOPRINT is non-zero
+   (TRUE), don't output any text.  (Actually, as implemented, if NOPRINT
+   is 0, abort() is called.) */
+
+static int
+mem (unsigned long memaddr, unsigned long word1, unsigned long word2,
+     int noprint)
 {
   int i, j;
   int len;
@@ -785,7 +776,7 @@ mem (memaddr, word1, word2, noprint)
     {
       return len;
     }
-  abort ();
+  internal_error (__FILE__, __LINE__, "failed internal consistency check");
 }
 
 /* Read the i960 instruction at 'memaddr' and return the address of 
@@ -795,9 +786,7 @@ mem (memaddr, word1, word2, noprint)
    'pword2'.  */
 
 static CORE_ADDR
-next_insn (memaddr, pword1, pword2)
-     unsigned int *pword1, *pword2;
-     CORE_ADDR memaddr;
+next_insn (CORE_ADDR memaddr, unsigned int *pword1, unsigned int *pword2)
 {
   int len;
   char buf[8];
@@ -853,9 +842,7 @@ next_insn (memaddr, pword1, pword2)
    they display this frame.  */
 
 int
-mon960_frame_chain_valid (chain, curframe)
-     CORE_ADDR chain;
-     struct frame_info *curframe;
+mon960_frame_chain_valid (CORE_ADDR chain, struct frame_info *curframe)
 {
   struct symbol *sym;
   struct minimal_symbol *msymbol;
@@ -899,7 +886,7 @@ mon960_frame_chain_valid (chain, curframe)
 
 
 void
-_initialize_i960_tdep ()
+_initialize_i960_tdep (void)
 {
   check_host ();
 
This page took 0.025268 seconds and 4 git commands to generate.