]> Git Repo - binutils.git/blobdiff - gdb/osfsolib.c
* symfile.h (ADD_PSYMBOL_VT_TO_LIST): Don't put a semicolon after
[binutils.git] / gdb / osfsolib.c
index a27243d941f5c9455d9dc141c75871b80adff46b..7f0d1a5ecee792d4a534d342dd723dc4c814166e 100644 (file)
@@ -96,7 +96,7 @@ struct so_list {
   struct section_table *sections;
   struct section_table *sections_end;
   struct section_table *textsection;
-  bfd *bfd;
+  bfd *abfd;
 };
 
 static struct so_list *so_list_head;   /* List of known shared objects */
@@ -130,9 +130,6 @@ xfer_link_map_member PARAMS ((struct so_list *, struct link_map *));
 static void
 solib_map_sections PARAMS ((struct so_list *));
 
-void
-_initialize_solib PARAMS ((void));
-
 /*
 
 LOCAL FUNCTION
@@ -192,21 +189,21 @@ solib_map_sections (so)
     {
       close (scratch_chan);
       error ("Could not open `%s' as an executable file: %s",
-            scratch_pathname, bfd_errmsg (bfd_error));
+            scratch_pathname, bfd_errmsg (bfd_get_error ()));
     }
   /* Leave bfd open, core_xfer_memory and "info files" need it.  */
-  so -> bfd = abfd;
+  so -> abfd = abfd;
   abfd -> cacheable = true;
 
   if (!bfd_check_format (abfd, bfd_object))
     {
       error ("\"%s\": not in executable format: %s.",
-            scratch_pathname, bfd_errmsg (bfd_error));
+            scratch_pathname, bfd_errmsg (bfd_get_error ()));
     }
   if (build_section_table (abfd, &so -> sections, &so -> sections_end))
     {
       error ("Can't find the file sections in `%s': %s", 
-            bfd_get_filename (exec_bfd), bfd_errmsg (bfd_error));
+            bfd_get_filename (exec_bfd), bfd_errmsg (bfd_get_error ()));
     }
 
   for (p = so -> sections; p < so -> sections_end; p++)
@@ -347,11 +344,17 @@ xfer_link_map_member (so_list_ptr, lm)
        len = MAX_PATH_SIZE;
       strncpy (so_list_ptr->so_name, LM_NAME (so_list_ptr), MAX_PATH_SIZE);
 #else
-      if (!target_read_string((CORE_ADDR) LM_NAME (so_list_ptr),
-                             so_list_ptr->so_name, MAX_PATH_SIZE - 1))
-       error ("xfer_link_map_member: Can't read pathname for load map\n");
+      int errcode;
+      char *buffer;
+      target_read_string ((CORE_ADDR) LM_NAME (so_list_ptr), &buffer,
+                         MAX_PATH_SIZE - 1, &errcode);
+      if (errcode != 0)
+       error ("xfer_link_map_member: Can't read pathname for load map: %s\n",
+              safe_strerror (errcode));
+      strncpy (so_list_ptr->so_name, buffer, MAX_PATH_SIZE - 1);
+      free (buffer);
 #endif
-      so_list_ptr->so_name[MAX_PATH_SIZE - 1] = 0;
+      so_list_ptr->so_name[MAX_PATH_SIZE - 1] = '\0';
 
       solib_map_sections (so_list_ptr);
     }
@@ -538,7 +541,7 @@ solib_add (arg_string, from_tty, target)
            {
              if (from_tty)
                {
-                 printf ("Symbols already loaded for %s\n", so -> so_name);
+                 printf_unfiltered ("Symbols already loaded for %s\n", so -> so_name);
                }
            }
          else if (catch_errors
@@ -579,7 +582,7 @@ info_sharedlibrary_command (ignore, from_tty)
   
   if (exec_bfd == NULL)
     {
-      printf ("No exec file.\n");
+      printf_unfiltered ("No exec file.\n");
       return;
     }
   while ((so = find_solib (so)) != NULL)
@@ -591,7 +594,7 @@ info_sharedlibrary_command (ignore, from_tty)
 
          if (!header_done)
            {
-             printf("%-20s%-20s%-12s%s\n", "From", "To", "Syms Read",
+             printf_unfiltered("%-20s%-20s%-12s%s\n", "From", "To", "Syms Read",
                     "Shared Object Library");
              header_done++;
            }
@@ -600,15 +603,15 @@ info_sharedlibrary_command (ignore, from_tty)
              txt_start = (unsigned long) so -> textsection -> addr;
              txt_end = (unsigned long) so -> textsection -> endaddr;
            }
-         printf ("%-20s", local_hex_string_custom (txt_start, "08l"));
-         printf ("%-20s", local_hex_string_custom (txt_end, "08l"));
-         printf ("%-12s", so -> symbols_loaded ? "Yes" : "No");
-         printf ("%s\n",  so -> so_name);
+         printf_unfiltered ("%-20s", local_hex_string_custom (txt_start, "08l"));
+         printf_unfiltered ("%-20s", local_hex_string_custom (txt_end, "08l"));
+         printf_unfiltered ("%-12s", so -> symbols_loaded ? "Yes" : "No");
+         printf_unfiltered ("%s\n",  so -> so_name);
        }
     }
   if (so_list_head == NULL)
     {
-      printf ("No shared libraries loaded at this time.\n");   
+      printf_unfiltered ("No shared libraries loaded at this time.\n");        
     }
 }
 
@@ -670,10 +673,10 @@ clear_solib()
        {
          free ((PTR)so_list_head -> sections);
        }
-      if (so_list_head -> bfd)
+      if (so_list_head -> abfd)
        {
-         bfd_filename = bfd_get_filename (so_list_head -> bfd);
-         bfd_close (so_list_head -> bfd);
+         bfd_filename = bfd_get_filename (so_list_head -> abfd);
+         bfd_close (so_list_head -> abfd);
        }
       else
        /* This happens for the executable on SVR4.  */
@@ -739,16 +742,22 @@ solib_create_inferior_hook()
  
   clear_proceed_status ();
   stop_soon_quietly = 1;
-  stop_signal = 0;
+  stop_signal = TARGET_SIGNAL_0;
   do
     {
-      target_resume (inferior_pid, 0, stop_signal);
+      target_resume (-1, 0, stop_signal);
       wait_for_inferior ();
     }
-  while (stop_signal != SIGTRAP);
-  stop_soon_quietly = 0;
-
+  while (stop_signal != TARGET_SIGNAL_TRAP);
+
+  /*  solib_add will call reinit_frame_cache via symbol_file_add.
+      But we are stopped in the runtime loader and we do not have symbols
+      for the runtime loader. So heuristic_proc_start will be called
+      and will put out an annoying warning.
+      Resetting stop_soon_quietly after symbol loading suppresses
+      the warning.  */
   solib_add ((char *) 0, 0, (struct target_ops *) 0);
+  stop_soon_quietly = 0;
 }
 
 
This page took 0.029748 seconds and 4 git commands to generate.