aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/setshow.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/setshow.exp')
-rw-r--r--gdb/testsuite/gdb.base/setshow.exp74
1 files changed, 71 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp
index d807d75..5316b48 100644
--- a/gdb/testsuite/gdb.base/setshow.exp
+++ b/gdb/testsuite/gdb.base/setshow.exp
@@ -84,6 +84,9 @@ gdb_test "show annotate" "Annotation_level is 0..*" "show annotate (0)"
#test annotation_level 0
gdb_test "info line 1" "Line 1 of .* is at address .* but contains no code.*" "annotation_level 0"
+gdb_test "show args" "Argument list to give program being debugged when it is started is \"\"\."
+gdb_test "p \$_gdb_setting_str(\"args\")" " = \"\""
+
gdb_test_no_output "set args ~"
gdb_test "show args" "Argument list to give program being debugged when it is started is \"~\"..*" \
"show args ~"
@@ -91,6 +94,9 @@ gdb_test "show args" "Argument list to give program being debugged when it is st
gdb_test_no_output "set args foo bar blup baz bubble" "set args"
#test show args
gdb_test "show args" "Argument list to give program being debugged when it is started is \"foo bar blup baz bubble\"..*" "show args"
+gdb_test "p \$_gdb_setting(\"args\")" " = \"foo bar blup baz bubble\"" \
+ "_gdb_setting args"
+
# Don't test if we can't pass args or if we're using a stub.
if { !$use_gdb_stub && ![target_info exists noargs] } {
@@ -100,32 +106,80 @@ if { !$use_gdb_stub && ![target_info exists noargs] } {
gdb_test "run" "Starting program:.*foo bar blup baz bubble.*" "passing args"
}
#test set check range on
-gdb_test "set check range on" ".*" "set check range on"
+# Note: the below might produce a warning, so match anything.
+gdb_test "set check range on" ""
+
+gdb_test "p \$_gdb_setting(\"check range\")" " = \"on\"" \
+ "_gdb_setting check range on"
#test show check range on
gdb_test "show check range" "Range checking is \"on\"\..*" "show check range (on)"
#test set check range off with trailing space
gdb_test_no_output "set check range off " "set check range off"
#test show check range off
gdb_test "show check range" "Range checking is \"off\"\..*" "show check range (off)"
+gdb_test "p \$_gdb_setting(\"check range\")" " = \"off\"" \
+ "_gdb_setting check range off"
#test set check range auto
gdb_test_no_output "set check range auto" "set check range auto"
#test show check range auto
gdb_test "show check range" "Range checking is \"auto; currently .*" "show check range (auto)"
+gdb_test "p \$_gdb_setting(\"check range\")" " = \"auto\"" \
+ "_gdb_setting check range auto"
# Test set check type on
-gdb_test "set check type on" ".*" "set check type on"
+gdb_test_no_output "set check type on"
# Test show check type on
gdb_test "show check type" "Strict type checking is on\..*" \
"show check type (on)"
+gdb_test "p \$_gdb_setting_str(\"check type\")" " = \"on\"" \
+ "_gdb_setting_str check type on"
+gdb_test "p \$_gdb_setting(\"check type\")" " = 1" \
+ "_gdb_setting check type on 1"
# Test set check type off with trailing space
gdb_test_no_output "set check type off " "set check type off"
+gdb_test "p \$_gdb_setting_str(\"check type\")" " = \"off\"" \
+ "_gdb_setting_str check type off"
+gdb_test "p \$_gdb_setting(\"check type\")" " = 0" \
+ "_gdb_setting check type off 0"
# Test show check type off
gdb_test "show check type" "Strict type checking is off\..*" \
"show check type (off)"
+#test set breakpoint pending
+
+#test set breakpoint pending on
+gdb_test_no_output "set breakpoint pending on"
+gdb_test "p \$_gdb_setting_str(\"breakpoint pending\")" " = \"on\"" \
+ "_gdb_setting_str breakpoint pending on"
+gdb_test "p \$_gdb_setting(\"breakpoint pending\")" " = 1" \
+ "_gdb_setting breakpoint pending 1"
+
+#test show breakpoint pending on
+gdb_test "show breakpoint pending" " is on\..*" "show breakpoint pending on"
+
+#test show breakpoint pending off
+gdb_test_no_output "set breakpoint pending off"
+gdb_test "show breakpoint pending" " is off\..*" "show breakpoint pending off"
+gdb_test "p \$_gdb_setting_str(\"breakpoint pending\")" " = \"off\"" \
+ "_gdb_setting_str breakpoint pending off"
+gdb_test "p \$_gdb_setting(\"breakpoint pending\")" " = 0" \
+ "_gdb_setting breakpoint pending 0"
+
+#test set breakpoint pending auto
+gdb_test_no_output "set breakpoint pending auto"
+
+#test show breakpoint pending auto
+gdb_test "show breakpoint pending" " is auto.*" "show breakpoint pending auto"
+gdb_test "p \$_gdb_setting_str(\"breakpoint pending\")" " = \"auto\"" \
+ "_gdb_setting_str breakpoint pending auto"
+gdb_test "p \$_gdb_setting(\"breakpoint pending\")" " = -1" \
+ "_gdb_setting breakpoint pending -1"
+
+
+
#test set complaints 100
gdb_test_no_output "set complaints 100" "set complaints 100"
#test show complaints 100
@@ -159,9 +213,17 @@ gdb_test "show environment FOOBARBAZ" "FOOBARBAZ = grbxgrbxgrbx.*" "show enviro
gdb_test_no_output "set height 100" "set height 100"
#test show height 100
gdb_test "show height" "Number of lines gdb thinks are in a page is 100..*" "show height"
+gdb_test "p \$_gdb_setting_str(\"height\")" " = \"100\"" \
+ "_gdb_setting_str height 100"
+gdb_test "p \$_gdb_setting(\"height\")" " = 100" \
+ "_gdb_setting height 100"
# Back to infinite height to avoid pagers. While at it, check that
# literal "unlimited" works just as well as 0.
gdb_test_no_output "set height unlimited"
+gdb_test "p \$_gdb_setting_str(\"height\")" " = \"unlimited\"" \
+ "_gdb_setting_str height unlimited"
+gdb_test "p \$_gdb_setting(\"height\")" " = 0" \
+ "_gdb_setting height unlimited"
#test set history expansion on
gdb_test_no_output "set history expansion on" "set history expansion on"
#test show history expansion on
@@ -182,6 +244,12 @@ gdb_test_no_output "set history filename ~/foobar.baz" \
gdb_test "show history filename" \
"The filename in which to record the command history is \"[string_to_regexp $HOME]/foobar.baz\"..*" \
"show history filename (~/foobar.baz)"
+gdb_test "p \$_gdb_setting(\"history filename\")" \
+ " = \"[string_to_regexp $HOME]/foobar.baz\"..*" \
+ "_gdb_setting history filename"
+gdb_test "p \$_gdb_setting_str(\"history filename\")" \
+ " = \"[string_to_regexp $HOME]/foobar.baz\"..*" \
+ "_gdb_setting_str history filename"
#get current working directory
set PWD ""
set test "show working directory"
@@ -209,7 +277,7 @@ gdb_test_no_output "set history size 100" "set history size 100"
#test show history size 100
gdb_test "show history size" "The size of the command history is 100..*" "show history size (100)"
#test set language asm
-gdb_test "set language asm" ".*" "set language asm"
+gdb_test_no_output "set language asm"
#test show language asm
gdb_test "show language" "The current source language is \"asm\"..*" "show language (asm)"
#test set language rust, with a trailing space