* gas/config/tc-avr.c: Change ISA for devices with USB support to
[external/binutils.git] / gdb / testsuite / gdb.base / sigall.exp
index 43d9057..4bd0427 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright 1995, 1996, 1997, 1999, 2007 Free Software Foundation, Inc.
+#   Copyright 1995-2013 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -18,12 +18,6 @@ if [target_info exists gdb,nosignals] {
     continue
 }
 
-if $tracelevel then {
-       strace $tracelevel
-}
-
-set prms_id 0
-set bug_id 0
 
 gdb_exit
 gdb_start
@@ -37,10 +31,6 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
      return -1
 }
 
-# Make the first signal SIGABRT because it is always supported.
-set sig_supported 1
-set thissig "ABRT"
-
 proc test_one_sig {nextsig} {
     global sig_supported
     global gdb_prompt
@@ -55,22 +45,12 @@ proc test_one_sig {nextsig} {
     set need_another_continue 1
     set missed_handler 0
     if $this_sig_supported then {
-       send_gdb "continue\n"
        if { $thissig == "IO" } {
            setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
        }
-       gdb_expect {
-           -re "Continuing.*Program received signal SIG$thissig.*$gdb_prompt $" {
-               pass "get signal $thissig"
-           }
-           -re ".*$gdb_prompt $" {
-               fail "get signal $thissig"
-               set need_another_continue 0
-           }
-           default {
-               fail "get signal $thissig (eof or timeout)"
-           }
-       }
+       gdb_test "continue" \
+           "Continuing.*Program received signal SIG$thissig.*" \
+           "get signal $thissig"
     }
     if [ istarget "alpha-dec-osf3*" ] then {
        # OSF/1-3.x is unable to continue with a job control stop signal.
@@ -85,7 +65,6 @@ proc test_one_sig {nextsig} {
     }
 
     if $need_another_continue then {
-       send_gdb "continue\n"
        if { $thissig == "URG" } {
            setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
        }
@@ -93,7 +72,7 @@ proc test_one_sig {nextsig} {
        if { $thissig == "PRIO" } {
            setup_xfail "*-*-*lynx*"
        }
-       gdb_expect {
+       gdb_test_multiple "continue" "send signal $thissig" {
            -re "Breakpoint.*handle_$thissig.*$gdb_prompt $" {
                pass "send signal $thissig"
            }
@@ -105,18 +84,15 @@ proc test_one_sig {nextsig} {
     }
 
     if { $missed_handler == "0" } then {
-        send_gdb "signal 0\n"
-        gdb_expect {
-           -re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" {
+       gdb_test_multiple "signal 0" "advance to $nextsig" {
+           -re "Breakpoint.*gen_$nextsig.*\r\n\[0-9\]+\[ \t\]+kill \\(.*\r\n$gdb_prompt $" {
                pass "advance to $nextsig"
                set sig_supported 1
            }
-           -re "Breakpoint.*gen_$nextsig.*handle.*$gdb_prompt $" {
+           -re "Breakpoint.*gen_$nextsig.*\r\n\[0-9\]+\[ \t\]+handle_.*\r\n$gdb_prompt $" {
                pass "advance to $nextsig"
                set sig_supported 0
            }
-           -re ".*$gdb_prompt $" { fail "advance to $nextsig" }
-           default { fail "advance to $nextsig (eof or timeout)" }
         }
     }
     set thissig $nextsig
@@ -124,77 +100,91 @@ proc test_one_sig {nextsig} {
 
 gdb_load $binfile
 
+# The list of signals that the program generates, in the order they
+# are generated.
+set signals {
+    ABRT
+    HUP
+    QUIT
+    ILL
+    EMT
+    FPE
+    BUS
+    SEGV
+    SYS
+    PIPE
+    ALRM
+    URG
+    TSTP
+    CONT
+    CHLD
+    TTIN
+    TTOU
+    IO
+    XCPU
+    XFSZ
+    VTALRM
+    PROF
+    WINCH
+    LOST
+    USR1
+    USR2
+    PWR
+    POLL
+    WIND
+    PHONE
+    WAITING
+    LWP
+    DANGER
+    GRANT
+    RETRACT
+    MSG
+    SOUND
+    SAK
+    PRIO
+    33
+    34
+    35
+    36
+    37
+    38
+    39
+    40
+    41
+    42
+    43
+    44
+    45
+    46
+    47
+    48
+    49
+    50
+    51
+    52
+    53
+    54
+    55
+    56
+    57
+    58
+    59
+    60
+    61
+    62
+    63
+    TERM
+}
+
+# Make the first signal SIGABRT because it is always supported.
+set sig_supported 1
+set thissig "ABRT"
+
 runto gen_ABRT
-test_one_sig HUP
-test_one_sig QUIT
-test_one_sig ILL
-test_one_sig EMT
-test_one_sig FPE
-test_one_sig BUS
-test_one_sig SEGV
-test_one_sig SYS
-test_one_sig PIPE
-test_one_sig ALRM
-test_one_sig URG
-test_one_sig TSTP
-test_one_sig CONT
-test_one_sig CHLD
-test_one_sig TTIN
-test_one_sig TTOU
-test_one_sig IO
-test_one_sig XCPU
-test_one_sig XFSZ
-test_one_sig VTALRM
-test_one_sig PROF
-test_one_sig WINCH
-test_one_sig LOST
-test_one_sig USR1
-test_one_sig USR2
-test_one_sig PWR
-test_one_sig POLL
-test_one_sig WIND
-test_one_sig PHONE
-test_one_sig WAITING
-test_one_sig LWP
-test_one_sig DANGER
-test_one_sig GRANT
-test_one_sig RETRACT
-test_one_sig MSG
-test_one_sig SOUND
-test_one_sig SAK
-test_one_sig PRIO
-test_one_sig 33
-test_one_sig 34
-test_one_sig 35
-test_one_sig 36
-test_one_sig 37
-test_one_sig 38
-test_one_sig 39
-test_one_sig 40
-test_one_sig 41
-test_one_sig 42
-test_one_sig 43
-test_one_sig 44
-test_one_sig 45
-test_one_sig 46
-test_one_sig 47
-test_one_sig 48
-test_one_sig 49
-test_one_sig 50
-test_one_sig 51
-test_one_sig 52
-test_one_sig 53
-test_one_sig 54
-test_one_sig 55
-test_one_sig 56
-test_one_sig 57
-test_one_sig 58
-test_one_sig 59
-test_one_sig 60
-test_one_sig 61
-test_one_sig 62
-test_one_sig 63
-test_one_sig TERM
+
+foreach sig [lrange $signals 1 end] {
+    test_one_sig $sig
+}
 
 # The last signal (SIGTERM) gets handled slightly differently because
 # we are not setting up for another test.