8 set binfile $objdir/$subdir/interrupt
10 if ![file exists $binfile] then {
11 perror "$binfile does not exist."
14 gdb_reinitialize_dir $srcdir/$subdir
16 gdb_test "shell stty intr ^C" "" \
17 "set interrupt character in interrupt.exp"
18 if [runto main] then {
21 -re "\r\ntalk to me baby\r\n$" {}
22 timeout { fail "run (timeout)" }
23 eof { fail "run (eof)" }
25 # This should appear twice, once for the echo and once for the
26 # program's output. Under dejagnu (but not interactively) for
27 # SunOS4, it only appears once. Don't worry about it, I imagine
28 # dejagnu has just done something to the tty modes.
31 -re "^a\r\n(|a\r\n)$" {}
32 timeout { fail "echo a (timeout)" }
33 eof { fail "echo a (eof)" }
35 # Wait until the program is in the read system call again.
40 -re "Program received signal SIGINT.*$prompt $" {
43 -re ".*$prompt $" { fail "send control C" }
44 timeout { fail "send control C (timeout)" }
45 eof { fail "send control C (eof)" }
50 -re " = 4.*$prompt $" { pass "call function when asleep" }
51 -re "$prompt $" { fail "call function when asleep (wrong output)" }
54 # This fail probably happens whenever we use /proc (we
55 # don't use PRSABORT), but apparently also happens on
56 # other machines as well.
58 setup_xfail "sparc-*-solaris2*"
59 setup_xfail "mips-*-ultrix*"
60 setup_xfail "hppa*-*-*"
61 setup_xfail "i386*-*-bsd*"
62 setup_xfail "*-*-sysv4*"
64 setup_xfail "alpha-*-*"
65 setup_xfail "*-*-irix*"
66 fail "call function when asleep (stays asleep)"
67 # Send a newline to wake it up
69 gdb_test "" " = 4" "call function after waking it"
71 eof { fail "call function when asleep (eof)" }
74 # Now try calling the function again.
75 gdb_test "p func1 ()" " = 4" "call function a second time"
77 # And the program should still be doing the same thing.
78 # The optional trailing \r\n is in case we sent a newline above
79 # to wake the program, in which case the program now sends it
80 # back. We check for it either here or in the next expect
81 # command, because which one it ends up in is timing dependent.
83 # For some reason, i386-*-sysv4 gdb fails to issue the Continuing
84 # message, but otherwise appears normal (FIXME).
86 -re "^continue\r\nContinuing.\r\n(\r\n|)$" { pass "continue" }
87 -re "^continue\r\n\r\n" { fail "continue (missing Continuing.)" }
88 -re "$prompt $" { fail "continue" }
89 timeout { fail "continue" }
90 eof { fail "continue" }
94 # The optional leading \r\n is in case we sent a newline above
95 # to wake the program, in which case the program now sends it
98 -re "^(\r\n|)data\r\n(|data\r\n)$" { pass "echo data" }
99 timeout { fail "echo data (timeout)" }
100 eof { fail "echo data (eof)" }
105 -re "end of file.*Program exited normally.*$prompt $" {
106 pass "send end of file"
108 -re "$prompt $" { fail "send end of file" }
109 timeout { fail "send end of file (timeout)" }
110 eof { fail "send end of file (eof)" }