1 # Copyright (C) 2012-2019 Free Software Foundation, Inc.
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.
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.
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/>.
18 if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
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}
31 set test "test system longjmp tracking support"
32 gdb_test_multiple "next" $test {
33 -re " test-pass .*\r\n$gdb_prompt $" {
36 -re "( test-fail .*|\r\nCannot insert breakpoint 0\\.\r\n.*)\r\n$gdb_prompt $" {
38 untested "system lacks support for tracking longjmps"
42 gdb_test_no_output {delete $test_fail_bpnum}
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"]
49 gdb_continue_to_breakpoint "break-run1" ".* break-run1 .*"
51 gdb_test "print infcall ()" " break-run2 .*The program being debugged stopped while in a function called from GDB\\..*When the function is done executing, GDB will silently stop\\."
53 set test "stack corrupted"
54 gdb_test_multiple "continue" $test {
55 -re " break-exit .*\r\n$gdb_prompt $" {
58 -re " break-fail .*\r\n$gdb_prompt $" {
63 gdb_test "bt" "#0 \[^\r\n\]* main \[^\r\n\]*"
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 $" {
72 -re "\r\n$gdb_prompt $" {