From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 6768C385841A for ; Tue, 5 Jul 2022 22:37:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6768C385841A Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-_smFh-MWOYKuQeOz7pdK5A-1; Tue, 05 Jul 2022 18:37:23 -0400 X-MC-Unique: _smFh-MWOYKuQeOz7pdK5A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3A0CD801231 for ; Tue, 5 Jul 2022 22:37:23 +0000 (UTC) Received: from localhost.localdomain (unknown [10.22.8.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 098CDC08F0D; Tue, 5 Jul 2022 22:37:22 +0000 (UTC) From: Aaron Merey To: gdb-patches@sourceware.org Subject: [PATCH] [PR gdb/29316] gdb-add-index always generates an error when libdebuginfod wasn't compiled in Date: Tue, 5 Jul 2022 18:37:11 -0400 Message-Id: <20220705223711.498452-1-amerey@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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: Tue, 05 Jul 2022 22:37:31 -0000 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); #endif } -- 2.35.3