* gdb.texinfo (Command Files): Mention -x, use @enumerate for
[deliverable/binutils-gdb.git] / gdb / osfsolib.c
index 831fc7526eec3c388adb043f0d44d770358dfcbd..8638629139dd48027ad1539371704cafbc2390db 100644 (file)
@@ -36,7 +36,7 @@
 #include "command.h"
 #include "target.h"
 #include "frame.h"
-#include "gnu-regex.h"
+#include "gdb_regex.h"
 #include "inferior.h"
 #include "language.h"
 #include "gdbcmd.h"
@@ -578,7 +578,9 @@ symbol_add_stub (arg)
 {
   register struct so_list *so = (struct so_list *) arg;                /* catch_errs bogon */
   CORE_ADDR text_addr = 0;
+  struct section_addr_info section_addrs;
 
+  memset (&section_addrs, 0, sizeof (section_addrs));
   if (so->textsection)
     text_addr = so->textsection->addr;
   else if (so->abfd != NULL)
@@ -596,9 +598,10 @@ symbol_add_stub (arg)
        text_addr = bfd_section_vma (so->abfd, lowest_sect) + LM_OFFSET (so);
     }
 
+  section_addrs.other[0].addr = text_addr;
+  section_addrs.other[0].name = ".text";
   so->objfile = symbol_file_add (so->so_name, so->from_tty,
-                                text_addr,
-                                0, 0, 0, 0, 1);
+                                &section_addrs, 0, OBJF_SHARED);
   return (1);
 }
 
@@ -655,38 +658,10 @@ solib_add (arg_string, from_tty, target)
 
       if (count)
        {
-         int update_coreops;
-
-         /* We must update the to_sections field in the core_ops structure
-            here, otherwise we dereference a potential dangling pointer
-            for each call to target_read/write_memory within this routine.  */
-         update_coreops = core_ops.to_sections == target->to_sections;
-
-         /* Reallocate the target's section table including the new size.  */
-         if (target->to_sections)
-           {
-             old = target->to_sections_end - target->to_sections;
-             target->to_sections = (struct section_table *)
-               xrealloc ((char *) target->to_sections,
-                         (sizeof (struct section_table)) * (count + old));
-           }
-         else
-           {
-             old = 0;
-             target->to_sections = (struct section_table *)
-               xmalloc ((sizeof (struct section_table)) * count);
-           }
-         target->to_sections_end = target->to_sections + (count + old);
-
-         /* Update the to_sections field in the core_ops structure
-            if needed.  */
-         if (update_coreops)
-           {
-             core_ops.to_sections = target->to_sections;
-             core_ops.to_sections_end = target->to_sections_end;
-           }
-
          /* Add these section table entries to the target's table.  */
+
+         old = target_resize_to_sections (target, count);
+         
          while ((so = find_solib (so)) != NULL)
            {
              if (so->so_name[0])
@@ -758,7 +733,7 @@ info_sharedlibrary_command (ignore, from_tty)
 
   if (exec_bfd == NULL)
     {
-      printf_unfiltered ("No exec file.\n");
+      printf_unfiltered ("No executable file.\n");
       return;
     }
   while ((so = find_solib (so)) != NULL)
This page took 0.029148 seconds and 4 git commands to generate.