Commit | Line | Data |
---|---|---|
e2e4d78b JK |
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 "break-run1"] | |
27 | gdb_breakpoint [gdb_get_line_number "break-run2"] | |
28 | gdb_breakpoint [gdb_get_line_number "break-exit"] | |
29 | gdb_breakpoint [gdb_get_line_number "break-fail"] | |
30 | ||
31 | gdb_continue_to_breakpoint "break-run1" ".* break-run1 .*" | |
32 | ||
33 | 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\\." | |
34 | ||
35 | set test "stack corrupted" | |
36 | gdb_test_multiple "continue" $test { | |
37 | -re " break-exit .*\r\n$gdb_prompt $" { | |
38 | pass $test | |
39 | } | |
40 | -re " break-fail .*\r\n$gdb_prompt $" { | |
41 | fail $test | |
42 | } | |
43 | } | |
44 | ||
45 | gdb_test "bt" "#0 \[^\r\n\]* main \[^\r\n\]*" | |
46 | ||
47 | # Verify there are no remains of the dummy frame. | |
48 | gdb_test_no_output "maintenance print dummy-frames" | |
49 | set test "maintenance info breakpoints" | |
50 | gdb_test_multiple $test $test { | |
51 | -re " call dummy .*\r\n$gdb_prompt $" { | |
52 | fail $test | |
53 | } | |
54 | -re "\r\n$gdb_prompt $" { | |
55 | pass $test | |
56 | } | |
57 | } |