* gas/mips/mips.exp (run_dump_test_arch): Check for the presence
[deliverable/binutils-gdb.git] / gdb / solib-irix.c
index 4cf8cc67cc8fb5eaf6f47c10ec422be3d1f3fc14..303d3bfc3746a6dbacd27e7afb01aadef6ecd8bb 100644 (file)
@@ -1,6 +1,6 @@
 /* Shared library support for IRIX.
    Copyright (C) 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004,
-   2007, 2008, 2009 Free Software Foundation, Inc.
+   2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This file was created using portions of irix5-nat.c originally
    contributed to GDB by Ian Lance Taylor.
@@ -163,6 +163,7 @@ fetch_lm_info (CORE_ADDR addr)
       CORE_ADDR obj_addr = extract_mips_address (&buf.ol32.data,
                                                 sizeof (buf.ol32.data),
                                                 byte_order);
+
       li.next = extract_mips_address (&buf.ol32.next,
                                      sizeof (buf.ol32.next), byte_order);
 
@@ -326,7 +327,6 @@ disable_break (void)
 {
   int status = 1;
 
-
   /* Note that breakpoint address and original contents are in our address
      space, so we just need to write the original contents back. */
 
@@ -365,11 +365,17 @@ disable_break (void)
 static int
 enable_break (void)
 {
-  if (symfile_objfile != NULL)
+  if (symfile_objfile != NULL && has_stack_frames ())
     {
-      base_breakpoint
-       = deprecated_insert_raw_breakpoint (target_gdbarch,
-                                           entry_point_address ());
+      struct frame_info *frame = get_current_frame ();
+      struct address_space *aspace = get_frame_address_space (frame);
+      CORE_ADDR entry_point;
+
+      if (!entry_point_address_query (&entry_point))
+       return 0;
+
+      base_breakpoint = deprecated_insert_raw_breakpoint (target_gdbarch,
+                                                         aspace, entry_point);
 
       if (base_breakpoint != NULL)
        return 1;
@@ -386,7 +392,7 @@ enable_break (void)
 
    SYNOPSIS
 
-   void solib_create_inferior_hook ()
+   void solib_create_inferior_hook (int from_tty)
 
    DESCRIPTION
 
@@ -431,11 +437,23 @@ enable_break (void)
  */
 
 static void
-irix_solib_create_inferior_hook (void)
+irix_solib_create_inferior_hook (int from_tty)
 {
   struct inferior *inf;
   struct thread_info *tp;
 
+  inf = current_inferior ();
+
+  /* If we are attaching to the inferior, the shared libraries
+     have already been mapped, so nothing more to do.  */
+  if (inf->attach_flag)
+    return;
+
+  /* Likewise when debugging from a core file, the shared libraries
+     have already been mapped, so nothing more to do.  */
+  if (!target_can_run (&current_target))
+    return;
+
   if (!enable_break ())
     {
       warning (_("shared library handler failed to enable breakpoint"));
@@ -447,7 +465,6 @@ irix_solib_create_inferior_hook (void)
      can go groveling around in the dynamic linker structures to find
      out what we need to know about them. */
 
-  inf = current_inferior ();
   tp = inferior_thread ();
 
   clear_proceed_status ();
@@ -740,4 +757,5 @@ _initialize_irix_solib (void)
   irix_so_ops.current_sos = irix_current_sos;
   irix_so_ops.open_symbol_file_object = irix_open_symbol_file_object;
   irix_so_ops.in_dynsym_resolve_code = irix_in_dynsym_resolve_code;
+  irix_so_ops.bfd_open = solib_bfd_open;
 }
This page took 0.024284 seconds and 4 git commands to generate.