OLD | NEW |
(Empty) | |
| 1 # Copyright (C) 2012 Free Software Foundation # Inc. |
| 2 # |
| 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 |
| 5 # the Free Software Foundation; either version 3 of the License, or |
| 6 # (at your option) any later version. |
| 7 # |
| 8 # This program is distributed in the hope that it will be useful, |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 # GNU General Public License for more details. |
| 12 # |
| 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/>. |
| 15 |
| 16 set testfile stale-infcall |
| 17 set srcfile ${testfile}.c |
| 18 if { [prepare_for_testing $testfile.exp $testfile $srcfile] } { |
| 19 return -1 |
| 20 } |
| 21 |
| 22 if ![runto_main] { |
| 23 return -1 |
| 24 } |
| 25 |
| 26 gdb_breakpoint [gdb_get_line_number "test-next"] temporary |
| 27 gdb_continue_to_breakpoint "test-next" ".* test-next .*" |
| 28 gdb_breakpoint [gdb_get_line_number "test-fail"] |
| 29 gdb_test_no_output {set $test_fail_bpnum=$bpnum} |
| 30 |
| 31 set test "test system longjmp tracking support" |
| 32 gdb_test_multiple "next" $test { |
| 33 -re " test-pass .*\r\n$gdb_prompt $" { |
| 34 pass $test |
| 35 } |
| 36 -re "( test-fail .*|\r\nCannot insert breakpoint 0\\.\r\n.*)\r\n$gdb_prompt
$" { |
| 37 xfail $test |
| 38 untested "System lacks support for tracking longjmps" |
| 39 return -1 |
| 40 } |
| 41 } |
| 42 gdb_test_no_output {delete $test_fail_bpnum} |
| 43 |
| 44 gdb_breakpoint [gdb_get_line_number "break-run1"] |
| 45 gdb_breakpoint [gdb_get_line_number "break-run2"] |
| 46 gdb_breakpoint [gdb_get_line_number "break-exit"] |
| 47 gdb_breakpoint [gdb_get_line_number "break-fail"] |
| 48 |
| 49 gdb_continue_to_breakpoint "break-run1" ".* break-run1 .*" |
| 50 |
| 51 gdb_test "print infcall ()" " break-run2 .*The program being debugged stopped wh
ile in a function called from GDB\\..*When the function is done executing, GDB w
ill silently stop\\." |
| 52 |
| 53 set test "stack corrupted" |
| 54 gdb_test_multiple "continue" $test { |
| 55 -re " break-exit .*\r\n$gdb_prompt $" { |
| 56 pass $test |
| 57 } |
| 58 -re " break-fail .*\r\n$gdb_prompt $" { |
| 59 fail $test |
| 60 } |
| 61 } |
| 62 |
| 63 gdb_test "bt" "#0 \[^\r\n\]* main \[^\r\n\]*" |
| 64 |
| 65 # Verify there are no remains of the dummy frame. |
| 66 gdb_test_no_output "maintenance print dummy-frames" |
| 67 set test "maintenance info breakpoints" |
| 68 gdb_test_multiple $test $test { |
| 69 -re " call dummy .*\r\n$gdb_prompt $" { |
| 70 fail $test |
| 71 } |
| 72 -re "\r\n$gdb_prompt $" { |
| 73 pass $test |
| 74 } |
| 75 } |
OLD | NEW |