2008-11-12 Tristan Gingold <gingold@adacore.com>
[binutils-gdb.git] / gdb / symfile.c
index d067d2be536b0caafbb89e1abe6d9a688570cfc3..d9aff2f1e1c50cbeea03da3f916c3b2d687e0fbf 100644 (file)
@@ -896,19 +896,6 @@ syms_from_objfile (struct objfile *objfile,
 
   (*objfile->sf->sym_read) (objfile, mainline);
 
-  /* Don't allow char * to have a typename (else would get caddr_t).
-     Ditto void *.  FIXME: Check whether this is now done by all the
-     symbol readers themselves (many of them now do), and if so remove
-     it from here.  */
-
-  TYPE_NAME (lookup_pointer_type (builtin_type_char)) = 0;
-  TYPE_NAME (lookup_pointer_type (builtin_type_void)) = 0;
-
-  /* Mark the objfile has having had initial symbol read attempted.  Note
-     that this does not mean we found any symbols... */
-
-  objfile->flags |= OBJF_SYMS;
-
   /* Discard cleanups as symbol reading was successful.  */
 
   discard_cleanups (old_chain);
@@ -1065,11 +1052,11 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, int from_tty,
       && print_symbol_loading)
     {
       wrap_here ("");
-      printf_filtered (_("(no debugging symbols found)"));
+      printf_unfiltered (_("(no debugging symbols found)"));
       if (from_tty || info_verbose)
-        printf_filtered ("...");
+        printf_unfiltered ("...");
       else
-        printf_filtered ("\n");
+        printf_unfiltered ("\n");
       wrap_here ("");
     }
 
@@ -1235,6 +1222,9 @@ build_id_verify (const char *filename, struct build_id *check)
   if (!bfd_close (abfd))
     warning (_("cannot close \"%s\": %s"), filename,
             bfd_errmsg (bfd_get_error ()));
+
+  xfree (found);
+
   return retval;
 }
 
@@ -1363,7 +1353,7 @@ find_separate_debug_file (struct objfile *objfile)
       char *build_id_name;
 
       build_id_name = build_id_to_debug_filename (build_id);
-      free (build_id);
+      xfree (build_id);
       /* Prevent looping on a stripped .debug file.  */
       if (build_id_name != NULL && strcmp (build_id_name, objfile->name) == 0)
         {
@@ -1493,14 +1483,11 @@ symbol_file_command (char *args, int from_tty)
     }
   else
     {
-      char **argv = buildargv (args);
+      char **argv = gdb_buildargv (args);
       int flags = OBJF_USERLOADED;
       struct cleanup *cleanups;
       char *name = NULL;
 
-      if (argv == NULL)
-       nomem (0);
-
       cleanups = make_cleanup_freeargv (argv);
       while (*argv != NULL)
        {
@@ -1934,11 +1921,10 @@ generic_load (char *args, int from_tty)
 
   make_cleanup (clear_memory_write_data, &cbdata.requests);
 
-  argv = buildargv (args);
-
-  if (argv == NULL)
-    nomem(0);
+  if (args == NULL)
+    error_no_arg (_("file to load"));
 
+  argv = gdb_buildargv (args);
   make_cleanup_freeargv (argv);
 
   filename = tilde_expand (argv[0]);
@@ -2127,12 +2113,9 @@ add_symbol_file_command (char *args, int from_tty)
   if (args == NULL)
     error (_("add-symbol-file takes a file name and an address"));
 
-  argv = buildargv (args);
+  argv = gdb_buildargv (args);
   make_cleanup_freeargv (argv);
 
-  if (argv == NULL)
-    nomem (0);
-
   for (arg = argv[0], argcnt = 0; arg != NULL; arg = argv[++argcnt])
     {
       /* Process the argument. */
@@ -2445,7 +2428,6 @@ reread_symbols (void)
                  printf_unfiltered (_("(no debugging symbols found)\n"));
                  wrap_here ("");
                }
-             objfile->flags |= OBJF_SYMS;
 
              /* We're done reading the symbol file; finish off complaints.  */
              clear_complaints (&symfile_complaints, 0, 1);