From b551a5117c8781b0cb941d20bdfe731256fe2e67 Mon Sep 17 00:00:00 2001 From: brobecke Date: Mon, 31 Jan 2011 03:11:35 +0000 Subject: [PATCH] fix typo during interactive_mode check in gdb_has_a_terminal Discovered by Pierre Muller. gdb/ChangeLog: * inflow.c (gdb_has_a_terminal): Fix typo in interactive_mode value test. gdb/testsuite/ChangeLog: * 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. --- gdb/ChangeLog | 5 +++++ gdb/inflow.c | 2 +- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.base/interact.exp | 21 ++++++++++++++++++--- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 373ccfc094..9c18a83e74 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-01-31 Joel Brobecker + + * inflow.c (gdb_has_a_terminal): Fix typo in interactive_mode + value test. + 2011-01-31 Yao Qi * arm-linux-nat.c: Update calls to regcache_register_status diff --git a/gdb/inflow.c b/gdb/inflow.c index 859c74e027..9975904974 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -165,7 +165,7 @@ int gdb_has_a_terminal (void) { if (interactive_mode != AUTO_BOOLEAN_AUTO) - return interactive_mode = AUTO_BOOLEAN_TRUE; + return interactive_mode == AUTO_BOOLEAN_TRUE; switch (gdb_has_a_terminal_flag) { diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1b63bff51a..d05b6e6956 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2011-01-31 Joel Brobecker + + * 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 * gdb.cp/noparam.exp: New file. diff --git a/gdb/testsuite/gdb.base/interact.exp b/gdb/testsuite/gdb.base/interact.exp index 1f15fd862e..59caf1b815 100644 --- a/gdb/testsuite/gdb.base/interact.exp +++ b/gdb/testsuite/gdb.base/interact.exp @@ -28,21 +28,36 @@ set script_output "\\$\[0-9\]+ = 1\[\r\n\]+\\$\[0-9\]+ = 2.*" 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)" -- 2.11.0