aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2023-04-28 22:14:53 +0100
committerAndrew Burgess <aburgess@redhat.com>2023-04-28 22:50:46 +0100
commit94e6c5641234c4ced9cb3fa0ccc2aaaa6b7b62ea (patch)
tree6d01ae3d20ba8fad600ec7174fd02474f70425e4 /gdb/testsuite
parentcc09d372f664410aea226bfaa246aeb74fee8126 (diff)
downloadgdb-94e6c5641234c4ced9cb3fa0ccc2aaaa6b7b62ea.zip
gdb-94e6c5641234c4ced9cb3fa0ccc2aaaa6b7b62ea.tar.gz
gdb-94e6c5641234c4ced9cb3fa0ccc2aaaa6b7b62ea.tar.bz2
gdb: make set/show cwd work with $_gdb_setting_str
The previous commit fixed set/show args when used with $_gdb_setting_str, this commit fixes set/show cwd. 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 the existing test to check the cwd setting.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/gdb.multi/gdb-settings.exp9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.multi/gdb-settings.exp b/gdb/testsuite/gdb.multi/gdb-settings.exp
index 407bc55..f8e9aaf 100644
--- a/gdb/testsuite/gdb.multi/gdb-settings.exp
+++ b/gdb/testsuite/gdb.multi/gdb-settings.exp
@@ -69,6 +69,7 @@ foreach_with_prefix inf $inferiors {
gdb_test "inferior ${inf}" "Switching to inferior ${inf}.*" \
"switch to inferior ${inf} before set"
gdb_test_no_output "set args inf${inf}-args"
+ gdb_test_no_output "set cwd /inf${inf}-cwd"
}
# Check settings are still correct for each inferior.
@@ -80,21 +81,29 @@ foreach_with_prefix inf $inferiors {
gdb_test "with args tmp-value -- print 1" " = 1"
gdb_test "show args" "inf${inf}-args.*"
+ gdb_test "with cwd tmp-value -- print 1" " = 1"
+ gdb_test "show cwd" "/inf${inf}-cwd.*"
+
# 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\""
}
# 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"
}
# Check the settings can be read from Guile.
if { $run_guile_tests } {
gdb_test "guile (print (parameter-value \"args\"))" \
"inf${inf}-args"
+ gdb_test "guile (print (parameter-value \"cwd\"))" \
+ "/inf${inf}-cwd"
}
}