gdb/
[deliverable/binutils-gdb.git] / gdb / objfiles.c
index 1f4913a982297a2066ad0483560b6f25a3f39bf9..f5e5c75b86f4f64acdc91eb6c8d3c90ab27a150c 100644 (file)
@@ -730,7 +730,9 @@ objfile_relocate1 (struct objfile *objfile,
          BLOCK_START (b) += ANOFFSET (delta, s->block_line_section);
          BLOCK_END (b) += ANOFFSET (delta, s->block_line_section);
 
-         ALL_BLOCK_SYMBOLS (b, iter, sym)
+         /* We only want to iterate over the local symbols, not any
+            symbols in included symtabs.  */
+         ALL_DICT_SYMBOLS (BLOCK_DICT (b), iter, sym)
            {
              relocate_one_symbol (sym, objfile, delta);
            }
@@ -1523,6 +1525,31 @@ gdb_bfd_unref (struct bfd *abfd)
   xfree (name);
 }
 
+/* The default implementation for the "iterate_over_objfiles_in_search_order"
+   gdbarch method.  It is equivalent to use the ALL_OBJFILES macro,
+   searching the objfiles in the order they are stored internally,
+   ignoring CURRENT_OBJFILE.
+
+   On most platorms, it should be close enough to doing the best
+   we can without some knowledge specific to the architecture.  */
+
+void
+default_iterate_over_objfiles_in_search_order
+  (struct gdbarch *gdbarch,
+   iterate_over_objfiles_in_search_order_cb_ftype *cb,
+   void *cb_data, struct objfile *current_objfile)
+{
+  int stop = 0;
+  struct objfile *objfile;
+
+  ALL_OBJFILES (objfile)
+    {
+       stop = cb (objfile, cb_data);
+       if (stop)
+        return;
+    }
+}
+
 /* Provide a prototype to silence -Wmissing-prototypes.  */
 extern initialize_file_ftype _initialize_objfiles;
 
This page took 0.026378 seconds and 4 git commands to generate.