+2011-01-31 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.base/interact.exp: Add extra tests that verify that
+ the value of the interactive-mode setting does not change
+ after the script is sourced.
+
2011-01-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.cp/noparam.exp: New file.
gdb_exit
gdb_start
-# Test sourcing of the script with interactive mode `auto'
+# Test sourcing of the script with interactive mode `auto'.
+# Verify that evaluating the script does not cause an unexpected
+# change of the interactive-mode setting.
gdb_test_no_output "set interactive-mode auto"
gdb_test "source zzz-gdbscript" "$script_output" \
"source script with interactive-mode auto"
gdb_test "print 3" "= 3" "sanity check with interactive-mode auto"
+gdb_test "show interactive-mode" \
+ "Debugger's interactive mode is auto \\(currently .*\\)\\." \
+ "show interactive-mode (auto)"
-# Test sourcing of the script with interactive mode `on'
+# Test sourcing of the script with interactive mode `on'.
+# Verify that evaluating the script does not cause an unexpected
+# change of the interactive-mode setting.
gdb_test_no_output "set interactive-mode on"
gdb_test "source zzz-gdbscript" "$script_output" \
"source script with interactive-mode on"
gdb_test "print 4" "= 4" "sanity check with interactive-mode on"
+gdb_test "show interactive-mode" \
+ "Debugger's interactive mode is on\\." \
+ "show interactive-mode (on)"
-# Test sourcing of the script with interactive mode `of'
+# Test sourcing of the script with interactive mode `off'.
+# Verify that evaluating the script does not cause an unexpected
+# change of the interactive-mode setting.
gdb_test_no_output "set interactive-mode off"
gdb_test "source zzz-gdbscript" "$script_output" \
"source script with interactive-mode off"
gdb_test "print 5" "= 5" "sanity check with interactive-mode off"
+gdb_test "show interactive-mode" \
+ "Debugger's interactive mode is off\\." \
+ "show interactive-mode (off)"