* gprof.c (main): Fix option string for -C, -n and -N.
[deliverable/binutils-gdb.git] / gdb / solib-irix.c
index aaf8338bb25b791bb365b847c0e24426c65f7952..013c4cd5466937d55b9c8fc9e5a2ec5175569bc3 100644 (file)
@@ -1,5 +1,5 @@
 /* Shared library support for IRIX.
-   Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004
+   Copyright (C) 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004
    Free Software Foundation, Inc.
 
    This file was created using portions of irix5-nat.c originally
@@ -19,8 +19,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
 #include "defs.h"
 
@@ -62,12 +62,12 @@ struct lm_info
 
 typedef struct
 {
-  char b[4];
+  gdb_byte b[4];
 }
 gdb_int32_bytes;
 typedef struct
 {
-  char b[8];
+  gdb_byte b[8];
 }
 gdb_int64_bytes;
 
@@ -152,7 +152,7 @@ fetch_lm_info (CORE_ADDR addr)
      being at the end of a page or the like.)  */
   read_memory (addr, (char *) &buf, sizeof (buf.ol32));
 
-  if (extract_unsigned_integer (&buf.magic, sizeof (buf.magic)) != 0xffffffff)
+  if (extract_unsigned_integer (buf.magic.b, sizeof (buf.magic)) != 0xffffffff)
     {
       /* Use buf.ol32... */
       char obj_buf[432];
@@ -168,7 +168,7 @@ fetch_lm_info (CORE_ADDR addr)
        - extract_mips_address (&obj_buf[248], 4);
 
     }
-  else if (extract_unsigned_integer (&buf.oi32.oi_size,
+  else if (extract_unsigned_integer (buf.oi32.oi_size.b,
                                     sizeof (buf.oi32.oi_size))
           == sizeof (buf.oi32))
     {
@@ -188,11 +188,11 @@ fetch_lm_info (CORE_ADDR addr)
                                sizeof (buf.oi32.oi_orig_ehdr));
       li.pathname_addr = extract_mips_address (&buf.oi32.oi_pathname,
                                               sizeof (buf.oi32.oi_pathname));
-      li.pathname_len = extract_unsigned_integer (&buf.oi32.oi_pathname_len,
+      li.pathname_len = extract_unsigned_integer (buf.oi32.oi_pathname_len.b,
                                                  sizeof (buf.oi32.
                                                          oi_pathname_len));
     }
-  else if (extract_unsigned_integer (&buf.oi64.oi_size,
+  else if (extract_unsigned_integer (buf.oi64.oi_size.b,
                                     sizeof (buf.oi64.oi_size))
           == sizeof (buf.oi64))
     {
@@ -212,13 +212,13 @@ fetch_lm_info (CORE_ADDR addr)
                                sizeof (buf.oi64.oi_orig_ehdr));
       li.pathname_addr = extract_mips_address (&buf.oi64.oi_pathname,
                                               sizeof (buf.oi64.oi_pathname));
-      li.pathname_len = extract_unsigned_integer (&buf.oi64.oi_pathname_len,
+      li.pathname_len = extract_unsigned_integer (buf.oi64.oi_pathname_len.b,
                                                  sizeof (buf.oi64.
                                                          oi_pathname_len));
     }
   else
     {
-      error ("Unable to fetch shared library obj_info or obj_list info.");
+      error (_("Unable to fetch shared library obj_info or obj_list info."));
     }
 
   return li;
@@ -227,10 +227,9 @@ fetch_lm_info (CORE_ADDR addr)
 /* The symbol which starts off the list of shared libraries.  */
 #define DEBUG_BASE "__rld_obj_head"
 
-char shadow_contents[BREAKPOINT_MAX];  /* Stash old bkpt addr contents */
+static void *base_breakpoint;
 
 static CORE_ADDR debug_base;   /* Base of dynamic linker structures */
-static CORE_ADDR breakpoint_addr;      /* Address where end bkpt is set */
 
 /*
 
@@ -319,20 +318,18 @@ disable_break (void)
   /* Note that breakpoint address and original contents are in our address
      space, so we just need to write the original contents back. */
 
-  if (memory_remove_breakpoint (breakpoint_addr, shadow_contents) != 0)
+  if (deprecated_remove_raw_breakpoint (base_breakpoint) != 0)
     {
       status = 0;
     }
 
-  /* For the SVR4 version, we always know the breakpoint address.  For the
-     SunOS version we don't know it until the above code is executed.
-     Grumble if we are stopped anywhere besides the breakpoint address. */
+  base_breakpoint = NULL;
 
-  if (stop_pc != breakpoint_addr)
-    {
-      warning
-       ("stopped at unknown breakpoint while handling shared libraries");
-    }
+  /* Note that it is possible that we have stopped at a location that
+     is different from the location where we inserted our breakpoint.
+     On mips-irix, we can actually land in __dbx_init(), so we should
+     not check the PC against our breakpoint address here.  See procfs.c
+     for more details.  */
 
   return (status);
 }
@@ -356,12 +353,13 @@ disable_break (void)
 static int
 enable_break (void)
 {
-  if (symfile_objfile != NULL
-      && target_insert_breakpoint (entry_point_address (),
-                                  shadow_contents) == 0)
+  if (symfile_objfile != NULL)
     {
-      breakpoint_addr = entry_point_address ();
-      return 1;
+      base_breakpoint
+       = deprecated_insert_raw_breakpoint (entry_point_address ());
+
+      if (base_breakpoint != NULL)
+       return 1;
     }
 
   return 0;
@@ -375,7 +373,7 @@ enable_break (void)
 
    SYNOPSIS
 
-   void solib_create_inferior_hook()
+   void solib_create_inferior_hook ()
 
    DESCRIPTION
 
@@ -424,7 +422,7 @@ irix_solib_create_inferior_hook (void)
 {
   if (!enable_break ())
     {
-      warning ("shared library handler failed to enable breakpoint");
+      warning (_("shared library handler failed to enable breakpoint"));
       return;
     }
 
@@ -450,7 +448,7 @@ irix_solib_create_inferior_hook (void)
 
   if (!disable_break ())
     {
-      warning ("shared library handler failed to disable breakpoint");
+      warning (_("shared library handler failed to disable breakpoint"));
     }
 
   /* solib_add will call reinit_frame_cache.
@@ -543,10 +541,8 @@ irix_current_sos (void)
          target_read_string (lm.pathname_addr, &name_buf,
                              name_size, &errcode);
          if (errcode != 0)
-           {
-             warning ("current_sos: Can't read pathname for load map: %s\n",
+           warning (_("Can't read pathname for load map: %s."),
                       safe_strerror (errcode));
-           }
          else
            {
              strncpy (new->so_name, name_buf, name_size);
@@ -625,7 +621,7 @@ irix_open_symbol_file_object (void *from_ttyp)
 
   if (errcode)
     {
-      warning ("failed to read exec filename from attached file: %s",
+      warning (_("failed to read exec filename from attached file: %s"),
               safe_strerror (errcode));
       return 0;
     }
This page took 0.026639 seconds and 4 git commands to generate.