summaryrefslogtreecommitdiff
path: root/gdb/debuginfod-support.c
diff options
context:
space:
mode:
authorAaron Merey <amerey@redhat.com>2022-07-05 18:11:49 -0400
committerAaron Merey <amerey@redhat.com>2022-07-15 17:11:23 -0400
commit92b0a182fe00da3022516f3cb8f815d527d73652 (patch)
tree653dba1c1d7bed4a237cc49d70a8e033184cbbc1 /gdb/debuginfod-support.c
parent13c3e10f98ff9b89c12161e85bd576ea77460a83 (diff)
downloadbinutils-gdb-92b0a182fe00da3022516f3cb8f815d527d73652.tar.gz
gdb-add-index always generates an error when libdebuginfod wasn't compiled in
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.
Diffstat (limited to 'gdb/debuginfod-support.c')
-rw-r--r--gdb/debuginfod-support.c4
1 files changed, 3 insertions, 1 deletions
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 = 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
}