From patchwork Mon Sep 21 13:41:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 8815 Received: (qmail 4923 invoked by alias); 21 Sep 2015 13:41:14 -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 4765 invoked by uid 89); 21 Sep 2015 13:41:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f51.google.com Received: from mail-pa0-f51.google.com (HELO mail-pa0-f51.google.com) (209.85.220.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 21 Sep 2015 13:41:10 +0000 Received: by padhy16 with SMTP id hy16so117122360pad.1 for ; Mon, 21 Sep 2015 06:41:08 -0700 (PDT) X-Received: by 10.66.141.238 with SMTP id rr14mr315782pab.15.1442842868167; Mon, 21 Sep 2015 06:41:08 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (power-aix.osuosl.org. [140.211.15.154]) by smtp.gmail.com with ESMTPSA id kv10sm24720611pbc.2.2015.09.21.06.41.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Sep 2015 06:41:07 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Wrap gdb_agent_op_sizes by #ifndef IN_PROCESS_AGENT Date: Mon, 21 Sep 2015 14:41:04 +0100 Message-Id: <1442842864-2326-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes Hi, I see the following build warning with recent GCC built from mainline, aarch64-none-linux-gnu-gcc -g -O2 -I. -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/../common -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/../regformats -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/.. -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/../../include -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/../gnulib/import -Ibuild-gnulib-gdbserver/import -Wall -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Wempty-body -Wdeclaration-after-statement -Werror -DGDBSERVER -DCONFIG_UST_GDB_INTEGRATION -fPIC -DIN_PROCESS_AGENT -fvisibility=hidden -c -o ax-ipa.o -MT ax-ipa.o -MMD -MP -MF .deps/ax-ipa.Tpo `echo " -Wall -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Wempty-body -Wdeclaration-after-statement " | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"` /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/ax.c /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/ax.c:73:28: error: 'gdb_agent_op_sizes' defined but not used [-Werror=unused-const-variable] static const unsigned char gdb_agent_op_sizes [gdb_agent_op_last] = ^ cc1: all warnings being treated as errors gdb_agent_op_sizes is only used in function is_goto_target, which is defined inside #ifndef IN_PROCESS_AGENT. This warning is not arch specific, so GCC mainline for other targets should produce this warning too, although this warning is triggered by enabling aarch64 fast tracepoint. The fix is to move gdb_agent_op_sizes to #ifndef IN_PROCESS_AGENT. gdb/gdbserver: 2015-09-21 Yao Qi * ax.c [!IN_PROCESS_AGENT] (gdb_agent_op_sizes): Define it. --- gdb/gdbserver/ax.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c index d834fbb..3d0d93d 100644 --- a/gdb/gdbserver/ax.c +++ b/gdb/gdbserver/ax.c @@ -69,6 +69,7 @@ static const char *gdb_agent_op_names [gdb_agent_op_last] = #undef DEFOP }; +#ifndef IN_PROCESS_AGENT static const unsigned char gdb_agent_op_sizes [gdb_agent_op_last] = { 0 @@ -76,6 +77,7 @@ static const unsigned char gdb_agent_op_sizes [gdb_agent_op_last] = #include "ax.def" #undef DEFOP }; +#endif /* A wrapper for gdb_agent_op_names that does some bounds-checking. */