From 333f35b6315f6ed71db4fb76bfc1ebb7ec347d43 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 2 Nov 2021 12:21:31 -0400 Subject: gdb: rework "set debuginfod" commands As discussed here [1], do some re-work in the "set debuginfod commands". First, use "set debuginfod enabled on/off/ask" instead of "set debuginfod on/off/ask". This is more MI-friendly, and it gives an output that makes more sense in "info set", for example. Then, make the show commands not call "error" when debuginfod support is not compiled in. This makes the commands "show" and "show debuginfod" stop early, breaking gdb.base/default.exp: Running /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.base/default.exp ... FAIL: gdb.base/default.exp: info set FAIL: gdb.base/default.exp: show - Make the "debuginfod enabled" setting default to "off" when debuginfod support is not compiled in, and "ask" otherwise. - Make the setter of "debuginfod enabled" error out when debuginfod support is not compiled in, so that "debuginfod enabled" will always remain "off" in that case. - Make the setter of "debuginfod verbose" work in any case. I don't see the harm in letting the user change that setting, since the user will hit an error if they try to enable the use of debuginfod. - I would do the same for the "debuginfod urls" setter, but because this one needs to see the DEBUGINFOD_URLS_ENV_VAR macro, provided by libdebuginfod, I made that one error out as well if debuginfod support is not compiled it (otherwise, I would have left it like "debuginfod verbose". Alternatively, we could hard-code "DEBUGINFOD_URLS" in the code (in fact, it was prior to this patch, but I think it was an oversight, as other spots use DEBUGINFOD_URLS_ENV_VAR), or use a dummy string to store the setting, but I don't really see the value in that. Rename debuginfod_enable to debuginfod_enabled, just so it matches the setting name. [1] https://sourceware.org/pipermail/gdb-patches/2021-October/182937.html Change-Id: I45fdb2993f668226a5639228951362b7800f09d5 Co-Authored-By: Aaron Merey --- gdb/doc/gdb.texinfo | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'gdb/doc') diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index fc8e5bd..f6d221f 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -47114,27 +47114,28 @@ regarding @code{debuginfod}. @value{GDBN} provides the following commands for configuring @code{debuginfod}. @table @code -@kindex set debuginfod -@anchor{set debuginfod} -@item set debuginfod -@itemx set debuginfod on +@kindex set debuginfod enabled +@anchor{set debuginfod enabled} +@item set debuginfod enabled +@itemx set debuginfod enabled on @cindex enable debuginfod @value{GDBN} will attempt to query @code{debuginfod} servers when missing debug info or source files. -@item set debuginfod off +@item set debuginfod enabled off @value{GDBN} will not attempt to query @code{debuginfod} servers when missing -debug info or source files. By default, @code{debuginfod} is set to @code{off} -for non-interactive sessions. +debug info or source files. By default, @code{debuginfod enabled} is set to +@code{off} for non-interactive sessions. -@item set debuginfod ask +@item set debuginfod enabled ask @value{GDBN} will prompt the user to enable or disable @code{debuginfod} before -attempting to perform the next query. By default, @code{debuginfod} is set to -@code{ask} for interactive sessions. +attempting to perform the next query. By default, @code{debuginfod enabled} +is set to @code{ask} for interactive sessions. -@kindex show debuginfod status -@item show debuginfod status -Show whether @code{debuginfod} is set to @code{on}, @code{off} or @code{ask}. +@kindex show debuginfod enabled +@item show debuginfod enabled +Display whether @code{debuginfod enabled} is set to @code{on}, @code{off} or +@code{ask}. @kindex set debuginfod urls @cindex configure debuginfod URLs -- cgit v1.1