]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb-add-index always generates an error when libdebuginfod wasn't compiled in
authorAaron Merey <amerey@redhat.com>
Tue, 5 Jul 2022 22:11:49 +0000 (18:11 -0400)
committerAaron Merey <amerey@redhat.com>
Fri, 15 Jul 2022 21:11:23 +0000 (17:11 -0400)
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

index 9dbe6b5d8b2b9904eac1e3207439b76729c3d0e5..5f04a2b38ca25ab3ccb52a1bcdd0a630b7fc9b28 100644 (file)
@@ -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 (value != debuginfod_off)
+    error (NO_IMPL);
 #endif
 }