From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id E880C3858287 for ; Wed, 6 Jul 2022 10:32:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E880C3858287 Received: from ubuntu.lan (unknown [IPv6:2a02:390:9086::635]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 2ED6688294; Wed, 6 Jul 2022 10:32:48 +0000 (UTC) Date: Wed, 6 Jul 2022 10:32:42 +0000 From: Lancelot SIX To: Aaron Merey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] [PR gdb/29316] gdb-add-index always generates an error when libdebuginfod wasn't compiled in Message-ID: <20220706103242.xexrlcuctwbl3izp@ubuntu.lan> References: <20220705223711.498452-1-amerey@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220705223711.498452-1-amerey@redhat.com> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Wed, 06 Jul 2022 10:32:48 +0000 (UTC) X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Wed, 06 Jul 2022 10:32:51 -0000 On Tue, Jul 05, 2022 at 06:37:11PM -0400, Aaron Merey via Gdb-patches wrote: > gdb-add-index runs gdb with -iex 'set debuginfod enabled off'. If gdb > is not compiled against libdebuginfod this causes an unnecessary error > message to be printed to stderr indicating that gdb was not built with > debuginfod support. > > Fix this by changing the 'set debuginfod enabled off' command to a > no-op when gdb isn't built with libdebuginfod. > --- > gdb/debuginfod-support.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c > index 9dbe6b5d8b2..2c346abf958 100644 > --- a/gdb/debuginfod-support.c > +++ b/gdb/debuginfod-support.c > @@ -368,7 +368,9 @@ set_debuginfod_enabled (const char *value) > #if defined(HAVE_LIBDEBUGINFOD) > debuginfod_enabled = value; > #else > - error (NO_IMPL); > + /* Disabling debuginfod when gdb is not built with it is a no-op. */ > + if (strcmp (value, debuginfod_off) != 0) > + error (NO_IMPL); Hii Aaron, You could compare the pointers themselves instead of doing a strcmp. The call to parse_cli_var_enum earlier in the processing ensures that VALUE is a member of debuginfod_enabled_enum. Otherwise, and for what it is worth (I am no maintainer), the change seems reasonable. Best, Lancelot. > #endif > } > > -- > 2.35.3 >