* breakpoint.h (struct breakpoint): New member GDBARCH.
[deliverable/binutils-gdb.git] / gdb / solib-irix.c
index 0455328b0d012b463a91aa1b9b2c5f7eacf3eb7e..e60c520fa142174488b02fa5e8013d0a0f373189 100644 (file)
@@ -1,6 +1,6 @@
 /* Shared library support for IRIX.
    Copyright (C) 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004,
-   2007 Free Software Foundation, Inc.
+   2007, 2008, 2009 Free Software Foundation, Inc.
 
    This file was created using portions of irix5-nat.c originally
    contributed to GDB by Ian Lance Taylor.
@@ -31,6 +31,7 @@
 #include "gdbcore.h"
 #include "target.h"
 #include "inferior.h"
+#include "gdbthread.h"
 
 #include "solist.h"
 #include "solib.h"
@@ -138,7 +139,7 @@ extract_mips_address (void *addr, int len)
    this routine automatically determines which (of three) link map
    formats is in use by the target.  */
 
-struct lm_info
+static struct lm_info
 fetch_lm_info (CORE_ADDR addr)
 {
   struct lm_info li;
@@ -319,7 +320,7 @@ 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 (deprecated_remove_raw_breakpoint (base_breakpoint) != 0)
+  if (deprecated_remove_raw_breakpoint (target_gdbarch, base_breakpoint) != 0)
     {
       status = 0;
     }
@@ -357,7 +358,8 @@ enable_break (void)
   if (symfile_objfile != NULL)
     {
       base_breakpoint
-       = deprecated_insert_raw_breakpoint (entry_point_address ());
+       = deprecated_insert_raw_breakpoint (target_gdbarch,
+                                           entry_point_address ());
 
       if (base_breakpoint != NULL)
        return 1;
@@ -421,6 +423,9 @@ enable_break (void)
 static void
 irix_solib_create_inferior_hook (void)
 {
+  struct inferior *inf;
+  struct thread_info *tp;
+
   if (!enable_break ())
     {
       warning (_("shared library handler failed to enable breakpoint"));
@@ -432,15 +437,20 @@ 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 ();
-  stop_soon = STOP_QUIETLY;
-  stop_signal = TARGET_SIGNAL_0;
+
+  inf->stop_soon = STOP_QUIETLY;
+  tp->stop_signal = TARGET_SIGNAL_0;
+
   do
     {
-      target_resume (pid_to_ptid (-1), 0, stop_signal);
-      wait_for_inferior ();
+      target_resume (pid_to_ptid (-1), 0, tp->stop_signal);
+      wait_for_inferior (0);
     }
-  while (stop_signal != TARGET_SIGNAL_TRAP);
+  while (tp->stop_signal != TARGET_SIGNAL_TRAP);
 
   /* We are now either at the "mapping complete" breakpoint (or somewhere
      else, a condition we aren't prepared to deal with anyway), so adjust
@@ -459,7 +469,7 @@ irix_solib_create_inferior_hook (void)
      Delaying the resetting of stop_soon until after symbol loading
      suppresses the warning.  */
   solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
-  stop_soon = NO_STOP_QUIETLY;
+  inf->stop_soon = NO_STOP_QUIETLY;
 }
 
 /* LOCAL FUNCTION
@@ -505,9 +515,9 @@ irix_current_sos (void)
 
   read_memory (debug_base,
               addr_buf,
-              gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT);
+              gdbarch_addr_bit (target_gdbarch) / TARGET_CHAR_BIT);
   lma = extract_mips_address (addr_buf,
-                             gdbarch_addr_bit (current_gdbarch)
+                             gdbarch_addr_bit (target_gdbarch)
                                / TARGET_CHAR_BIT);
 
   while (lma)
@@ -602,7 +612,7 @@ irix_open_symbol_file_object (void *from_ttyp)
   char *filename;
 
   if (symfile_objfile)
-    if (!query ("Attempt to reload symbols from process? "))
+    if (!query (_("Attempt to reload symbols from process? ")))
       return 0;
 
   if ((debug_base = locate_base ()) == 0)
@@ -611,9 +621,9 @@ irix_open_symbol_file_object (void *from_ttyp)
   /* First link map member should be the executable.  */
   read_memory (debug_base,
               addr_buf,
-              gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT);
+              gdbarch_addr_bit (target_gdbarch) / TARGET_CHAR_BIT);
   lma = extract_mips_address (addr_buf,
-                             gdbarch_addr_bit (current_gdbarch)
+                             gdbarch_addr_bit (target_gdbarch)
                                / TARGET_CHAR_BIT);
   if (lma == 0)
     return 0;                  /* failed somehow...  */
@@ -678,7 +688,7 @@ irix_special_symbol_handling (void)
 
 static void
 irix_relocate_section_addresses (struct so_list *so,
-                                struct section_table *sec)
+                                struct target_section *sec)
 {
   sec->addr += so->lm_info->reloc_offset;
   sec->endaddr += so->lm_info->reloc_offset;
@@ -710,6 +720,9 @@ irix_in_dynsym_resolve_code (CORE_ADDR pc)
 
 struct target_so_ops irix_so_ops;
 
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern initialize_file_ftype _initialize_irix_solib;
+
 void
 _initialize_irix_solib (void)
 {
This page took 0.045093 seconds and 4 git commands to generate.