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
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*"
# 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 $" {
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"
# 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"
# 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 $" {
}
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 $" {
# anytime soon.
setup_xfail "*-*-*"
- send "continue\n"
+ send_gdb "continue\n"
expect {
-re "Breakpoint.*func2.*$prompt $" { pass "continue to func2" }
-re "Breakpoint.*func1.*$prompt $" {
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.
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.
# 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
}
# 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" }
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
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.