diff options
author | Pedro Alves <palves@redhat.com> | 2019-07-03 13:34:17 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2019-07-03 13:34:17 +0100 |
commit | 970f9d091dae835304d1a96805bdb5c081a40b48 (patch) | |
tree | 7727811aaf25fcbbc4c33afefbe9000a7841e229 /gdb/testsuite | |
parent | f3869b1a41a809f208b964ee00cea74bd905b75f (diff) | |
download | gdb-970f9d091dae835304d1a96805bdb5c081a40b48.zip gdb-970f9d091dae835304d1a96805bdb5c081a40b48.tar.gz gdb-970f9d091dae835304d1a96805bdb5c081a40b48.tar.bz2 |
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"
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/settings.exp | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f38efbe..9129c11 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-07-03 Pedro Alves <palves@redhat.com> + + * gdb.base/settings.exp (test-string): Adjust expected out when + testing "maint test-settings show filename" + 2019-07-02 Pedro Alves <palves@redhat.com> * gdb.base/options.exp (test-info-threads): New procedure. diff --git a/gdb/testsuite/gdb.base/settings.exp b/gdb/testsuite/gdb.base/settings.exp index aeca67c..b691ad8 100644 --- a/gdb/testsuite/gdb.base/settings.exp +++ b/gdb/testsuite/gdb.base/settings.exp @@ -447,9 +447,12 @@ proc test-string {variant} { set set_cmd "maint test-settings set $variant" set show_cmd "maint test-settings show $variant" - # Empty string. Also checks that gdb doesn't crash if we haven't - # set the string yet. - gdb_test "$show_cmd" "^$show_cmd\r\n" "$show_cmd: empty first time" + # Checks that gdb doesn't crash if we haven't set the string yet. + if {$variant != "filename"} { + gdb_test "$show_cmd" "^$show_cmd\r\n" "$show_cmd: show default" + } else { + gdb_test "$show_cmd" "/foo/bar" "$show_cmd: show default" + } # A string value. gdb_test_no_output "$set_cmd hello world" |