aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.multi/gdb-settings.exp
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2023-04-04 12:11:50 +0100
committerAndrew Burgess <aburgess@redhat.com>2023-04-28 22:50:46 +0100
commit598e87ecc064cd8ffc2af4bcde4186d30382f4d5 (patch)
tree960c83a38af1b0921616e8df0f0e709c9dc9977c /gdb/testsuite/gdb.multi/gdb-settings.exp
parent94e6c5641234c4ced9cb3fa0ccc2aaaa6b7b62ea (diff)
downloadgdb-598e87ecc064cd8ffc2af4bcde4186d30382f4d5.zip
gdb-598e87ecc064cd8ffc2af4bcde4186d30382f4d5.tar.gz
gdb-598e87ecc064cd8ffc2af4bcde4186d30382f4d5.tar.bz2
gdb: make set/show inferior-tty work with $_gdb_setting_str
Like the previous two commits, this commit fixes set/show inferior-tty to work with $_gdb_setting_str. Instead of using a scratch variable which is then pushed into the current inferior from a set callback, move to the API that allows for getters and setters, and store the value directly within the current inferior. Update an existing test to check the inferior-tty setting. Reviewed-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/testsuite/gdb.multi/gdb-settings.exp')
-rw-r--r--gdb/testsuite/gdb.multi/gdb-settings.exp14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.multi/gdb-settings.exp b/gdb/testsuite/gdb.multi/gdb-settings.exp
index f8e9aaf..0ebd2bf 100644
--- a/gdb/testsuite/gdb.multi/gdb-settings.exp
+++ b/gdb/testsuite/gdb.multi/gdb-settings.exp
@@ -70,6 +70,7 @@ foreach_with_prefix inf $inferiors {
"switch to inferior ${inf} before set"
gdb_test_no_output "set args inf${inf}-args"
gdb_test_no_output "set cwd /inf${inf}-cwd"
+ gdb_test_no_output "set inferior-tty /inf${inf}-tty"
}
# Check settings are still correct for each inferior.
@@ -84,19 +85,30 @@ foreach_with_prefix inf $inferiors {
gdb_test "with cwd tmp-value -- print 1" " = 1"
gdb_test "show cwd" "/inf${inf}-cwd.*"
+ gdb_test "with inferior-tty tmp-value -- print 1" " = 1"
+ gdb_test "show inferior-tty" "/inf${inf}-tty.*"
+
# If the inferiors are running check $_gdb_setting_str and
# $_gdb_setting return the correct values.
if { $run } {
gdb_test {print $_gdb_setting_str("args")} "\"inf${inf}-args\""
gdb_test {print $_gdb_setting("args")} "\"inf${inf}-args\""
+
gdb_test {print $_gdb_setting_str("cwd")} "\"/inf${inf}-cwd\""
gdb_test {print $_gdb_setting("cwd")} "\"/inf${inf}-cwd\""
+
+ gdb_test {print $_gdb_setting_str("inferior-tty")} \
+ "\"/inf${inf}-tty\""
+ gdb_test {print $_gdb_setting("inferior-tty")} \
+ "\"/inf${inf}-tty\""
}
# Check the settings can be read from Python.
if { $run_python_tests } {
gdb_test "python print(gdb.parameter('args'))" "inf${inf}-args"
gdb_test "python print(gdb.parameter('cwd'))" "/inf${inf}-cwd"
+ gdb_test "python print(gdb.parameter('inferior-tty'))" \
+ "/inf${inf}-tty"
}
# Check the settings can be read from Guile.
@@ -105,5 +117,7 @@ foreach_with_prefix inf $inferiors {
"inf${inf}-args"
gdb_test "guile (print (parameter-value \"cwd\"))" \
"/inf${inf}-cwd"
+ gdb_test "guile (print (parameter-value \"inferior-tty\"))" \
+ "/inf${inf}-tty"
}
}