SYMTAB_OBJFILE: New macro.
[deliverable/binutils-gdb.git] / gdb / symfile.c
index 64a83c684a01b2d13261c83cef12b2a79bb5a773..01ff6aef379654f8d518c7608fcf0af335572e54 100644 (file)
@@ -45,7 +45,6 @@
 #include "bcache.h"
 #include "hashtab.h"
 #include "readline/readline.h"
-#include "gdb_assert.h"
 #include "block.h"
 #include "observer.h"
 #include "exec.h"
@@ -60,7 +59,6 @@
 
 #include <sys/types.h>
 #include <fcntl.h>
-#include <string.h>
 #include <sys/stat.h>
 #include <ctype.h>
 #include <time.h>
@@ -2090,7 +2088,7 @@ clear_memory_write_data (void *arg)
 }
 
 void
-generic_load (char *args, int from_tty)
+generic_load (const char *args, int from_tty)
 {
   bfd *loadfile_bfd;
   struct timeval start_time, end_time;
@@ -2262,7 +2260,7 @@ add_symbol_file_command (char *args, int from_tty)
 {
   struct gdbarch *gdbarch = get_current_arch ();
   char *filename = NULL;
-  int flags = OBJF_USERLOADED;
+  int flags = OBJF_USERLOADED | OBJF_SHARED;
   char *arg;
   int section_index = 0;
   int argcnt = 0;
@@ -2445,8 +2443,8 @@ remove_symbol_file_command (char *args, int from_tty)
 
       ALL_OBJFILES (objf)
        {
-         if (objf != 0
-             && objf->flags & OBJF_USERLOADED
+         if ((objf->flags & OBJF_USERLOADED) != 0
+             && (objf->flags & OBJF_SHARED) != 0
              && objf->pspace == pspace && is_addr_in_objfile (addr, objf))
            break;
        }
@@ -2464,8 +2462,8 @@ remove_symbol_file_command (char *args, int from_tty)
 
       ALL_OBJFILES (objf)
        {
-         if (objf != 0
-             && objf->flags & OBJF_USERLOADED
+         if ((objf->flags & OBJF_USERLOADED) != 0
+             && (objf->flags & OBJF_SHARED) != 0
              && objf->pspace == pspace
              && filename_cmp (filename, objfile_name (objf)) == 0)
            break;
@@ -2949,7 +2947,7 @@ allocate_symtab (const char *filename, struct objfile *objfile)
 
   /* Hook it to the objfile it comes from.  */
 
-  symtab->objfile = objfile;
+  SYMTAB_OBJFILE (symtab) = objfile;
   symtab->next = objfile->symtabs;
   objfile->symtabs = symtab;
 
@@ -3487,7 +3485,7 @@ overlay_command (char *args, int from_tty)
 {
   printf_unfiltered
     ("\"overlay\" must be followed by the name of an overlay command.\n");
-  help_list (overlaylist, "overlay ", -1, gdb_stdout);
+  help_list (overlaylist, "overlay ", all_commands, gdb_stdout);
 }
 
 /* Target Overlays for the "Simplest" overlay manager:
@@ -3892,8 +3890,8 @@ symfile_find_segment_sections (struct objfile *objfile)
 static void
 symfile_free_objfile (struct objfile *objfile)
 {
-  /* Remove the target sections of user-added objfiles.  */
-  if (objfile != 0 && objfile->flags & OBJF_USERLOADED)
+  /* Remove the target sections owned by this objfile.  */
+  if (objfile != NULL)
     remove_target_sections ((void *) objfile);
 }
 
This page took 0.026226 seconds and 4 git commands to generate.