Fix debugging programs statically linked against the thread library.
[deliverable/binutils-gdb.git] / gdb / irix5-nat.c
index dcef6ad6395c721b5883e0c71cc216130c5024ca..5fe41fa004be61e1573c0fb10728cbd0b20301d7 100644 (file)
@@ -165,9 +165,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 +180,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 +409,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 +774,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 +1056,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 +1071,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;
This page took 0.024424 seconds and 4 git commands to generate.