* procfs.c (proc_wait): Call print_sys_errmsg() if we get an
[deliverable/binutils-gdb.git] / gdb / i960-tdep.c
index a82328a2e5e5e44400333814fde722ca41554eb7..115bfe2aa45741f7ccb231b37e97319f7fc9e036 100644 (file)
@@ -7,8 +7,8 @@ This file is part of GDB.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,27 +16,24 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with this program; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* Miscellaneous i80960-dependent routines.
    Most are called from macros defined in "tm-i960.h".  */
 
-#include <stdio.h>
-#include <signal.h>
 #include "defs.h"
-#include "param.h"
+#include <signal.h>
 #include "symtab.h"
 #include "value.h"
 #include "frame.h"
-#include "signame.h"
 #include "ieee-float.h"
 
 /* Structure of i960 extended floating point format.  */
 
-const struct ext_format ext_format_i960 [] = {
+const struct ext_format ext_format_i960 = {
 /* tot sbyte smask expbyte manbyte */
{ 12, 9,    0x80, 9,8,           4,0  },              /* i960 */
  12, 9,    0x80, 9,8,           4,0,         /* i960 */
 };
 
 /* gdb960 is always running on a non-960 host.  Check its characteristics.
@@ -413,6 +410,8 @@ frame_args_address (fi, must_be_correct)
       ap = 0;
     else
       ap = read_register (G14_REGNUM);
+    if (ap == 0)
+      ap = fi->frame;
   }
   fi->arg_pointer = ap;                /* Cache it for next time */
   return ap;
@@ -464,20 +463,18 @@ CORE_ADDR
 leafproc_return (ip)
      CORE_ADDR ip;     /* ip from currently executing function */
 {
-  int i;
-  register struct misc_function *mf;
+  register struct minimal_symbol *msymbol;
   char *p;
   int dst;
   unsigned int insn1, insn2;
   CORE_ADDR return_addr;
   char *index ();
 
-  if ((i = find_pc_misc_function (ip)) >= 0)
+  if ((msymbol = lookup_minimal_symbol_by_pc (ip)) != NULL)
     {
-      mf = &misc_function_vector[i];
-      if ((p = index (mf->name, '.')) && !strcmp (p, ".lf"))
+      if ((p = index (msymbol -> name, '.')) && !strcmp (p, ".lf"))
        {
-         if (next_insn (mf->address, &insn1, &insn2)
+         if (next_insn (msymbol -> address, &insn1, &insn2)
              && (insn1 & 0xff87ffff) == 0x5c80161e       /* mov g14, gx */
              && (dst = REG_SRCDST (insn1)) <= G0_REGNUM + 7)
            {
@@ -486,7 +483,7 @@ leafproc_return (ip)
                 the return address from g14; otherwise, read it
                 from the register into which g14 was moved.  */
 
-             return_addr = read_register ((ip == mf->address)
+             return_addr = read_register ((ip == msymbol->address)
                                           ? G14_REGNUM : dst);
 
              /* We know we are in a leaf procedure, but we don't know
@@ -499,7 +496,7 @@ leafproc_return (ip)
 
              if (!next_insn (return_addr, &insn1, &insn2)
                  || (insn1 & 0xff000000) != 0xa000000   /* ret */
-                 || find_pc_misc_function (return_addr) != i)
+                 || lookup_minimal_symbol_by_pc (return_addr) != msymbol)
                return (return_addr);
            }
        }
@@ -623,8 +620,7 @@ print_fault( siggnal )
 
        if (siggnal < NSIG) {
              printf ("\nProgram received signal %d, %s\n",
-                     siggnal,
-                     sys_siglist[siggnal]);
+                     siggnal, safe_strsignal (siggnal));
        } else {
                /* The various target_wait()s bias the 80960 "signal number"
                   by adding NSIG to it, so it won't get confused with any
This page took 0.024268 seconds and 4 git commands to generate.