From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CC0DC433E0 for ; Tue, 12 Jan 2021 15:05:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE36123131 for ; Tue, 12 Jan 2021 15:05:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE36123131 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bwidawsk.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzLF5-0001Sg-F0 for qemu-devel@archiver.kernel.org; Tue, 12 Jan 2021 10:05:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzLA2-0004gU-Hc for qemu-devel@nongnu.org; Tue, 12 Jan 2021 10:00:46 -0500 Received: from zangief.bwidawsk.net ([107.170.211.233]:48160 helo=mail.bwidawsk.net) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzL9z-0006II-EN for qemu-devel@nongnu.org; Tue, 12 Jan 2021 10:00:40 -0500 Received: by mail.bwidawsk.net (Postfix, from userid 5001) id 07594123395; Tue, 12 Jan 2021 07:00:35 -0800 (PST) Received: from mail.bwidawsk.net (c-73-37-61-164.hsd1.or.comcast.net [73.37.61.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mail.bwidawsk.net (Postfix) with ESMTPSA id A5D13123391; Tue, 12 Jan 2021 07:00:32 -0800 (PST) Date: Tue, 12 Jan 2021 07:00:31 -0800 From: Ben Widawsky To: Alex =?utf-8?Q?Benn=C3=A9e?= Subject: Re: [RFC PATCH] Makefile: add GNU global tags support Message-ID: <20210112150031.rvdsatlcqa22k4a6@mail.bwidawsk.net> References: <20210108121935.640-1-alex.bennee@linaro.org> <20210108175431.tbf2bqizx4dx6vda@mail.bwidawsk.net> <87wnwnysaq.fsf@linaro.org> <20210108224231.qyrnl5ku7ht7s3w3@mail.bwidawsk.net> <87czyao63w.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87czyao63w.fsf@linaro.org> Received-SPF: none client-ip=107.170.211.233; envelope-from=ben@bwidawsk.net; helo=mail.bwidawsk.net X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.4, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 21-01-12 09:27:39, Alex Bennée wrote: > > Ben Widawsky writes: > > > On 21-01-08 22:30:59, Alex Bennée wrote: > >> > >> Ben Widawsky writes: > >> > >> > On 21-01-08 12:19:35, Alex Bennée wrote: > >> >> GNU Global is another tags engine which is more like cscope in being > >> >> able to support finding both references and definitions. You will be > >> >> un-surprised to know it also integrates well with Emacs. > >> >> > >> >> The main benefit of integrating it into find-src-path is it takes less > >> >> time to rebuild the database from scratch when you have a lot of build > >> >> directories under your source tree. > >> >> > >> >> Signed-off-by: Alex Bennée > >> > > >> > It might be worth mentioning that the Linux kernel has supported this for a long > >> > time now (10+ years). > >> > > >> > Having switched to gtags about 3 years ago, I think it's summarily better and > >> > would really like this to get merged. > >> > >> So I take it that's a reviewed-by and a tested-by tag from you? > >> > > > > It doesn't actually work correctly for me, I just like the idea :-) > > > > make gtags 2>&1 | grep ignored | wc -l > > 6266 > > > > Warning: '/home/bwidawsk/work/clk/qemu/accel/qtest/qtest.c' is out of > > source tree. ignored. > > Did you run this in the build directory by any chance? I tested in the > source directory because that's generally where you want the tags. > > I wonder what the best solution is to this? Always force ourselves to be > in the source dir? Or error out when we are not in the source tree? I was in the build directory. With ctags, that works for me in both source and build directory. It does indeed work from the source directory. I'm wondering how gtags can't seem to do this (I wasn't able to figure it out, at least). I'd be in favor of error. > > > > > >> > > >> >> --- > >> >> Makefile | 9 ++++++++- > >> >> .gitignore | 3 +++ > >> >> 2 files changed, 11 insertions(+), 1 deletion(-) > >> >> > >> >> diff --git a/Makefile b/Makefile > >> >> index fb9923ff22..66eec99685 100644 > >> >> --- a/Makefile > >> >> +++ b/Makefile > >> >> @@ -253,6 +253,13 @@ ctags: > >> >> rm -f "$(SRC_PATH)/"tags > >> >> $(find-src-path) -exec ctags -f "$(SRC_PATH)/"tags --append {} + > >> >> > >> >> +.PHONY: gtags > >> >> +gtags: > >> >> + rm -f "$(SRC_PATH)/"GTAGS > >> >> + rm -f "$(SRC_PATH)/"GRTAGS > >> >> + rm -f "$(SRC_PATH)/"GPATH > >> >> + $(find-src-path) | gtags -f - > >> >> + > >> >> .PHONY: TAGS > >> >> TAGS: > >> >> rm -f "$(SRC_PATH)/"TAGS > >> >> @@ -279,7 +286,7 @@ help: > >> >> $(call print-help,all,Build all) > >> >> $(call print-help,dir/file.o,Build specified target only) > >> >> $(call print-help,install,Install QEMU, documentation and tools) > >> >> - $(call print-help,ctags/TAGS,Generate tags file for editors) > >> >> + $(call print-help,ctags/gtags/TAGS,Generate tags file for editors) > >> >> $(call print-help,cscope,Generate cscope index) > >> >> $(call print-help,sparse,Run sparse on the QEMU source) > >> >> @echo '' > >> >> diff --git a/.gitignore b/.gitignore > >> >> index b32bca1315..75a4be0724 100644 > >> >> --- a/.gitignore > >> >> +++ b/.gitignore > >> >> @@ -7,6 +7,9 @@ > >> >> cscope.* > >> >> tags > >> >> TAGS > >> >> +GPATH > >> >> +GRTAGS > >> >> +GTAGS > >> >> *~ > >> >> *.ast_raw > >> >> *.depend_raw > >> >> -- > >> >> 2.20.1 > >> >> > >> >> > >> > >> > >> -- > >> Alex Bennée > > > -- > Alex Bennée