]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: do not recompute values for inferior parameters when showing them
authorSébastien Darche <sdarche@efficios.com>
Mon, 29 Sep 2025 14:22:49 +0000 (10:22 -0400)
committerSébastien Darche <sdarche@efficios.com>
Wed, 8 Oct 2025 20:00:33 +0000 (16:00 -0400)
commit890bc1b7f5b156d57e86154cf333d4c5714f3a03
treebad7206282dac1fef3ed8f87744a82e4920dc170
parent5a9a34d769abd73a5b68f0895488c94c1c883739
gdb: do not recompute values for inferior parameters when showing them

When calling the `show` command on a few inferior-specific settings
(inferior-tty, args, cwd), GDB will recompute the values despite them
being provided by a getter.

For instance, When `show cwd` is called, `do_show_command` will query
the value of the `cwd` through `get_inferior_cwd`, which already gets
the per-inferior value. The current version seems to be a workaround
from when settings could not provide a getter function and per-inferior
settings could thus not be implemented properly, forcing the `show`
implementation to recompute the value itself.

The changes clean up the code and makes the show command trust the
values it is being forwarded, as they will always be computed by the
getter function.

Co-Authored-By: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I3b25f61f9101d98a6df7d50cee50131aec7e25c9
Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/infcmd.c