OLD | NEW |
1 # Copyright 2003, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 2003, 2007-2012 Free Software Foundation, Inc. |
2 | 2 |
3 # This program is free software; you can redistribute it and/or modify | 3 # This program is free software; you can redistribute it and/or modify |
4 # it under the terms of the GNU General Public License as published by | 4 # it under the terms of the GNU General Public License as published by |
5 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
6 # (at your option) any later version. | 6 # (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
14 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 # Test for PR gdb/1056. | 16 # Test for PR gdb/1056. |
17 # 2003-10-18 Michael Chastain <mec@shout.net> | 17 # 2003-10-18 Michael Chastain <mec@shout.net> |
18 | 18 |
19 if $tracelevel then { | |
20 strace $tracelevel | |
21 } | |
22 | |
23 # test SIGFPE (such as division by 0) inside gdb itself | 19 # test SIGFPE (such as division by 0) inside gdb itself |
24 | 20 |
25 | 21 |
26 gdb_start | 22 gdb_start |
27 | 23 |
28 # When SIGFPE happens, the operating system may restart the | 24 # When SIGFPE happens, the operating system may restart the |
29 # offending instruction after the signal handler returns, | 25 # offending instruction after the signal handler returns, |
30 # rather than proceeding to the next instruction. This happens | 26 # rather than proceeding to the next instruction. This happens |
31 # on i686-pc-linux-gnu with a linux kernel. If gdb has a naive | 27 # on i686-pc-linux-gnu with a linux kernel. If gdb has a naive |
32 # signal handler that just returns, then it will restart the | 28 # signal handler that just returns, then it will restart the |
33 # broken instruction and gdb gets an endless stream of SIGFPE's | 29 # broken instruction and gdb gets an endless stream of SIGFPE's |
34 # and makes no progress. | 30 # and makes no progress. |
35 # | 31 # |
36 # On a broken gdb this test will just time out. | 32 # On a broken gdb this test will just time out. |
37 | 33 |
38 gdb_test_multiple "print 1/0" "" { | 34 gdb_test_multiple "print 1/0" "" { |
39 -re ".*$gdb_prompt $" { | 35 -re ".*$gdb_prompt $" { |
40 pass "print 1/0" | 36 pass "print 1/0" |
41 } | 37 } |
42 timeout { | 38 timeout { |
43 kfail "gdb/1056" "print 1/0" | 39 kfail "gdb/1056" "print 1/0" |
44 } | 40 } |
45 } | 41 } |
46 gdb_test "print 1U/0" ".*Division by zero.*" "Test unsigned division by zero" | 42 gdb_test "print 1U/0" ".*Division by zero.*" "Test unsigned division by zero" |
47 | 43 |
OLD | NEW |