[PATCH 1/2] gdb: add set/show commands for managing debuginfod

Lancelot SIX lsix@lancelotsix.com
Thu Oct 21 22:23:54 GMT 2021


> 
> Just a question for others: Is this the normal style used in GDB? E.g., the
> python command is always available:
> (gdb) python print(1)
> Python scripting is not supported in this copy of GDB.
> 
> Like command/command-line options, I'd like us to be vigilant of consistency.
> [Maybe that's just my personal thing, though.]
> 
> It's just a question -- I am not asking for any changes.

Hi,

>From what I can tell, the usage is usually to have the commands always
present, but act as a noop (while maybe still printing a warning to the
user) when the feature is not built into GDB.  I think some commands
would also force the value to become off if they detect the support is
missing (see gdb_internal_backtrace_set_cmd for an example).

One argument for this is that it allows the commands to be placed in
scripts (such as .gdbinit for example) and not cause an error when
executing script if the command is missing.  This would result in
subsequent commands in the script to be ignored which could be
unfortunate.  If the command is turned into a noop it is easier to have
just one portable gdbinit file shared across deployment.

That being said, this is just my personal view on the subject, I’ll let
maintainers tell if there is a guideline to follow.

Best,
Lancelot.
> 
> With the safe_strerror change, though, I recommend a maintainer review
> this patch for final approval(s).
> 
> Keith
> 



More information about the Gdb-patches mailing list