*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / irix5-nat.c
index dcef6ad6395c721b5883e0c71cc216130c5024ca..c1549fc06239e18356756824d887997300c93be6 100644 (file)
@@ -1,6 +1,6 @@
 /* Native support for the SGI Iris running IRIX version 5, for GDB.
-   Copyright 1988, 89, 90, 91, 92, 93, 94, 95, 96, 98, 1999
-   Free Software Foundation, Inc.
+   Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
+   1999, 2000, 2001 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.
@@ -27,6 +27,7 @@
 #include "inferior.h"
 #include "gdbcore.h"
 #include "target.h"
+#include "regcache.h"
 
 #include "gdb_string.h"
 #include <sys/time.h>
@@ -165,9 +166,10 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
 int
 get_longjmp_target (CORE_ADDR *pc)
 {
-  char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
+  char *buf;
   CORE_ADDR jb_addr;
 
+  buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
   jb_addr = read_register (A0_REGNUM);
 
   if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
@@ -179,12 +181,22 @@ get_longjmp_target (CORE_ADDR *pc)
   return 1;
 }
 
+/* Provide registers to GDB from a core file.
+
+   CORE_REG_SECT points to an array of bytes, which were obtained from
+   a core file which BFD thinks might contain register contents. 
+   CORE_REG_SIZE is its size.
+
+   Normally, WHICH says which register set corelow suspects this is:
+     0 --- the general-purpose register set
+     2 --- the floating-point register set
+   However, for Irix 5, WHICH isn't used.
+
+   REG_ADDR is also unused.  */
+
 static void
-fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
-     char *core_reg_sect;
-     unsigned core_reg_size;
-     int which;                        /* Unused */
-     CORE_ADDR reg_addr;       /* Unused */
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
+                     int which, CORE_ADDR reg_addr)
 {
   if (core_reg_size == REGISTER_BYTES)
     {
@@ -398,7 +410,7 @@ solib_map_sections (void *arg)
   bfd *abfd;
 
   filename = tilde_expand (so->so_name);
-  old_chain = make_cleanup (free, filename);
+  old_chain = make_cleanup (xfree, filename);
 
   scratch_chan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
                        &scratch_pathname);
@@ -763,8 +775,7 @@ xfer_link_map_member (struct so_list *so_list_ptr, struct link_map *lm)
  */
 
 static struct so_list *
-find_solib (so_list_ptr)
-     struct so_list *so_list_ptr;      /* Last lm or NULL for first one */
+find_solib (struct so_list *so_list_ptr)
 {
   struct so_list *so_list_next = NULL;
   struct link_map *lm = NULL;
@@ -1046,7 +1057,7 @@ clear_solib (void)
     {
       if (so_list_head->sections)
        {
-         free ((PTR) so_list_head->sections);
+         xfree (so_list_head->sections);
        }
       if (so_list_head->abfd)
        {
@@ -1061,9 +1072,9 @@ clear_solib (void)
 
       next = so_list_head->next;
       if (bfd_filename)
-       free ((PTR) bfd_filename);
-      free (so_list_head->so_name);
-      free ((PTR) so_list_head);
+       xfree (bfd_filename);
+      xfree (so_list_head->so_name);
+      xfree (so_list_head);
       so_list_head = next;
     }
   debug_base = 0;
@@ -1213,7 +1224,7 @@ solib_create_inferior_hook (void)
   stop_signal = TARGET_SIGNAL_0;
   do
     {
-      target_resume (-1, 0, stop_signal);
+      target_resume (pid_to_ptid (-1), 0, stop_signal);
       wait_for_inferior ();
     }
   while (stop_signal != TARGET_SIGNAL_TRAP);
This page took 0.027289 seconds and 4 git commands to generate.