]> Git Repo - binutils.git/blobdiff - gdb/testsuite/gdb.base/signals.exp
Major revision to testsuites for cross-testing and DOS testing support.
[binutils.git] / gdb / testsuite / gdb.base / signals.exp
index 28977c7cf032a30cec94915292110abdd73f06a8..cb3094f1673ef25a23727e15f1d26bf8c6a9bb60 100644 (file)
@@ -13,19 +13,16 @@ set bug_id 0
 set testfile signals
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
-if  { [compile "${srcdir}/${subdir}/${srcfile} -g -o ${binfile}"] != "" } {
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     perror "Couldn't compile ${srcfile}"
     return -1
 }
 
 # Create and source the file that provides information about the compiler
 # used to compile the test case.
-execute_anywhere "rm -f ${binfile}.ci"
-if  { [compile "-E ${srcdir}/${subdir}/compiler.c > ${binfile}.ci"] != "" } {
-    perror "Couldn't make ${binfile}.ci file"
-    return -1
+if [get_compiler_info ${binfile}] {
+    return -1;
 }
-source ${binfile}.ci
 
 proc signal_tests_1 {} {
     global prompt
@@ -37,7 +34,7 @@ proc signal_tests_1 {} {
        gdb_test "next" "\\+\\+count; /\\* first \\*/" \
                "next over alarm (1)"
        # An alarm has been signaled, give the signal time to get delivered.
-       exec sleep 2
+       sleep 2
 
        # i386 BSD currently fails the next test with a SIGTRAP.
        setup_xfail "i*86-*-bsd*"
@@ -51,8 +48,8 @@ proc signal_tests_1 {} {
        # linux (aout versions) also fails with "next" acting like "continue"
        # this is probably more dependant on the kernel version than on the
        # object file format or utils.  (sigh)
-       setup_xfail "i*86-*-linuxaout" "i*86-*-linuxoldld"
-       send "next\n"
+       setup_xfail "i*86-pc-linuxaout-gnu" "i*86-pc-linuxoldld-gnu"
+       send_gdb "next\n"
        expect {
            -re "alarm .*$prompt $" { pass "next to 2nd alarm (1)" }
            -re "Program received signal SIGTRAP.*first.*$prompt $" {
@@ -127,11 +124,11 @@ proc signal_tests_1 {} {
        gdb_test "next" "\\+\\+count; /\\* second \\*/" \
            "next to 2nd ++count in signals_tests_1"
        # An alarm has been signaled, give the signal time to get delivered.
-       exec sleep 2
+       sleep 2
 
        set bash_bug 0
-       send "next\n"
-       setup_xfail "i*86-*-linux"
+       send_gdb "next\n"
+       setup_xfail "i*86-pc-linux-gnu"
        expect {
            -re "Breakpoint.*handler.*$prompt $" {
                pass "next to handler in signals_tests_1"
@@ -151,7 +148,7 @@ proc signal_tests_1 {} {
        # This doesn't test that main is frame #2, just that main is frame
        # #2, #3, or higher.  At some point this should be fixed (but
        # it quite possibly would introduce new FAILs on some systems).
-       setup_xfail "i*86-*-linux" "i*86-*-bsdi2.0"
+       setup_xfail "i*86-pc-linux-gnu" "i*86-*-bsdi2.0"
        gdb_test "backtrace" "#0.*handler.*#1.*#2.*main.*" \
            "backtrace in signals_tests_1"
 
@@ -162,8 +159,8 @@ proc signal_tests_1 {} {
        # a SIGTRAP, but with different symptoms.
        setup_xfail "vax-*-ultrix*"
        setup_xfail "i*86-*-bsd*"
-       setup_xfail "i*86-*-linux"
-       send "continue\n"
+       setup_xfail "i*86-pc-linux-gnu"
+       send_gdb "continue\n"
        expect {
            -re "Breakpoint.*func1.*$prompt $" { pass "continue to func1" }
            -re "Program received signal SIGTRAP.*second.*$prompt $" {
@@ -193,8 +190,7 @@ proc signal_tests_1 {} {
        }
 
        setup_xfail "*-*-irix*"
-       setup_xfail "i*86-*-linux"
-       send "signal SIGUSR1\n"
+       send_gdb "signal SIGUSR1\n"
        expect {
            -re "Breakpoint.*handler.*$prompt $" { pass "signal SIGUSR1" }
            -re "Program received signal SIGUSR1.*$prompt $" {
@@ -219,7 +215,7 @@ proc signal_tests_1 {} {
        # anytime soon.
 
        setup_xfail "*-*-*"
-       send "continue\n"
+       send_gdb "continue\n"
        expect {
            -re "Breakpoint.*func2.*$prompt $" { pass "continue to func2" }
            -re "Breakpoint.*func1.*$prompt $" {
@@ -231,7 +227,7 @@ proc signal_tests_1 {} {
            default { fail "continue to func2" }
        }
 
-       exec sleep 2
+       sleep 2
 
         # GDB yanks out the breakpoints to step over the breakpoint it
         # stopped at, which means the breakpoint at handler is yanked.
@@ -249,7 +245,7 @@ proc signal_tests_1 {} {
            setup_xfail "m68*-*-sunos4*"
        }
 
-       setup_xfail "i*86-*-linux"
+       setup_xfail "i*86-pc-linux-gnu"
        gdb_test "continue" "Breakpoint.*handler.*" "continue to handler"
 
        # If the NO_SINGLE_STEP failure happened, we have already exited.
@@ -305,10 +301,10 @@ proc test_handle_all_print {} {
     # Increase timeout and expect input buffer for large output from gdb.
     # Allow blank or TAB as whitespace characters.
     set oldtimeout $timeout
-    set timeout [expr "$timeout + 60"]
+    set timeout [expr "$timeout + 360"]
     verbose "Timeout is now $timeout seconds" 2
-    match_max 8000
-    gdb_test "handle all print" "Signal\[      \]+Stop\[       \]+Print\[      \]+Pass to program\[    \]+Description\r\nSIGHUP\[      \]+Yes\[        \]+Yes\[        \]+Yes\[        \]+Hangup.*SIG63\[      \]+Yes\[        \]+Yes\[        \]+Yes\[        \]+Real-time event 63"
+    match_max 10000
+    gdb_test "handle all print" "Signal\[      \]+Stop\[       \]+Print\[      \]+Pass to program\[    \]+Description\r\nSIGHUP\[      \]+Yes\[        \]+Yes\[        \]+Yes\[        \]+Hangup.*SIG63\[      \]+Yes\[        \]+Yes\[        \]+Yes\[        \]+Real-time event 63.*EXC_BREAKPOINT\[         \]+Yes\[        \]+Yes\[        \]+Yes\[        \]+Breakpoint"
     set timeout $oldtimeout
     verbose "Timeout restored to $timeout seconds" 2
 }
@@ -322,7 +318,7 @@ signal_tests_1
 
 # Force a resync, so we're looking at the right prompt.  On SCO we
 # were getting out of sync (I don't understand why).
-send "p 1+1\n"
+send_gdb "p 1+1\n"
 expect {
     -re "= 2.*$prompt $" {}
     -re ".*$prompt $" { perror "sync trouble in signals.exp" }
@@ -339,7 +335,7 @@ if [runto_main] then {
     gdb_test "next" "\\+\\+count; /\\* first \\*/" \
        "next to ++count #1 in signals.exp"
     # Give the signal time to get delivered
-    exec sleep 2
+    sleep 2
 
     # Now call a function.  When GDB tries to run the stack dummy,
     # it will hit the breakpoint at handler.  Provided it doesn't
@@ -361,7 +357,7 @@ if [runto_main] then {
     gdb_test "next" "alarm \\(.*" "next to alarm #2 in signals.exp"
     gdb_test "next" "\\+\\+count; /\\* second \\*/" \
        "next to ++count #2 in signals.exp"
-    exec sleep 2
+    sleep 2
 
     # This time we stop when GDB tries to run the stack dummy.
     # So it is OK that we do not print the return value from the function.
This page took 0.033487 seconds and 4 git commands to generate.