send_gdb "\003"
+ set saw_signal 0
+ set order_ok 1
gdb_test_multiple "" $message {
- -re "\\\[New \[^\]\]*\\\]\r\n" {
- exp_continue
- }
- -re "\\\[\[^\]\]* exited\\\]\r\n" {
- exp_continue
- }
- -re " received signal SIGINT.*$gdb_prompt $" {
- pass "$message"
- }
- -re "$gdb_prompt $" {
- # Note that with this regex order, if GDB emits [New
- # Thread ...] output between "Thread NNN received signal"
- # and the prompt, the "received signal" regex won't match.
- # That's good, as if we see that happening, it's a
+ -re "\r\n\\\[New \[^\r\n\]*(?=\r\n)" {
+ # Note if GDB emits [New Thread ...] output between
+ # "Thread NNN received signal" and the prompt, it's a
# regression.
#
# GDB makes sure to notify about signal stops, end of
# foo () at foo.c:31
# 31 bar ();
#
- fail $message
+ if { $saw_signal } {
+ set order_ok 0
+ }
+ exp_continue
+ }
+ -re "\r\n\\\[\[^\r\n]* exited\\\](?=\r\n)" {
+ exp_continue
+ }
+ -re "\r\n\[^\r\n]* received signal SIGINT\[^\r\n\]*(?=\r\n)" {
+ set saw_signal 1
+ exp_continue
+ }
+ -re -wrap "" {
+ gdb_assert {$saw_signal && $order_ok} $gdb_test_name
}
}
}