From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id C0A3B3858D37 for ; Mon, 6 Jul 2020 14:18:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C0A3B3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.193] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 73B581E793; Mon, 6 Jul 2020 10:18:45 -0400 (EDT) Subject: Re: [PATCH v2 2/7] Add "help news" From: Simon Marchi To: Tom Tromey , gdb-patches@sourceware.org References: <20200623132006.15863-1-tom@tromey.com> <20200623132006.15863-3-tom@tromey.com> <8f06b5c2-829d-9baa-910e-fbc8dcf1748b@simark.ca> Message-ID: Date: Mon, 6 Jul 2020 10:18:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <8f06b5c2-829d-9baa-910e-fbc8dcf1748b@simark.ca> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2020 14:18:46 -0000 On 2020-07-06 10:06 a.m., Simon Marchi wrote: > On 2020-06-23 9:20 a.m., Tom Tromey wrote: >> This adds a "help news" subcommand, which simply dumps the NEWS file. >> The NEWS file is now installed. > > (1) I first tried "help news" with GDB in its build directory without passing > --data-directory, expecting it to fail, just to see how it would fail. It > says: > > (gdb) help news > could not open the NEWS file: No such file or directory. > > Maybe this message should say which path it's trying to open. If this > happens, the cause would probably be a broken GDB installation, and it > would be useful to know where is GDB looking for that file. > > (2) When trying to "make install", I get this error: > > $ make install DESTDIR=/tmp/install > ... > make[4]: *** No rule to make target 'install-news', needed by 'install-only'. Stop. > > Indeed, the install-news target is used but does not exist. > > (3) Since we look for the NEWS file at /NEWS, I presume it won't > work when running GDB in its build directory, either with > > ./gdb --data-directory=data-directory > > or > > make run > > since the NEWS file is not there. It's not a big deal, but if you think of an easy > way to make it work, it would be nice. Can we put a symlink from data-directory/NEWS > to NEWS? > > (4) I tried what I mentioned just above and I get some sanitizer error: > > $ ./gdb -q -nx --data-directory=data-directory > (gdb) help news > /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:1214:60: runtime error: index 1024 out of bounds for type 'char [1024]' > > Not sure if it's ASan or UBSan. > > Simon > Oh and: (5) the way "help news" is implemented means the "news" part is not discoverable through tab-completion. I'm not super familiar with how commands work, but would it work if you registered the "help news" command as a separate command? That's not a deal-breaker, but I thought I would mention it just in case it's easy to fix. Simon