gdb: Allow quoting around string options in the gdb::option framework
[deliverable/binutils-gdb.git] / gdb / objfiles.h
index b07ddfdfa503b7b53bd812f8732815b5f928de26..a0c106be3d4aa4c058f9a17eed3091f373d2903d 100644 (file)
 #include "psymtab.h"
 #include <bitset>
 #include <vector>
-#include "common/next-iterator.h"
-#include "common/safe-iterator.h"
+#include "gdbsupport/next-iterator.h"
+#include "gdbsupport/safe-iterator.h"
+#include "bcache.h"
+#include "gdbarch.h"
 
-struct bcache;
 struct htab;
 struct objfile_data;
 struct partial_symbol;
@@ -318,6 +319,63 @@ struct objfile_per_bfd_storage
   std::bitset<nr_languages> demangled_hash_languages;
 };
 
+/* An iterator that first returns a parent objfile, and then each
+   separate debug objfile.  */
+
+class separate_debug_iterator
+{
+public:
+
+  explicit separate_debug_iterator (struct objfile *objfile)
+    : m_objfile (objfile),
+      m_parent (objfile)
+  {
+  }
+
+  bool operator!= (const separate_debug_iterator &other)
+  {
+    return m_objfile != other.m_objfile;
+  }
+
+  separate_debug_iterator &operator++ ();
+
+  struct objfile *operator* ()
+  {
+    return m_objfile;
+  }
+
+private:
+
+  struct objfile *m_objfile;
+  struct objfile *m_parent;
+};
+
+/* A range adapter wrapping separate_debug_iterator.  */
+
+class separate_debug_range
+{
+public:
+
+  explicit separate_debug_range (struct objfile *objfile)
+    : m_objfile (objfile)
+  {
+  }
+
+  separate_debug_iterator begin ()
+  {
+    return separate_debug_iterator (m_objfile);
+  }
+
+  separate_debug_iterator end ()
+  {
+    return separate_debug_iterator (nullptr);
+  }
+
+private:
+
+  struct objfile *m_objfile;
+};
+
 /* Master structure for keeping track of each file from which
    gdb reads symbols.  There are several ways these get allocated: 1.
    The main symbol file, symfile_objfile, set by the symbol-file command,
@@ -396,6 +454,14 @@ struct objfile
     return msymbols_range (this);
   }
 
+  /* Return a range adapter for iterating over all the separate debug
+     objfiles of this objfile.  */
+
+  separate_debug_range separate_debug_objfiles ()
+  {
+    return separate_debug_range (this);
+  }
+
 
   /* All struct objfile's are chained together by their next pointers.
      The program space field "objfiles"  (frequently referenced via
@@ -550,7 +616,7 @@ struct objfile
      Very few blocks have a static link, so it's more memory efficient to
      store these here rather than in struct block.  Static links must be
      allocated on the objfile's obstack.  */
-  htab_t static_links {};
+  htab_up static_links;
 };
 
 /* Declarations for functions defined in objfiles.c */
@@ -563,9 +629,6 @@ extern CORE_ADDR entry_point_address (void);
 
 extern void build_objfile_section_table (struct objfile *);
 
-extern struct objfile *objfile_separate_debug_iterate (const struct objfile *,
-                                                       const struct objfile *);
-
 extern void put_objfile_before (struct objfile *, struct objfile *);
 
 extern void add_separate_debug_objfile (struct objfile *, struct objfile *);
This page took 0.025845 seconds and 4 git commands to generate.