From patchwork Sat Jan 19 21:30:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 31131 Received: (qmail 66147 invoked by alias); 19 Jan 2019 21:31:12 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 65799 invoked by uid 89); 19 Jan 2019 21:30:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=tui X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.46.107) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 19 Jan 2019 21:30:29 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway20.websitewelcome.com (Postfix) with ESMTP id E2B1C400D02DE for ; Sat, 19 Jan 2019 15:30:08 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id kyBsgMuctdnCekyBsgQmHt; Sat, 19 Jan 2019 15:30:08 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=AWlgO9oD1FIYK3l6mwSc0UQA29Nc59Nwp29y9llP8m8=; b=Bad8ZVnB0Zn/qNzs4TsGr5pJay ICseRTlDvZAsLeg3/6wed5fys2K7kaVmBktOOclFFPY1HlA2zTCAeXevhftPi1P+NgvcZUg43EdQ3 +89lKYderIvYt2sNeuWf0Tg/U; Received: from 75-166-72-210.hlrn.qwest.net ([75.166.72.210]:51440 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gkyBs-0034k5-MX; Sat, 19 Jan 2019 15:30:08 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Remove duplicate or commented-out #includes Date: Sat, 19 Jan 2019 14:30:07 -0700 Message-Id: <20190119213007.23712-1-tom@tromey.com> I wrote a little script to detect duplicate or commented-out #includes and ran it on gdb. This patch is the result. Tested by rebuilding. It would be possible to sort #includes, or maybe run include-what-you-use on gdb, but I haven't tried that. I'd be interested to hear if you think this would be worthwhile, thoug. gdb/ChangeLog 2019-01-19 Tom Tromey * ui-out.c: Fix includes. * tui/tui-source.c: Fix includes. * target.c: Fix includes. * remote.c: Fix includes. * regcache.c: Fix includes. * python/py-block.c: Fix includes. * printcmd.c: Fix includes. * or1k-tdep.c: Fix includes. * mi/mi-main.c: Fix includes. * m32r-tdep.c: Fix includes. * csky-tdep.c: Fix includes. * compile/compile-cplus-types.c: Fix includes. * cli/cli-interp.c: Fix includes. gdb/gdbserver/ChangeLog 2019-01-19 Tom Tromey * tracepoint.c: Fix includes. * remote-utils.c: Fix includes. * linux-x86-low.c: Fix includes. gdb/stubs/ChangeLog 2019-01-19 Tom Tromey * ia64vms-stub.c: Fix includes. --- gdb/ChangeLog | 16 ++++++++++++++++ gdb/cli/cli-interp.c | 1 - gdb/compile/compile-cplus-types.c | 1 - gdb/csky-tdep.c | 2 -- gdb/gdbserver/ChangeLog | 6 ++++++ gdb/gdbserver/linux-x86-low.c | 1 - gdb/gdbserver/remote-utils.c | 1 - gdb/gdbserver/tracepoint.c | 1 - gdb/m32r-tdep.c | 1 - gdb/mi/mi-main.c | 1 - gdb/or1k-tdep.c | 1 - gdb/printcmd.c | 1 - gdb/python/py-block.c | 1 - gdb/regcache.c | 1 - gdb/remote.c | 1 - gdb/stubs/ChangeLog | 4 ++++ gdb/stubs/ia64vms-stub.c | 1 - gdb/target.c | 1 - gdb/tui/tui-source.c | 1 - gdb/ui-out.c | 1 - 20 files changed, 26 insertions(+), 18 deletions(-) diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index 8a3f65f088..0299f3dcdd 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -24,7 +24,6 @@ #include "ui-out.h" #include "cli-out.h" #include "top.h" /* for "execute_command" */ -#include "event-top.h" #include "infrun.h" #include "observable.h" #include "gdbthread.h" diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-types.c index 910a874550..97c4d3c707 100644 --- a/gdb/compile/compile-cplus-types.c +++ b/gdb/compile/compile-cplus-types.c @@ -28,7 +28,6 @@ #include "source.h" #include "cp-support.h" #include "cp-abi.h" -#include "symtab.h" #include "objfiles.h" #include "block.h" #include "gdbcmd.h" diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index ef8f29c559..1259ccaeb1 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -52,10 +52,8 @@ #include "dwarf2-frame.h" #include "user-regs.h" #include "valprint.h" -#include "reggroups.h" #include "csky-tdep.h" #include "regset.h" -#include "block.h" #include "opcode/csky.h" #include #include diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c index 99b0cc55ef..056d060046 100644 --- a/gdb/gdbserver/linux-x86-low.c +++ b/gdb/gdbserver/linux-x86-low.c @@ -72,7 +72,6 @@ static const char *xmltarget_amd64_linux_no_xml = "@\ #include #include -#include "nat/gdb_ptrace.h" #include #ifndef PTRACE_GET_THREAD_AREA diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index ef1b0ede3a..e7a2170bbd 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -25,7 +25,6 @@ #include "tdesc.h" #include "dll.h" #include "rsp-low.h" -#include "gdbthread.h" #include "netstuff.h" #include "filestuff.h" #include diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index c4af55749f..5fb8a5134b 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -7330,7 +7330,6 @@ gdb_agent_init (void) } #include -#include IP_AGENT_EXPORT_VAR char *gdb_tp_heap_buffer; IP_AGENT_EXPORT_VAR char *gdb_jump_pad_buffer; diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 3f17a5e027..18acdb6990 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -35,7 +35,6 @@ #include "regcache.h" #include "trad-frame.h" #include "dis-asm.h" -#include "objfiles.h" #include "m32r-tdep.h" #include diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index dc96032b0d..7176963845 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -43,7 +43,6 @@ #include "mi-common.h" #include "language.h" #include "valprint.h" -#include "inferior.h" #include "osdata.h" #include "common/gdb_splay_tree.h" #include "tracepoint.h" diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c index 9140ca2aab..13e130c6fd 100644 --- a/gdb/or1k-tdep.c +++ b/gdb/or1k-tdep.c @@ -33,7 +33,6 @@ #include "block.h" #include "reggroups.h" #include "arch-utils.h" -#include "frame.h" #include "frame-unwind.h" #include "frame-base.h" #include "dwarf2-frame.h" diff --git a/gdb/printcmd.c b/gdb/printcmd.c index e6fdbcf344..cd2e585235 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -50,7 +50,6 @@ #include "format.h" #include "source.h" #include "common/byte-vector.h" -#include "cli/cli-style.h" /* Last specified output format. */ diff --git a/gdb/python/py-block.c b/gdb/python/py-block.c index c6e68a107e..90140ebc34 100644 --- a/gdb/python/py-block.c +++ b/gdb/python/py-block.c @@ -23,7 +23,6 @@ #include "symtab.h" #include "python-internal.h" #include "objfiles.h" -#include "symtab.h" typedef struct blpy_block_object { PyObject_HEAD diff --git a/gdb/regcache.c b/gdb/regcache.c index c51ef771be..4a68390c5f 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -1419,7 +1419,6 @@ register_dump::dump (ui_file *file) #if GDB_SELF_TEST #include "selftest.h" #include "selftest-arch.h" -#include "gdbthread.h" #include "target-float.h" namespace selftests { diff --git a/gdb/remote.c b/gdb/remote.c index 4e2c85a223..4b3f2907b4 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -28,7 +28,6 @@ #include "symfile.h" #include "target.h" #include "process-stratum-target.h" -/*#include "terminal.h" */ #include "gdbcmd.h" #include "objfiles.h" #include "gdb-stabs.h" diff --git a/gdb/stubs/ia64vms-stub.c b/gdb/stubs/ia64vms-stub.c index 21119ec8ae..6e8ec4dee5 100644 --- a/gdb/stubs/ia64vms-stub.c +++ b/gdb/stubs/ia64vms-stub.c @@ -56,7 +56,6 @@ #include #include #include -#include #include #include diff --git a/gdb/target.c b/gdb/target.c index e66584f147..ad7eba3fa3 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -48,7 +48,6 @@ #include #include "byte-vector.h" #include "terminal.h" -#include #include static void generic_tls_error (void) ATTRIBUTE_NORETURN; diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index ed9562a930..a7e801eba2 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -25,7 +25,6 @@ #include "frame.h" #include "breakpoint.h" #include "source.h" -#include "symtab.h" #include "objfiles.h" #include "filenames.h" #include "source-cache.h" diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 7bcc2638ae..6851fd29c6 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -28,7 +28,6 @@ #include #include #include -#include namespace {