HPPA merge.
[deliverable/binutils-gdb.git] / gdb / m88k-xdep.c
index af734891593def536aa322babe81f3ffed54e6ec..d2d338dae1fd7858388c5bc6fd552bf7a386f329 100644 (file)
@@ -1,24 +1,23 @@
-/* Copyright (C) 1988, 1990 Free Software Foundation, Inc.
+/* Host-dependent Motorola 88xxx support for GDB, the GNU Debugger.
+   Copyright 1988, 1990, 1991 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
-GDB is free software; you can redistribute it and/or modify
+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.
 
-GDB is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 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 GDB; 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.  */
 
-#include <stdio.h>
 #include "defs.h"
-#include "param.h"
 #include "frame.h"
 #include "inferior.h"
 
@@ -31,19 +30,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <signal.h>
 #include "gdbcore.h"
 #include <sys/user.h>
-#ifndef USER                   /* added to support BCS ptrace_user */
 
+#ifndef USER                   /* added to support BCS ptrace_user */
 #define USER ptrace_user
 #endif
 #include <sys/ioctl.h>
 #include <fcntl.h>
-
-#ifdef COFF_ENCAPSULATE
-#include "a.out.encap.h"
-#else
-#include <a.out.h>
-#endif
-
 #include <sys/file.h>
 #include <sys/stat.h>
 
@@ -51,14 +43,20 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "setjmp.h"
 #include "value.h"
 
-/* define offsets to the pc instruction offsets in ptrace_user struct */
-#define SXIP_OFFSET (char *)&u.pt_sigframe.dg_sigframe.sc_sxip - \
-                               (char *)&u
-
-#define SNIP_OFFSET (char *)&u.pt_sigframe.dg_sigframe.sc_snip - \
-                               (char *)&u
+#ifdef DELTA88
+#include <sys/ptrace.h>
 
+/* define offsets to the pc instruction offsets in ptrace_user struct */
+#define SXIP_OFFSET (char *)&u.pt_sigframe.sig_sxip - (char *)&u
+#define SNIP_OFFSET (char *)&u.pt_sigframe.sig_snip - (char *)&u
+#define SFIP_OFFSET (char *)&u.pt_sigframe.sig_sfip - (char *)&u
+#else
+/* define offsets to the pc instruction offsets in ptrace_user struct */
+#define SXIP_OFFSET (char *)&u.pt_sigframe.dg_sigframe.sc_sxip - (char *)&u
+#define SNIP_OFFSET (char *)&u.pt_sigframe.dg_sigframe.sc_snip - (char *)&u
 #define SFIP_OFFSET (char *)&u.pt_sigframe.dg_sigframe.sc_sfip - (char *)&u
+#endif
+
 extern int have_symbol_file_p();
 
 extern jmp_buf stack_jmp;
@@ -67,9 +65,9 @@ extern int errno;
 extern char registers[REGISTER_BYTES];
 \f
 void
-fetch_inferior_registers ()
+fetch_inferior_registers (regno)
+     int regno;                /* Original value discarded */
 {
-  register int regno;
   register unsigned int regaddr;
   char buf[MAX_REGISTER_RAW_SIZE];
   register int i;
@@ -94,11 +92,11 @@ fetch_inferior_registers ()
       supply_register (regno, buf);
     }
     /* now load up registers 36 - 38; special pc registers */
-    *(int *) &buf[0] = ptrace (3,inferior_pid,(char *)&u.pt_sigframe.dg_sigframe.sc_sxip - (char *)&u ,0);
+    *(int *) &buf[0] = ptrace (3,inferior_pid,SXIP_OFFSET ,0);
     supply_register (SXIP_REGNUM, buf);
-    *(int *) &buf[0] = ptrace (3, inferior_pid, (char *)&u.pt_sigframe.dg_sigframe.sc_snip - (char *)&u ,0);
+    *(int *) &buf[0] = ptrace (3, inferior_pid,SNIP_OFFSET,0);
     supply_register (SNIP_REGNUM, buf);
-    *(int *) &buf[0] = ptrace (3, inferior_pid, (char *)&u.pt_sigframe.dg_sigframe.sc_sfip - (char *)&u ,0);
+    *(int *) &buf[0] = ptrace (3, inferior_pid,SFIP_OFFSET,0);
     supply_register (SFIP_REGNUM, buf);
 }
 
@@ -106,6 +104,7 @@ fetch_inferior_registers ()
    If REGNO is -1, do this for all registers.
    Otherwise, REGNO specifies which register (so we can save time).  */
 
+void
 store_inferior_registers (regno)
      int regno;
 {
@@ -114,18 +113,9 @@ store_inferior_registers (regno)
 
   struct USER u;
 
-#if defined(BCS)
-#if defined(DGUX)
 
   unsigned int offset = (char *) &u.pt_r0 - (char *) &u;
 
-#endif /* defined (DGUX) */
-#else
-
-  unsigned int offset = (char *) &u.pt_r0 - (char *) &u;
-
-#endif /* defined(BCS) */
-/*  offset = ptrace (3, inferior_pid, offset, 0) - KERNEL_U_ADDR; */
   regaddr = offset;
 
   if (regno >= 0)
@@ -276,7 +266,7 @@ core_file_command (filename, from_tty)
        corefile = savestring (filename, strlen (filename));
       else
        {
-         corefile = concat (current_directory, "/", filename);
+         corefile = concat (current_directory, "/", filename, NULL);
        }
       init_tdesc();
       current_context = init_dcontext();
This page took 0.028284 seconds and 4 git commands to generate.