From 87a3a92c46c770e6aa2ca1209f46af16eae2c4e9 Mon Sep 17 00:00:00 2001 From: Sandra Loosemore Date: Mon, 14 Dec 2015 15:02:59 -0800 Subject: [PATCH] Skip tests that send ctrl-c to GDB if nointerrupts target property is set. 2015-12-14 Sandra Loosemore gdb/testsuite/ * gdb.base/completion.exp: Skip tests that interrupt GDB with ctrl-C if nointerrupts target property is set. * gdb.base/double-prompt-target-event-error.exp: Likewise. * gdb.base/paginate-after-ctrl-c-running.exp: Likewise. * gdb.base/paginate-bg-execution.exp: Likewise. * gdb.base/paginate-execution-startup.exp: Likewise. * gdb.base/random-signal.exp: Likewise. * gdb.base/range-stepping.exp: Likewise. * gdb.cp/annota2.exp: Likewise. * gdb.cp/annota3.exp: Likewise. * gdb.gdb/selftest.exp: Likewise. * gdb.threads/continue-pending-status.exp: Likewise. * gdb.threads/leader-exit.exp: Likewise. * gdb.threads/manythreads.exp: Likewise. * gdb.threads/pthreads.exp: Likewise. * gdb.threads/schedlock.exp: Likewise. * gdb.threads/sigthread.exp: Likewise. --- gdb/testsuite/ChangeLog | 20 ++++++ gdb/testsuite/gdb.base/completion.exp | 4 +- .../double-prompt-target-event-error.exp | 5 ++ .../paginate-after-ctrl-c-running.exp | 5 ++ .../gdb.base/paginate-bg-execution.exp | 4 +- .../gdb.base/paginate-execution-startup.exp | 4 +- gdb/testsuite/gdb.base/random-signal.exp | 6 ++ gdb/testsuite/gdb.base/range-stepping.exp | 66 ++++++++++--------- gdb/testsuite/gdb.cp/annota2.exp | 12 ++-- gdb/testsuite/gdb.cp/annota3.exp | 12 ++-- gdb/testsuite/gdb.gdb/selftest.exp | 24 +++---- .../gdb.threads/continue-pending-status.exp | 5 ++ gdb/testsuite/gdb.threads/leader-exit.exp | 5 ++ gdb/testsuite/gdb.threads/manythreads.exp | 5 ++ gdb/testsuite/gdb.threads/pthreads.exp | 5 ++ gdb/testsuite/gdb.threads/schedlock.exp | 6 ++ gdb/testsuite/gdb.threads/sigthread.exp | 6 ++ 17 files changed, 137 insertions(+), 57 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f8e7084f66..9228e09f59 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,23 @@ +2015-12-14 Sandra Loosemore + + * gdb.base/completion.exp: Skip tests that interrupt GDB with + ctrl-C if nointerrupts target property is set. + * gdb.base/double-prompt-target-event-error.exp: Likewise. + * gdb.base/paginate-after-ctrl-c-running.exp: Likewise. + * gdb.base/paginate-bg-execution.exp: Likewise. + * gdb.base/paginate-execution-startup.exp: Likewise. + * gdb.base/random-signal.exp: Likewise. + * gdb.base/range-stepping.exp: Likewise. + * gdb.cp/annota2.exp: Likewise. + * gdb.cp/annota3.exp: Likewise. + * gdb.gdb/selftest.exp: Likewise. + * gdb.threads/continue-pending-status.exp: Likewise. + * gdb.threads/leader-exit.exp: Likewise. + * gdb.threads/manythreads.exp: Likewise. + * gdb.threads/pthreads.exp: Likewise. + * gdb.threads/schedlock.exp: Likewise. + * gdb.threads/sigthread.exp: Likewise. + 2015-12-11 Don Breazeal * gdb.base/execl-update-breakpoints.exp (main): Enable for target diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp index f0e4dec9b5..2aabab5dc6 100644 --- a/gdb/testsuite/gdb.base/completion.exp +++ b/gdb/testsuite/gdb.base/completion.exp @@ -944,7 +944,7 @@ gdb_test_multiple "" "$test" { gdb_test_no_output "set max-completions unlimited" -if {![skip_tui_tests]} { +if {![skip_tui_tests] && ![target_info exists gdb,nointerrupts]} { set test "test completion of layout names" send_gdb "layout\t\t\t" gdb_test_multiple "" "$test" { @@ -960,7 +960,7 @@ if {![skip_tui_tests]} { } } } -if {![skip_tui_tests]} { +if {![skip_tui_tests] && ![target_info exists gdb,nointerrupts]} { with_test_prefix "focus command" { set test "test completion" send_gdb "focus \t\t" diff --git a/gdb/testsuite/gdb.base/double-prompt-target-event-error.exp b/gdb/testsuite/gdb.base/double-prompt-target-event-error.exp index 6e5085fa61..b5ad7eb518 100644 --- a/gdb/testsuite/gdb.base/double-prompt-target-event-error.exp +++ b/gdb/testsuite/gdb.base/double-prompt-target-event-error.exp @@ -13,6 +13,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +if [target_info exists gdb,nointerrupts] { + verbose "Skipping double-prompt-target-event-error.exp because of nointerrupts." + return +} + standard_testfile if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug] == -1} { diff --git a/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp b/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp index d721990a44..aae31226b0 100644 --- a/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp +++ b/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp @@ -13,6 +13,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +if [target_info exists gdb,nointerrupts] { + verbose "Skipping paginate-after-ctrl-c-running.exp because of nointerrupts." + return +} + standard_testfile if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} { diff --git a/gdb/testsuite/gdb.base/paginate-bg-execution.exp b/gdb/testsuite/gdb.base/paginate-bg-execution.exp index f7437ac483..f2a4d73210 100644 --- a/gdb/testsuite/gdb.base/paginate-bg-execution.exp +++ b/gdb/testsuite/gdb.base/paginate-bg-execution.exp @@ -114,5 +114,7 @@ proc test_bg_execution_pagination_cancel { how } { } test_bg_execution_pagination_return -test_bg_execution_pagination_cancel "ctrl-c" +if ![target_info exists gdb,nointerrupts] { + test_bg_execution_pagination_cancel "ctrl-c" +} test_bg_execution_pagination_cancel "quit" diff --git a/gdb/testsuite/gdb.base/paginate-execution-startup.exp b/gdb/testsuite/gdb.base/paginate-execution-startup.exp index cdade32919..c5d8e23523 100644 --- a/gdb/testsuite/gdb.base/paginate-execution-startup.exp +++ b/gdb/testsuite/gdb.base/paginate-execution-startup.exp @@ -174,7 +174,9 @@ proc test_fg_execution_pagination_cancel { how } { if {[probe_can_run_cmdline] > 0} { test_fg_execution_pagination_return - test_fg_execution_pagination_cancel "ctrl-c" + if ![target_info exists gdb,nointerrupts] { + test_fg_execution_pagination_cancel "ctrl-c" + } test_fg_execution_pagination_cancel "quit" } diff --git a/gdb/testsuite/gdb.base/random-signal.exp b/gdb/testsuite/gdb.base/random-signal.exp index 566668a518..47c3549978 100644 --- a/gdb/testsuite/gdb.base/random-signal.exp +++ b/gdb/testsuite/gdb.base/random-signal.exp @@ -18,6 +18,12 @@ if [target_info exists gdb,nosignals] { continue } +# This test requires sending ^C to interrupt the running target. +if [target_info exists gdb,nointerrupts] { + verbose "Skipping random-signal.exp because of nointerrupts." + return +} + standard_testfile if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} { diff --git a/gdb/testsuite/gdb.base/range-stepping.exp b/gdb/testsuite/gdb.base/range-stepping.exp index 79667ba7b7..507d6cc8da 100644 --- a/gdb/testsuite/gdb.base/range-stepping.exp +++ b/gdb/testsuite/gdb.base/range-stepping.exp @@ -172,42 +172,44 @@ with_test_prefix "loop 2" { # Check that range stepping works well even when it is interrupted by # ctrl-c. -with_test_prefix "interrupt" { - gdb_test_no_output "set debug remote 1" - - send_gdb "next\n" - sleep 1 - send_gdb "\003" - - # GDB should send one vCont;r and receive one stop reply for - # SIGINT: - # --> vCont;rSTART,END (range step) - # <-- T02 (SIGINT) - - set vcont_r_counter 0 - - set test "send ctrl-c to GDB" - gdb_test_multiple "" $test { - -re "vCont;r\[^\r\n\]*\.\.\." { - incr vcont_r_counter - exp_continue +if ![target_info exists gdb,nointerrupts] { + with_test_prefix "interrupt" { + gdb_test_no_output "set debug remote 1" + + send_gdb "next\n" + sleep 1 + send_gdb "\003" + + # GDB should send one vCont;r and receive one stop reply for + # SIGINT: + # --> vCont;rSTART,END (range step) + # <-- T02 (SIGINT) + + set vcont_r_counter 0 + + set test "send ctrl-c to GDB" + gdb_test_multiple "" $test { + -re "vCont;r\[^\r\n\]*\.\.\." { + incr vcont_r_counter + exp_continue + } + -re "Program received signal SIGINT.*$gdb_prompt $" { + pass $test + } } - -re "Program received signal SIGINT.*$gdb_prompt $" { - pass $test + gdb_test_no_output "set debug remote 0" + + # Check the number of 'vCont;r' packets. + if { $vcont_r_counter == 1 } { + pass "${test}: 1 vCont;r" + } else { + fail "${test}: 1 vCont;r" } - } - gdb_test_no_output "set debug remote 0" - # Check the number of 'vCont;r' packets. - if { $vcont_r_counter == 1 } { - pass "${test}: 1 vCont;r" - } else { - fail "${test}: 1 vCont;r" + # Break the loop earlier and continue range stepping. + gdb_test "set variable c = 0" + exec_cmd_expect_vCont_count "next" 1 } - - # Break the loop earlier and continue range stepping. - gdb_test "set variable c = 0" - exec_cmd_expect_vCont_count "next" 1 } # Check that range stepping doesn't break software watchpoints. With diff --git a/gdb/testsuite/gdb.cp/annota2.exp b/gdb/testsuite/gdb.cp/annota2.exp index 52ef3c4374..953a724c5a 100644 --- a/gdb/testsuite/gdb.cp/annota2.exp +++ b/gdb/testsuite/gdb.cp/annota2.exp @@ -262,12 +262,14 @@ gdb_test_multiple "next" "watch triggered on a.x" { # test: # annotate-quit # -send_gdb "\003" -gdb_expect { - -re "\r\n\032\032error-begin\r\nQuit\r\n\r\n\032\032quit\r\n$gdb_prompt$" \ +if ![target_info exists gdb,nointerrupts] { + send_gdb "\003" + gdb_expect { + -re "\r\n\032\032error-begin\r\nQuit\r\n\r\n\032\032quit\r\n$gdb_prompt$" \ { pass "annotate-quit" } - -re ".*$gdb_prompt$" { fail "annotate-quit" } - timeout { fail "annotate-quit (timeout)" } + -re ".*$gdb_prompt$" { fail "annotate-quit" } + timeout { fail "annotate-quit (timeout)" } + } } # diff --git a/gdb/testsuite/gdb.cp/annota3.exp b/gdb/testsuite/gdb.cp/annota3.exp index e62bb2925a..055ed5c348 100644 --- a/gdb/testsuite/gdb.cp/annota3.exp +++ b/gdb/testsuite/gdb.cp/annota3.exp @@ -177,11 +177,13 @@ gdb_test_multiple "next" "watch triggered on a.x" { # test: # annotate-quit # -send_gdb "\003" -gdb_expect_list "annotate-quit" "$gdb_prompt$" { - "\r\n\032\032error-begin\r\n" - "Quit\r\n" - "\r\n\032\032quit\r\n" +if ![target_info exists gdb,nointerrupts] { + send_gdb "\003" + gdb_expect_list "annotate-quit" "$gdb_prompt$" { + "\r\n\032\032error-begin\r\n" + "Quit\r\n" + "\r\n\032\032quit\r\n" + } } # diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp index 8b1298f3c1..e8644fbfd1 100644 --- a/gdb/testsuite/gdb.gdb/selftest.exp +++ b/gdb/testsuite/gdb.gdb/selftest.exp @@ -433,17 +433,19 @@ proc test_with_self { executable } { } # kill the xgdb process - set description "send ^C to child process" - send_gdb "\003" - gdb_expect { - -re "Program received signal SIGINT.*$gdb_prompt $" { - pass "$description" - } - -re ".*$gdb_prompt $" { - fail "$description" - } - timeout { - fail "$description (timeout)" + if ![target_info exists gdb,nointerrupts] { + set description "send ^C to child process" + send_gdb "\003" + gdb_expect { + -re "Program received signal SIGINT.*$gdb_prompt $" { + pass "$description" + } + -re ".*$gdb_prompt $" { + fail "$description" + } + timeout { + fail "$description (timeout)" + } } } diff --git a/gdb/testsuite/gdb.threads/continue-pending-status.exp b/gdb/testsuite/gdb.threads/continue-pending-status.exp index 1f170f74ef..0833065007 100644 --- a/gdb/testsuite/gdb.threads/continue-pending-status.exp +++ b/gdb/testsuite/gdb.threads/continue-pending-status.exp @@ -17,6 +17,11 @@ # thread, then switching to a thread that has a status pending and # continuing. +if [target_info exists gdb,nointerrupts] { + verbose "Skipping continue-pending-status.exp because of nointerrupts." + return +} + standard_testfile if [prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] { diff --git a/gdb/testsuite/gdb.threads/leader-exit.exp b/gdb/testsuite/gdb.threads/leader-exit.exp index 01e3258022..7de91a981c 100644 --- a/gdb/testsuite/gdb.threads/leader-exit.exp +++ b/gdb/testsuite/gdb.threads/leader-exit.exp @@ -13,6 +13,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +if [target_info exists gdb,nointerrupts] { + verbose "Skipping leader-exit.exp because of nointerrupts." + return +} + # Exit of the thread group leader should not break GDB. standard_testfile diff --git a/gdb/testsuite/gdb.threads/manythreads.exp b/gdb/testsuite/gdb.threads/manythreads.exp index 2a55f868a0..b6a1c212d6 100644 --- a/gdb/testsuite/gdb.threads/manythreads.exp +++ b/gdb/testsuite/gdb.threads/manythreads.exp @@ -16,6 +16,11 @@ # This file was written by Jeff Johnston. (jjohnstn@redhat.com) +# This test requires sending ^C to interrupt the running target. +if [target_info exists gdb,nointerrupts] { + verbose "Skipping manythreads.exp because of nointerrupts." + return +} standard_testfile diff --git a/gdb/testsuite/gdb.threads/pthreads.exp b/gdb/testsuite/gdb.threads/pthreads.exp index 80cae2cbc2..b456641ef8 100644 --- a/gdb/testsuite/gdb.threads/pthreads.exp +++ b/gdb/testsuite/gdb.threads/pthreads.exp @@ -15,6 +15,11 @@ # This file was written by Fred Fish. (fnf@cygnus.com) +# This test requires sending ^C to interrupt the running target. +if [target_info exists gdb,nointerrupts] { + verbose "Skipping pthreads.exp because of nointerrupts." + return +} standard_testfile diff --git a/gdb/testsuite/gdb.threads/schedlock.exp b/gdb/testsuite/gdb.threads/schedlock.exp index 54e847efda..65b13ffd47 100644 --- a/gdb/testsuite/gdb.threads/schedlock.exp +++ b/gdb/testsuite/gdb.threads/schedlock.exp @@ -18,6 +18,12 @@ # # This test covers the various forms of "set scheduler-locking". +# This test requires sending ^C to interrupt the running target. + +if [target_info exists gdb,nointerrupts] { + verbose "Skipping schedlock.exp because of nointerrupts." + return +} standard_testfile diff --git a/gdb/testsuite/gdb.threads/sigthread.exp b/gdb/testsuite/gdb.threads/sigthread.exp index ea3a62dc37..cc1634ae95 100644 --- a/gdb/testsuite/gdb.threads/sigthread.exp +++ b/gdb/testsuite/gdb.threads/sigthread.exp @@ -37,6 +37,12 @@ gdb_test_multiple "continue" "continue" { } } +# This test requires sending ^C to interrupt the running target. +if [target_info exists gdb,nointerrupts] { + verbose "Skipping sigthread.exp because of nointerrupts." + return +} + # For this to work we must be sure to consume the "Continuing." # message first, or GDB's signal handler may not be in place. after 500 {send_gdb "\003"} -- 2.34.1