Cleanup includes in dwarf2/*.
1. Add the necessary includes so that clangd reports no errors when
opening header files. This ensures that header files include what
they use.
2. Remove all includes reported as unused by clangd (except
gdb-safe-ctype.h, which I think does some magic that affects what
follows).
Built-tested --enable-threading at "yes" and "no", since there are some
portions of code gated by `#ifdef CXX_STD_THREAD`.
Change-Id: I21debffcd7c2caf90f08e1e0fbba3ce30422d042
Approved-By: Tom Tromey <tom@tromey.com>
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "dwarf2/read.h"
#include "dwarf2/abbrev-cache.h"
/* Hash function for an abbrev table. */
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "dwarf2/read.h"
#include "dwarf2/abbrev.h"
#include "dwarf2/leb.h"
+#include "dwarf2/section.h"
#include "bfd.h"
/* Hash function for an abbrev. */
#ifndef GDB_DWARF2_ABBREV_H
#define GDB_DWARF2_ABBREV_H
+#include "dwarf2.h"
+#include "gdbsupport/gdb-hashtab.h"
+#include "gdbsupport/gdb_obstack.h"
#include "hashtab.h"
+#include "types.h"
struct attr_abbrev
{
#include "dwarf2.h"
#include "dwarf2/types.h"
-#include <optional>
/* Blocks are a bunch of untyped bytes. */
struct dwarf_block
#include "cp-support.h"
#include "c-lang.h"
#include "ada-lang.h"
+#include "dwarf2/tag.h"
#include "event-top.h"
#include "exceptions.h"
#include "split-name.h"
#include <algorithm>
#include "gdbsupport/gdb-safe-ctype.h"
#include "gdbsupport/selftest.h"
+#include "gdbsupport/task-group.h"
+#include "gdbsupport/thread-pool.h"
#include <chrono>
#include <unordered_set>
#include "cli/cli-cmds.h"
#include "dwarf2/types.h"
#include "symtab.h"
#include "hashtab.h"
-#include "dwarf2/index-common.h"
-#include <string_view>
#include "quick-symbol.h"
#include "gdbsupport/gdb_obstack.h"
#include "addrmap.h"
#include "gdbsupport/iterator-range.h"
-#include "gdbsupport/thread-pool.h"
#include "dwarf2/mapped-index.h"
#include "dwarf2/read.h"
-#include "dwarf2/tag.h"
#include "dwarf2/abbrev-cache.h"
#include "dwarf2/parent-map.h"
#include "gdbsupport/range-chain.h"
-#include "gdbsupport/task-group.h"
#include "complaints.h"
-#include "run-on-main-thread.h"
#if CXX_STD_THREAD
#include <mutex>
#include "dwarf2/section.h"
struct dwarf2_per_bfd;
+struct dwarf2_per_objfile;
/* This represents a '.dwz' file. */
#include "dwarf2/frame-tailcall.h"
#include "dwarf2/loc.h"
#include "frame-unwind.h"
-#include "block.h"
#include "hashtab.h"
-#include "gdbtypes.h"
#include "regcache.h"
#include "value.h"
#include "dwarf2/frame.h"
#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
-#include "gdbcore.h"
#include "gdbtypes.h"
#include "symtab.h"
#include "objfiles.h"
#include "dwarf2/frame.h"
#include "dwarf2/read.h"
#include "dwarf2/public.h"
-#include "ax.h"
#include "dwarf2/loc.h"
#include "dwarf2/frame-tailcall.h"
#include "gdbsupport/gdb_binary_search.h"
#include "dwarf2/index-write.h"
#include "dwarf2/read.h"
#include "dwarf2/dwz.h"
-#include "objfiles.h"
-#include "gdbsupport/selftest.h"
#include <string>
#include <stdlib.h>
#include "run-on-main-thread.h"
#ifndef DWARF_INDEX_CACHE_H
#define DWARF_INDEX_CACHE_H
-#include "dwarf2/index-common.h"
#include "gdbsupport/array-view.h"
-#include "symfile.h"
class dwarf2_per_bfd;
class index_cache;
#include "gdbsupport/gdb_unlinker.h"
#include "gdbsupport/pathstuff.h"
#include "gdbsupport/scoped_fd.h"
-#include "complaints.h"
#include "dwarf2/index-common.h"
#include "dwarf2/cooked-index.h"
#include "dwarf2.h"
#include <algorithm>
#include <cmath>
-#include <forward_list>
#include <map>
-#include <set>
#include <unordered_map>
#include <unordered_set>
#ifndef DWARF2_LINE_HEADER_H
#define DWARF2_LINE_HEADER_H
+#include "dwarf2/types.h"
+
+struct dwarf2_per_objfile;
+
/* dir_index is 1-based in DWARF 4 and before, and is 0-based in DWARF 5 and
later. */
typedef int dir_index;
#include "dwarf2/frame.h"
#include "dwarf2/leb.h"
#include "compile/compile.h"
-#include "gdbsupport/selftest.h"
#include <algorithm>
#include <vector>
#include <unordered_set>
#define GDB_DWARF2_MACRO_H
struct buildsym_compunit;
+struct dwarf2_per_objfile;
+struct dwarf2_section_info;
extern void dwarf_decode_macros (dwarf2_per_objfile *per_objfile,
buildsym_compunit *builder,
#ifndef GDB_DWARF2_MAPPED_INDEX_H
#define GDB_DWARF2_MAPPED_INDEX_H
+#include "dwarf2/index-common.h"
#include "language.h"
+#include "quick-symbol.h"
/* An index into a (C++) symbol name component in a symbol name as
recorded in the mapped_index's symbol table. For each C++ symbol
#ifndef GDB_DWARF2_PARENT_MAP_H
#define GDB_DWARF2_PARENT_MAP_H
-#include <algorithm>
+#include "addrmap.h"
+#include "dwarf2/types.h"
+#include "gdbsupport/gdb_obstack.h"
class cooked_index_entry;
#include "bfd.h"
#include "elf-bfd.h"
#include "event-top.h"
+#include "gdbsupport/task-group.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "objfiles.h"
#include "go-lang.h"
#include "valprint.h"
#include "gdbcore.h"
-#include "gdb/gdb-index.h"
#include "gdb_bfd.h"
#include "f-lang.h"
#include "source.h"
#include <unordered_set>
#include "dwarf2/abbrev-cache.h"
#include "cooked-index.h"
-#include "split-name.h"
#include "gdbsupport/thread-pool.h"
#include "run-on-main-thread.h"
#include "dwarf2/parent-map.h"
#include "dwarf2/mapped-index.h"
#include "dwarf2/section.h"
#include "dwarf2/cu.h"
-#include "filename-seen-cache.h"
#include "gdbsupport/gdb_obstack.h"
#include "gdbsupport/hash_enum.h"
#include "gdbsupport/function-view.h"