gdb/
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / stale-infcall.exp
CommitLineData
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
16set testfile stale-infcall
17set srcfile ${testfile}.c
18if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
19 return -1
20}
21
22if ![runto_main] {
23 return -1
24}
25
26gdb_breakpoint [gdb_get_line_number "break-run1"]
27gdb_breakpoint [gdb_get_line_number "break-run2"]
28gdb_breakpoint [gdb_get_line_number "break-exit"]
29gdb_breakpoint [gdb_get_line_number "break-fail"]
30
31gdb_continue_to_breakpoint "break-run1" ".* break-run1 .*"
32
33gdb_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
35set test "stack corrupted"
36gdb_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
45gdb_test "bt" "#0 \[^\r\n\]* main \[^\r\n\]*"
46
47# Verify there are no remains of the dummy frame.
48gdb_test_no_output "maintenance print dummy-frames"
49set test "maintenance info breakpoints"
50gdb_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}
This page took 0.030528 seconds and 4 git commands to generate.