From: Simon Marchi Date: Mon, 29 Apr 2024 15:07:22 +0000 (-0400) Subject: gdb: remove unused includes in utils.h X-Git-Tag: binutils-2_43~578 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05d9d66d92886053d56d1c5fb9fcfcb20f6a6de0;p=thirdparty%2Fbinutils-gdb.git gdb: remove unused includes in utils.h Remove some includes reported as unused by clangd. Add some includes in other files that were previously relying on the transitive include. Change-Id: Ibdd0a998b04d21362a20d0ca8e5267e21e2e133e --- diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index ad55cf2caa3..a1296a8f0c7 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -19,6 +19,7 @@ along with this program. If not, see . */ +#include "exceptions.h" #include "extract-store-integer.h" #include "gdbarch.h" #include "glibc-tdep.h" diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 0b430428fb4..01978e08380 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -20,6 +20,7 @@ #include #include "event-top.h" +#include "exceptions.h" #include "extract-store-integer.h" #include "gdbsupport/gdb_regex.h" #include "frame.h" diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c index 9a35ede1df6..b7e29a79dd8 100644 --- a/gdb/break-catch-throw.c +++ b/gdb/break-catch-throw.c @@ -20,7 +20,7 @@ #include "arch-utils.h" #include #include "breakpoint.h" -#include "cli/cli-cmds.h" +#include "exceptions.h" #include "inferior.h" #include "annotate.h" #include "valprint.h" diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index fff9508f2d8..a973518ac5f 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -20,6 +20,7 @@ #include "arch-utils.h" #include #include "event-top.h" +#include "exceptions.h" #include "hashtab.h" #include "symtab.h" #include "frame.h" diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 5d49e395a84..3af794cebaf 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -18,6 +18,7 @@ along with this program. If not, see . */ #include "arch-utils.h" +#include "exceptions.h" #include "readline/tilde.h" #include "completer.h" #include "target.h" diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index a488c304fea..fa5d70e1e89 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -18,6 +18,7 @@ along with this program. If not, see . */ #include "cli-interp.h" +#include "exceptions.h" #include "interps.h" #include "event-top.h" #include "ui-out.h" diff --git a/gdb/complaints.h b/gdb/complaints.h index 995c35e0ab0..d672e0c365d 100644 --- a/gdb/complaints.h +++ b/gdb/complaints.h @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - #if !defined (COMPLAINTS_H) #define COMPLAINTS_H +#include "gdbsupport/scoped_restore.h" #include /* Helper for complaint. */ diff --git a/gdb/corelow.c b/gdb/corelow.c index 462a05591c1..49da9be07ef 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -20,6 +20,7 @@ #include "arch-utils.h" #include #include +#include "exceptions.h" #include "frame.h" #include "inferior.h" #include "infrun.h" diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index c70cd44bb7f..2b68cf6a549 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -68,6 +68,7 @@ #include "gdbsupport/gdb_unlinker.h" #include "gdbsupport/pathstuff.h" #include "gdbsupport/scoped_fd.h" +#include "gdbsupport/scoped_restore.h" #include "nat/fork-inferior.h" /* Quick overview. diff --git a/gdb/disasm.h b/gdb/disasm.h index 9282632b270..9d5450ce8b3 100644 --- a/gdb/disasm.h +++ b/gdb/disasm.h @@ -21,6 +21,7 @@ #include "dis-asm.h" #include "disasm-flags.h" +#include "ui-out.h" struct gdbarch; struct ui_out; diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index 767f119e04f..c9e46af32ae 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -25,6 +25,7 @@ #include "c-lang.h" #include "ada-lang.h" #include "event-top.h" +#include "exceptions.h" #include "split-name.h" #include "observable.h" #include "run-on-main-thread.h" diff --git a/gdb/dwarf2/frame-tailcall.c b/gdb/dwarf2/frame-tailcall.c index bcbe41f7933..c4890682274 100644 --- a/gdb/dwarf2/frame-tailcall.c +++ b/gdb/dwarf2/frame-tailcall.c @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "exceptions.h" #include "frame.h" #include "dwarf2/frame-tailcall.h" #include "dwarf2/loc.h" diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c index aeb688b13ee..2a50e3b6c2d 100644 --- a/gdb/dwarf2/index-write.c +++ b/gdb/dwarf2/index-write.c @@ -22,6 +22,7 @@ #include "addrmap.h" #include "cli/cli-decode.h" +#include "exceptions.h" #include "gdbsupport/byte-vector.h" #include "gdbsupport/filestuff.h" #include "gdbsupport/gdb_unlinker.h" diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 9db5fc1492d..5fea6683575 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -20,6 +20,7 @@ along with this program. If not, see . */ #include "event-top.h" +#include "exceptions.h" #include "ui-out.h" #include "value.h" #include "frame.h" diff --git a/gdb/elf-none-tdep.c b/gdb/elf-none-tdep.c index 00d46992b24..1e43dc24103 100644 --- a/gdb/elf-none-tdep.c +++ b/gdb/elf-none-tdep.c @@ -19,6 +19,7 @@ along with this program. If not, see . */ #include "elf-none-tdep.h" +#include "exceptions.h" #include "regset.h" #include "elf-bfd.h" #include "inferior.h" diff --git a/gdb/event-top.c b/gdb/event-top.c index 0425bcf9f99..b81970d11bb 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "exceptions.h" #include "gdbsupport/job-control.h" #include "run-on-main-thread.h" #include "top.h" diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c index a80f604fa78..77f46ced591 100644 --- a/gdb/fbsd-tdep.c +++ b/gdb/fbsd-tdep.c @@ -18,6 +18,7 @@ along with this program. If not, see . */ #include "auxv.h" +#include "exceptions.h" #include "extract-store-integer.h" #include "gdbcore.h" #include "inferior.h" diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c index 41e766095f0..ec0c059729e 100644 --- a/gdb/inf-loop.c +++ b/gdb/inf-loop.c @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "exceptions.h" #include "inferior.h" #include "infrun.h" #include "gdbsupport/event-loop.h" diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 02f6f0b3683..69db665da75 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -18,6 +18,7 @@ along with this program. If not, see . */ #include "arch-utils.h" +#include "exceptions.h" #include "symtab.h" #include "gdbtypes.h" #include "frame.h" diff --git a/gdb/infrun.c b/gdb/infrun.c index 2b6c1207391..1f32a63ad54 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -22,6 +22,7 @@ #include "displaced-stepping.h" #include "infrun.h" #include +#include "exceptions.h" #include "symtab.h" #include "frame.h" #include "inferior.h" diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 8e6ac87f5a1..fe880b3fb6f 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "exceptions.h" #include "gdbtypes.h" #include "linux-tdep.h" #include "auxv.h" diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 81a9c0d22a7..018bd689faa 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -18,6 +18,7 @@ along with this program. If not, see . */ #include +#include "exceptions.h" #include "gdb_proc_service.h" #include "nat/gdb_thread_db.h" #include "gdbsupport/gdb_vecs.h" diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c index 19295faf21e..6cf3a0d8bf1 100644 --- a/gdb/macrocmd.c +++ b/gdb/macrocmd.c @@ -26,6 +26,7 @@ #include "command.h" #include "cli/cli-cmds.h" #include "linespec.h" +#include "ui-out.h" /* The `macro' prefix command. */ diff --git a/gdb/main.c b/gdb/main.c index 571ade45fb1..4dd68f3d976 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -18,6 +18,7 @@ along with this program. If not, see . */ #include "annotate.h" +#include "exceptions.h" #include "top.h" #include "ui.h" #include "target.h" diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c index 343a167e3d8..5c78acd6493 100644 --- a/gdb/mi/mi-cmd-break.c +++ b/gdb/mi/mi-cmd-break.c @@ -18,6 +18,7 @@ along with this program. If not, see . */ #include "arch-utils.h" +#include "exceptions.h" #include "mi-cmds.h" #include "ui-out.h" #include "mi-out.h" diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h index 26faded3032..f2c6b1e9402 100644 --- a/gdb/mi/mi-cmds.h +++ b/gdb/mi/mi-cmds.h @@ -24,6 +24,7 @@ #include "gdbsupport/function-view.h" #include +#include "gdbsupport/scoped_restore.h" #include "mi/mi-main.h" enum print_values { diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index 168e6ed10b4..ff4a0ff3202 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -20,6 +20,7 @@ #include "mi-interp.h" +#include "exceptions.h" #include "interps.h" #include "event-top.h" #include "gdbsupport/event-loop.h" diff --git a/gdb/mi/mi-out.h b/gdb/mi/mi-out.h index a7afb156ed4..a21a34fb8c7 100644 --- a/gdb/mi/mi-out.h +++ b/gdb/mi/mi-out.h @@ -20,6 +20,7 @@ #ifndef MI_MI_OUT_H #define MI_MI_OUT_H +#include "ui-out.h" #include struct ui_out; diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 61b444d4e17..3655445833a 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -21,6 +21,7 @@ along with this program. If not, see . */ #include "event-top.h" +#include "exceptions.h" #include "symtab.h" #include "gdbtypes.h" #include "expression.h" diff --git a/gdb/record-full.c b/gdb/record-full.c index c51aadfef33..eb62d186fa5 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "exceptions.h" #include "extract-store-integer.h" #include "cli/cli-cmds.h" #include "regcache.h" diff --git a/gdb/record-full.h b/gdb/record-full.h index ef45b1c0d59..e8eb041311b 100644 --- a/gdb/record-full.h +++ b/gdb/record-full.h @@ -20,6 +20,8 @@ #ifndef RECORD_FULL_H #define RECORD_FULL_H +#include "gdbsupport/scoped_restore.h" + extern bool record_full_memory_query; extern int record_full_arch_list_add_reg (struct regcache *regcache, int num); diff --git a/gdb/remote.c b/gdb/remote.c index 965427c96a0..d4886c9650e 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -21,6 +21,7 @@ #include #include +#include "exceptions.h" #include "inferior.h" #include "infrun.h" #include "bfd.h" diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 1d4a50568d7..5c8557e9377 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -22,6 +22,7 @@ #include "elf/common.h" #include "elf/mips.h" +#include "exceptions.h" #include "extract-store-integer.h" #include "symtab.h" #include "bfd.h" diff --git a/gdb/solib.c b/gdb/solib.c index db2ff5ce9a3..881f0d96502 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -19,6 +19,7 @@ #include +#include "exceptions.h" #include "extract-store-integer.h" #include "symtab.h" #include "bfd.h" diff --git a/gdb/stack.c b/gdb/stack.c index c2323e1726d..b36193be2f3 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -18,6 +18,7 @@ along with this program. If not, see . */ #include "event-top.h" +#include "exceptions.h" #include "extract-store-integer.h" #include "top.h" #include "value.h" diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c index ec50ec4e33c..42569f4fa6d 100644 --- a/gdb/symfile-mem.c +++ b/gdb/symfile-mem.c @@ -41,6 +41,7 @@ entry point. */ +#include "exceptions.h" #include "symtab.h" #include "gdbcore.h" #include "objfiles.h" diff --git a/gdb/symmisc.c b/gdb/symmisc.c index f5f4865cb62..2956ad92fce 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -18,6 +18,7 @@ along with this program. If not, see . */ #include "event-top.h" +#include "exceptions.h" #include "symtab.h" #include "gdbtypes.h" #include "bfd.h" diff --git a/gdb/top.c b/gdb/top.c index 4da24343a0f..6239c190627 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "exceptions.h" #include "cli/cli-cmds.h" #include "cli/cli-script.h" #include "cli/cli-setshow.h" diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 285c781c25d..09fba029496 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "exceptions.h" #include "target.h" #include "gdbsupport/event-loop.h" #include "event-top.h" diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index 85b62321ca9..45cc22a6474 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -34,6 +34,7 @@ #include "source.h" #include "gdbsupport/event-loop.h" #include "async-event.h" +#include "ui-out.h" #include "utils.h" #include "tui/tui.h" diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index cb21d68e9b6..63b01ba55c8 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -21,6 +21,7 @@ #include "event-top.h" #include "cli/cli-cmds.h" +#include "exceptions.h" #include "tui/tui.h" #include "tui/tui-hooks.h" #include "tui/tui-command.h" diff --git a/gdb/ui.h b/gdb/ui.h index 95cf273473a..869714c6074 100644 --- a/gdb/ui.h +++ b/gdb/ui.h @@ -21,6 +21,7 @@ #include "gdbsupport/event-loop.h" #include "gdbsupport/intrusive_list.h" #include "gdbsupport/next-iterator.h" +#include "gdbsupport/scoped_restore.h" struct interp; diff --git a/gdb/unittests/ui-file-selftests.c b/gdb/unittests/ui-file-selftests.c index 7c55b80cdfe..589254f285c 100644 --- a/gdb/unittests/ui-file-selftests.c +++ b/gdb/unittests/ui-file-selftests.c @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "gdbsupport/scoped_restore.h" #include "gdbsupport/selftest.h" #include "ui-file.h" diff --git a/gdb/utils.h b/gdb/utils.h index 66eec9621fd..90c8012e73b 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -19,10 +19,6 @@ #ifndef UTILS_H #define UTILS_H -#include "exceptions.h" -#include "gdbsupport/array-view.h" -#include "gdbsupport/function-view.h" -#include "gdbsupport/scoped_restore.h" #include struct completion_match_for_lcd; diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index e4feea15d1f..37c1f46be35 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -21,6 +21,7 @@ /* Originally by Steve Chamberlain, sac@cygnus.com */ +#include "exceptions.h" #include "frame.h" #include "inferior.h" #include "infrun.h"