ld/testsuite/
[deliverable/binutils-gdb.git] / gdb / solib-osf.c
index 031d59882af5907d702c496b7258fac18c4ff820..c295335bae56afd2f017261efda92de17dc40e3c 100644 (file)
@@ -1,7 +1,7 @@
 /* Handle OSF/1, Digital UNIX, and Tru64 shared libraries
    for GDB, the GNU Debugger.
-   Copyright (C) 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2007, 2008
-   Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2007, 2008,
+   2009 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -55,6 +55,7 @@
 #include "inferior.h"
 #include "gdbthread.h"
 #include "solist.h"
+#include "solib.h"
 
 #ifdef USE_LDR_ROUTINES
 # include <loader.h>
@@ -233,7 +234,7 @@ fetch_sec_names (struct lm_info *lmi)
 
 static void
 osf_relocate_section_addresses (struct so_list *so,
-                               struct section_table *sec)
+                               struct target_section *sec)
 {
   struct lm_info *lmi;
   struct lm_sec lms_key, *lms;
@@ -310,9 +311,11 @@ osf_solib_create_inferior_hook (void)
   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 (attach_flag)
+  if (inf->attach_flag)
     return;
 
   /* Nothing to do for statically bound executables.  */
@@ -334,7 +337,6 @@ osf_solib_create_inferior_hook (void)
   if (!target_can_run (&current_target))
     return;
 
-  inf = current_inferior ();
   tp = inferior_thread ();
   clear_proceed_status ();
   inf->stop_soon = STOP_QUIETLY;
@@ -422,8 +424,8 @@ init_so (struct so_list *so, char *name, int isloader, int nsecs)
   memcpy (so->so_name, so->so_original_name, namelen + 1);
 
   /* Allocate section space.  */
-  so->lm_info = xmalloc ((unsigned) &(((struct lm_info *)0)->secs) +
-                        nsecs * sizeof *so->lm_info);
+  so->lm_info = xmalloc (sizeof (struct lm_info)
+                         + (nsecs - 1) * sizeof (struct lm_sec));
   so->lm_info->isloader = isloader;
   so->lm_info->nsecs = nsecs;
   for (i = 0; i < nsecs; i++)
@@ -582,7 +584,7 @@ osf_open_symbol_file_object (void *from_ttyp)
   int found;
 
   if (symfile_objfile)
-    if (!query ("Attempt to reload symbols from process? "))
+    if (!query (_("Attempt to reload symbols from process? ")))
       return 0;
 
   /* The first module after /sbin/loader is the main program.  */
@@ -629,6 +631,7 @@ _initialize_osf_solib (void)
   osf_so_ops.current_sos = osf_current_sos;
   osf_so_ops.open_symbol_file_object = osf_open_symbol_file_object;
   osf_so_ops.in_dynsym_resolve_code = osf_in_dynsym_resolve_code;
+  osf_so_ops.bfd_open = solib_bfd_open;
 
   /* FIXME: Don't do this here.  *_gdbarch_init() should set so_ops. */
   current_target_so_ops = &osf_so_ops;
This page took 0.02929 seconds and 4 git commands to generate.