From 9102a6c15c756c55e77c0fa7deecfc58fa8a361e Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 30 May 2024 22:54:07 -0400 Subject: gdb/tui: cleanup includes Remove includes reported as unused by clangd. Then, add any includes necessary to get rid of errors (includes possibly relying on previous includes).. I didn't remove the includes of gdb-safe-ctypes.h, because it appears to do some some preprocessor magic, redefining standard macros. I'm afraid that removing these includes could change the behavior unintentionally. Change-Id: I4c5b652355c3bbce022fe0d447a72dc4e1d17d34 Approved-By: Tom Tromey --- gdb/tui/tui-command.c | 4 ---- gdb/tui/tui-data.c | 2 -- gdb/tui/tui-data.h | 2 -- gdb/tui/tui-disasm.c | 6 ------ gdb/tui/tui-disasm.h | 1 + gdb/tui/tui-file.c | 1 - gdb/tui/tui-hooks.c | 12 ------------ gdb/tui/tui-interp.c | 5 ----- gdb/tui/tui-io.c | 1 - gdb/tui/tui-layout.c | 5 ----- gdb/tui/tui-location.c | 2 -- gdb/tui/tui-location.h | 5 ----- gdb/tui/tui-regs.c | 6 ------ gdb/tui/tui-regs.h | 1 + gdb/tui/tui-source.c | 6 ------ gdb/tui/tui-source.h | 1 + gdb/tui/tui-status.c | 4 ---- gdb/tui/tui-win.c | 9 --------- gdb/tui/tui-wingeneral.c | 2 -- gdb/tui/tui-winsource.c | 4 +--- gdb/tui/tui-winsource.h | 1 + gdb/tui/tui.c | 6 ------ 22 files changed, 5 insertions(+), 81 deletions(-) (limited to 'gdb/tui') diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c index d36c137..b9bc19e 100644 --- a/gdb/tui/tui-command.c +++ b/gdb/tui/tui-command.c @@ -19,10 +19,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "tui/tui.h" -#include "tui/tui-data.h" -#include "tui/tui-win.h" -#include "tui/tui-io.h" #include "tui/tui-command.h" #include "tui/tui-wingeneral.h" diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index 462771c..962dbc5 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -19,12 +19,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "symtab.h" #include "tui/tui.h" #include "tui/tui-data.h" #include "tui/tui-win.h" #include "tui/tui-wingeneral.h" -#include "tui/tui-winsource.h" #include "tui/tui-status.h" #include "gdb_curses.h" #include diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 04cce02..b9922db 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -24,8 +24,6 @@ #include "tui/tui.h" #include "gdb_curses.h" -#include "observable.h" -#include "gdbsupport/gdb-checked-static-cast.h" /* A deleter that calls delwin. */ struct curses_deleter diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 24a5044..0727d3a 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -29,13 +29,9 @@ #include "tui/tui.h" #include "tui/tui-command.h" #include "tui/tui-data.h" -#include "tui/tui-win.h" -#include "tui/tui-layout.h" #include "tui/tui-winsource.h" #include "tui/tui-status.h" -#include "tui/tui-file.h" #include "tui/tui-disasm.h" -#include "tui/tui-source.h" #include "progspace.h" #include "objfiles.h" #include "cli/cli-style.h" @@ -43,8 +39,6 @@ #include "gdbsupport/selftest.h" #include "inferior.h" -#include "gdb_curses.h" - struct tui_asm_line { CORE_ADDR addr; diff --git a/gdb/tui/tui-disasm.h b/gdb/tui/tui-disasm.h index 4a77354..c5e8eb4 100644 --- a/gdb/tui/tui-disasm.h +++ b/gdb/tui/tui-disasm.h @@ -22,6 +22,7 @@ #ifndef TUI_TUI_DISASM_H #define TUI_TUI_DISASM_H +#include "gdbsupport/gdb-checked-static-cast.h" #include "tui/tui.h" #include "tui/tui-data.h" #include "tui-winsource.h" diff --git a/gdb/tui/tui-file.c b/gdb/tui/tui-file.c index a0d72a0..7878190 100644 --- a/gdb/tui/tui-file.c +++ b/gdb/tui/tui-file.c @@ -19,7 +19,6 @@ #include "tui/tui-file.h" #include "tui/tui-io.h" #include "tui/tui-command.h" -#include "tui.h" void tui_file::puts (const char *linebuffer) diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index 9dcf789..e6673ab 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -19,18 +19,11 @@ #include "symtab.h" #include "inferior.h" -#include "command.h" -#include "bfd.h" #include "symfile.h" #include "objfiles.h" #include "target.h" -#include "gdbcore.h" -#include "gdbsupport/event-loop.h" -#include "event-top.h" #include "frame.h" #include "breakpoint.h" -#include "ui-out.h" -#include "top.h" #include "observable.h" #include "source.h" #include @@ -38,16 +31,11 @@ #include "tui/tui.h" #include "tui/tui-hooks.h" -#include "tui/tui-data.h" #include "tui/tui-layout.h" -#include "tui/tui-io.h" #include "tui/tui-regs.h" -#include "tui/tui-win.h" #include "tui/tui-status.h" #include "tui/tui-winsource.h" -#include "gdb_curses.h" - static void tui_new_objfile_hook (struct objfile* objfile) { diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c index 7ebaf8f..25761be 100644 --- a/gdb/tui/tui-interp.c +++ b/gdb/tui/tui-interp.c @@ -21,16 +21,11 @@ #include "interps.h" #include "ui.h" #include "event-top.h" -#include "gdbsupport/event-loop.h" #include "ui-out.h" #include "cli-out.h" -#include "tui/tui-data.h" #include "tui/tui-win.h" #include "tui/tui.h" #include "tui/tui-io.h" -#include "infrun.h" -#include "observable.h" -#include "gdbthread.h" #include "inferior.h" #include "main.h" diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 299a809..f962d7b 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -23,7 +23,6 @@ #include "target.h" #include "gdbsupport/event-loop.h" #include "event-top.h" -#include "command.h" #include "top.h" #include "ui.h" #include "tui/tui.h" diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 3cb5a05..665b521 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -19,15 +19,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "arch-utils.h" #include "command.h" #include "symtab.h" #include "frame.h" -#include "source.h" -#include "cli/cli-cmds.h" #include "cli/cli-decode.h" #include "cli/cli-utils.h" -#include #include #include "tui/tui.h" @@ -37,7 +33,6 @@ #include "tui/tui-status.h" #include "tui/tui-regs.h" #include "tui/tui-win.h" -#include "tui/tui-winsource.h" #include "tui/tui-disasm.h" #include "tui/tui-layout.h" #include "tui/tui-source.h" diff --git a/gdb/tui/tui-location.c b/gdb/tui/tui-location.c index 7e8f769..8e63d4f 100644 --- a/gdb/tui/tui-location.c +++ b/gdb/tui/tui-location.c @@ -15,9 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "tui/tui.h" #include "tui/tui-status.h" -#include "tui/tui-data.h" #include "tui/tui-location.h" #include "symtab.h" #include "source.h" diff --git a/gdb/tui/tui-location.h b/gdb/tui/tui-location.h index db558a4..ec05f45 100644 --- a/gdb/tui/tui-location.h +++ b/gdb/tui/tui-location.h @@ -18,11 +18,6 @@ #ifndef TUI_TUI_LOCATION_H #define TUI_TUI_LOCATION_H -#include "tui/tui.h" -#include "tui/tui.h" -#include "gdb_curses.h" -#include "observable.h" - /* Class used to track the current location that the TUI is displaying. An instance of this class will be created; as events occur within GDB the location information within this instance will be updated. As windows diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index 50708fd..43b519a 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -21,10 +21,7 @@ #include "arch-utils.h" #include "tui/tui.h" -#include "tui/tui-data.h" #include "symtab.h" -#include "gdbtypes.h" -#include "cli/cli-cmds.h" #include "frame.h" #include "regcache.h" #include "inferior.h" @@ -32,11 +29,8 @@ #include "tui/tui-layout.h" #include "tui/tui-win.h" #include "tui/tui-wingeneral.h" -#include "tui/tui-file.h" #include "tui/tui-regs.h" -#include "tui/tui-io.h" #include "reggroups.h" -#include "valprint.h" #include "completer.h" #include "gdb_curses.h" diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h index 4a799e6..69ba107 100644 --- a/gdb/tui/tui-regs.h +++ b/gdb/tui/tui-regs.h @@ -22,6 +22,7 @@ #ifndef TUI_TUI_REGS_H #define TUI_TUI_REGS_H +#include "gdbsupport/gdb-checked-static-cast.h" #include "tui/tui-data.h" #include "reggroups.h" diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index 5c17aba..444c0f7 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -20,7 +20,6 @@ along with this program. If not, see . */ #include -#include #include "symtab.h" #include "frame.h" #include "breakpoint.h" @@ -28,16 +27,11 @@ #include "objfiles.h" #include "filenames.h" #include "source-cache.h" - -#include "tui/tui.h" -#include "tui/tui-data.h" -#include "tui/tui-io.h" #include "tui/tui-status.h" #include "tui/tui-win.h" #include "tui/tui-winsource.h" #include "tui/tui-source.h" #include "tui/tui-location.h" -#include "gdb_curses.h" /* Function to display source in the source window. */ bool diff --git a/gdb/tui/tui-source.h b/gdb/tui/tui-source.h index 9a72ed9..f32167f 100644 --- a/gdb/tui/tui-source.h +++ b/gdb/tui/tui-source.h @@ -22,6 +22,7 @@ #ifndef TUI_TUI_SOURCE_H #define TUI_TUI_SOURCE_H +#include "gdbsupport/gdb-checked-static-cast.h" #include "tui/tui-data.h" #include "tui-winsource.h" diff --git a/gdb/tui/tui-status.c b/gdb/tui/tui-status.c index de754cb..5239415 100644 --- a/gdb/tui/tui-status.c +++ b/gdb/tui/tui-status.c @@ -20,21 +20,17 @@ along with this program. If not, see . */ #include "symtab.h" -#include "breakpoint.h" #include "frame.h" #include "command.h" #include "inferior.h" #include "target.h" #include "top.h" #include "gdb-demangle.h" -#include "source.h" #include "tui/tui.h" #include "tui/tui-data.h" #include "tui/tui-status.h" #include "tui/tui-wingeneral.h" -#include "tui/tui-source.h" #include "tui/tui-winsource.h" -#include "tui/tui-file.h" #include "tui/tui-location.h" #include "gdb_curses.h" diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index f43ead8..2f793e2 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -26,14 +26,9 @@ #include "command.h" #include "symtab.h" -#include "breakpoint.h" #include "frame.h" #include "cli/cli-cmds.h" #include "cli/cli-style.h" -#include "top.h" -#include "source.h" -#include "gdbsupport/event-loop.h" -#include "async-event.h" #include "ui-out.h" #include "utils.h" @@ -43,8 +38,6 @@ #include "tui/tui-data.h" #include "tui/tui-layout.h" #include "tui/tui-wingeneral.h" -#include "tui/tui-status.h" -#include "tui/tui-regs.h" #include "tui/tui-disasm.h" #include "tui/tui-source.h" #include "tui/tui-winsource.h" @@ -55,8 +48,6 @@ #include "readline/readline.h" #include -#include - static void tui_set_tab_width_command (const char *, int); static void tui_refresh_all_command (const char *, int); static void tui_all_windows_info (const char *, int); diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index 6260d08..1153047 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -19,12 +19,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "tui/tui.h" #include "tui/tui-data.h" #include "tui/tui-io.h" #include "tui/tui-wingeneral.h" #include "tui/tui-win.h" -#include "tui/tui-status.h" #include "cli/cli-style.h" #include "gdb_curses.h" diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index a05f648..80297e5 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -19,14 +19,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include +#include "observable.h" #include "symtab.h" #include "frame.h" #include "breakpoint.h" #include "value.h" #include "source.h" #include "objfiles.h" -#include "filenames.h" #include "gdbsupport/gdb-safe-ctype.h" #include "tui/tui.h" @@ -34,7 +33,6 @@ #include "tui/tui-io.h" #include "tui/tui-status.h" #include "tui/tui-win.h" -#include "tui/tui-wingeneral.h" #include "tui/tui-winsource.h" #include "tui/tui-source.h" #include "tui/tui-disasm.h" diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h index 6465973..29828c1 100644 --- a/gdb/tui/tui-winsource.h +++ b/gdb/tui/tui-winsource.h @@ -22,6 +22,7 @@ #ifndef TUI_TUI_WINSOURCE_H #define TUI_TUI_WINSOURCE_H +#include "gdbsupport/observable.h" #include "tui/tui-data.h" #include "symtab.h" diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 1318cae..781ec85 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -28,7 +28,6 @@ #include "tui/tui-data.h" #include "tui/tui-layout.h" #include "tui/tui-io.h" -#include "tui/tui-regs.h" #include "tui/tui-status.h" #include "tui/tui-win.h" #include "tui/tui-wingeneral.h" @@ -36,18 +35,13 @@ #include "tui/tui-source.h" #include "target.h" #include "frame.h" -#include "breakpoint.h" #include "inferior.h" #include "symtab.h" -#include "source.h" #include "terminal.h" #include "top.h" #include "ui.h" -#include -#include #include -#include #include "gdb_curses.h" #include "interps.h" -- cgit v1.1