Fix defaults of some "maint test-settings" subcommands
authorPedro Alves <palves@redhat.com>
Wed, 3 Jul 2019 12:34:17 +0000 (13:34 +0100)
committerPedro Alves <palves@redhat.com>
Wed, 3 Jul 2019 12:34:17 +0000 (13:34 +0100)
commit970f9d091dae835304d1a96805bdb5c081a40b48
tree7727811aaf25fcbbc4c33afefbe9000a7841e229
parentf3869b1a41a809f208b964ee00cea74bd905b75f
Fix defaults of some "maint test-settings" subcommands

New tests added later for the incoming "with" command exposed a couple
invalid-default-value bugs in the "maint test-settings" commands:

- var_filename commands don't allow setting the filename to the empty
  string (unlike var_optional_filename commands), yet, "maint
  test-settings filename"'s control variable was not initialized, so
  on startup, "maint test-settings show filename" shows an empty
  string.

- "maint test-settings enum"'s control variable was not initialized,
  so on startup, "maint test-settings show enum" shows an empty value
  instead of a valid enum value.

Both issues are fixed by initializing the control variables.

gdb/ChangeLog:
2019-07-03  Pedro Alves  <palves@redhat.com>

* maint-test-settings.c (maintenance_test_settings_xxx)
(maintenance_test_settings_yyy, maintenance_test_settings_zzz):
New.
(maintenance_test_settings_enums): Use them.
(maintenance_test_settings_enum): Default to
maintenance_test_settings_xxx.
(_initialize_maint_test_settings): Initialize
MAINTENANCE_TEST_SETTINGS_FILENAME.

gdb/testsuite/ChangeLog:
2019-07-03  Pedro Alves  <palves@redhat.com>

* gdb.base/settings.exp (test-string): Adjust expected out when
testing "maint test-settings show filename"
gdb/ChangeLog
gdb/maint-test-settings.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/settings.exp