From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2009) id BDC303858D32; Fri, 15 Jul 2022 21:36:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BDC303858D32 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Aaron Merey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb-add-index always generates an error when libdebuginfod wasn't compiled in X-Act-Checkin: binutils-gdb X-Git-Author: Aaron Merey X-Git-Refname: refs/heads/master X-Git-Oldrev: 13c3e10f98ff9b89c12161e85bd576ea77460a83 X-Git-Newrev: 92b0a182fe00da3022516f3cb8f815d527d73652 Message-Id: <20220715213652.BDC303858D32@sourceware.org> Date: Fri, 15 Jul 2022 21:36:52 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2022 21:36:52 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D92b0a182fe00= da3022516f3cb8f815d527d73652 commit 92b0a182fe00da3022516f3cb8f815d527d73652 Author: Aaron Merey Date: Tue Jul 5 18:11:49 2022 -0400 gdb-add-index always generates an error when libdebuginfod wasn't compi= led in =20 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. =20 Fix this by changing the 'set debuginfod enabled off' command to a no-op when gdb isn't built with libdebuginfod. Diff: --- 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..5f04a2b38ca 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 =3D value; #else - error (NO_IMPL); + /* Disabling debuginfod when gdb is not built with it is a no-op. */ + if (value !=3D debuginfod_off) + error (NO_IMPL); #endif }