* Rename remote-es1800.c to remote-es.c
[deliverable/binutils-gdb.git] / gdb / irix4-nat.c
index 5127bc2bd7bba2b5023c2e4207e159ff0876d2d0..d2d4258b9e596cc24a3ede17ea44ddd434fb3593 100644 (file)
@@ -1,7 +1,8 @@
-/* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger.
-   Copyright 1988, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Native support for the SGI Iris running IRIX version 4, for GDB.
+   Copyright 1988, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
    Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
    and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
+   Implemented for Irix 4.x by Garrett A. Wollman.
 
 This file is part of GDB.
 
@@ -20,13 +21,15 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include "defs.h"
-
-/*
- * Implemented for Irix 4.x by Garrett A. Wollman
- */
+#include "inferior.h"
 
 #include <sys/time.h>
 #include <sys/procfs.h>
+#include <setjmp.h>            /* For JB_XXX.  */
+
+/* Size of elements in jmpbuf */
+
+#define JB_ELEMENT_SIZE 4
 
 typedef unsigned int greg_t;   /* why isn't this defined? */
 
@@ -59,7 +62,6 @@ fill_gregset (gregsetp, regno)
 {
   int regi;
   register greg_t *regp = (greg_t *)(gregsetp->gp_regs);
-  extern char registers[];
 
   /* same FIXME as above wrt 32*/
   for (regi = 0; regi < 32; regi++)
@@ -109,14 +111,13 @@ fill_fpregset (fpregsetp, regno)
 {
   int regi;
   char *from, *to;
-  extern char registers[];
 
   for (regi = FP0_REGNUM; regi < FP0_REGNUM + 32; regi++)
     {
       if ((regno == -1) || (regno == regi))
        {
          from = (char *) &registers[REGISTER_BYTE (regi)];
-         to = (char *) &(fpregsetp->fp_r.fp_regs[regi]);
+         to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
          bcopy(from, to, REGISTER_RAW_SIZE (regi));
        }
     }
@@ -124,3 +125,42 @@ fill_fpregset (fpregsetp, regno)
   if ((regno == -1) || (regno == FCRCS_REGNUM))
     fpregsetp->fp_csr = *(unsigned *) &registers[REGISTER_BYTE(FCRCS_REGNUM)];
 }
+
+
+/* Figure out where the longjmp will land.
+   We expect the first arg to be a pointer to the jmp_buf structure from which
+   we extract the pc (JB_PC) that we will land at.  The pc is copied into PC.
+   This routine returns true on success. */
+
+int
+get_longjmp_target(pc)
+     CORE_ADDR *pc;
+{
+  CORE_ADDR jb_addr;
+
+  jb_addr = read_register(A0_REGNUM);
+
+  if (target_read_memory(jb_addr + JB_PC * JB_ELEMENT_SIZE, pc,
+                        sizeof(CORE_ADDR)))
+    return 0;
+
+  SWAP_TARGET_AND_HOST(pc, sizeof(CORE_ADDR));
+
+  return 1;
+}
+
+void
+fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
+     char *core_reg_sect;
+     unsigned core_reg_size;
+     int which;                        /* Unused */
+     unsigned int reg_addr;    /* Unused */
+{
+  if (core_reg_size != REGISTER_BYTES)
+    {
+      warning ("wrong size gregset struct in core file");
+      return;
+    }
+
+  memcpy ((char *)registers, core_reg_sect, core_reg_size);
+}
This page took 0.02392 seconds and 4 git commands to generate.