gdb/guile: use return values of add_setshow functions in add_setshow_generic
authorSimon Marchi <simon.marchi@polymtl.ca>
Sat, 26 Jun 2021 01:38:20 +0000 (21:38 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Sat, 26 Jun 2021 01:39:29 +0000 (21:39 -0400)
commit6a72dbb692efa28ac732e7a5584229dad3aeb317
tree934c53fb48cb32fc59c9c61a3c851e3a47848bd3
parent4c0ba02a749d84a7e569e010fca9f640c30d17df
gdb/guile: use return values of add_setshow functions in add_setshow_generic

Use the set_show_commands objects returned by the add_setshow functions
in add_setshow_generic.  This lets us avoid looking up the commands
after creating them, instead using the return objects directly.

Make add_setshow_generic return a set_show_commands object, which is a
bit nicer than returning both commands by parameter.

Finally, store using that object in param_smob.

Equivalent of 7bd22f56a3cf ("gdb/python: use return values of
add_setshow functions in add_setshow_generic"), but for guile.

gdb/ChangeLog:

* guile/scm-param.c (struct param_smob) <set_command,
show_command>: Remove.
<commands>: New.
(pascm_is_valid): Adjust.
(add_setshow_generic): Use return values of add_setshow
functions, return a set_show_commands.
(gdbscm_register_parameter_x): Adjust.

Change-Id: I18ed9e7dd5646529491c86749a5cb20763acd1f0
gdb/ChangeLog
gdb/guile/scm-param.c