i386: Add tests for -malign-branch-boundary and -malign-branch
[deliverable/binutils-gdb.git] / gdb / progspace.h
index abc53973b6fb733d75c4e32d49fc6c8928149f79..c281648b99bff35a98f0c3e10224a6e34ee99357 100644 (file)
 #define PROGSPACE_H
 
 #include "target.h"
-#include "vec.h"
 #include "gdb_bfd.h"
-#include "gdb_vecs.h"
+#include "gdbsupport/gdb_vecs.h"
 #include "registry.h"
+#include "gdbsupport/next-iterator.h"
+#include "gdbsupport/safe-iterator.h"
 
 struct target_ops;
 struct bfd;
@@ -139,7 +140,7 @@ struct program_space
 
   typedef next_adapter<struct objfile> objfiles_range;
 
-  /* Return an iterarable object that can be used to iterate over all
+  /* Return an iterable object that can be used to iterate over all
      objfiles.  The basic use is in a foreach, like:
 
      for (objfile *objf : pspace->objfiles ()) { ... }  */
@@ -148,6 +149,22 @@ struct program_space
     return objfiles_range (objfiles_head);
   }
 
+  typedef next_adapter<struct objfile,
+                      basic_safe_iterator<next_iterator<objfile>>>
+    objfiles_safe_range;
+
+  /* An iterable object that can be used to iterate over all objfiles.
+     The basic use is in a foreach, like:
+
+     for (objfile *objf : pspace->objfiles_safe ()) { ... }
+
+     This variant uses a basic_safe_iterator so that objfiles can be
+     deleted during iteration.  */
+  objfiles_safe_range objfiles_safe ()
+  {
+    return objfiles_safe_range (objfiles_head);
+  }
+
   /* Pointer to next in linked list.  */
   struct program_space *next = NULL;
 
This page took 0.024148 seconds and 4 git commands to generate.