]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.opt/inline-bt.exp
Update years in copyright notice for the GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.opt / inline-bt.exp
1 # Copyright 2008-2013 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 standard_testfile .c inline-markers.c
17
18 if {[prepare_for_testing $testfile.exp $testfile \
19 [list $srcfile $srcfile2] \
20 {debug optimize=-O2 additional_flags=-Winline}]} {
21 return -1
22 }
23
24 runto_main
25
26 get_compiler_info
27 get_debug_format
28 if { [skip_inline_frame_tests] } {
29 untested inline-bt.exp
30 return
31 }
32
33 set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}]
34 gdb_breakpoint $srcfile2:$line1
35
36 gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)"
37 gdb_test "backtrace" "#0 bar.*#1 .*main.*" "backtrace from bar (1)"
38 gdb_test "info frame" ".*called by frame.*" "bar not inlined"
39
40 gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (2)"
41 gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*main.*" \
42 "backtrace from bar (2)"
43 gdb_test "up" "#1 .*func1.*" "up from bar (2)"
44 gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)"
45
46 gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (3)"
47 gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*func2.*#3 .*main.*" \
48 "backtrace from bar (3)"
49 gdb_test "up" "#1 .*func1.*" "up from bar (3)"
50 gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (3)"
51 gdb_test "up" "#2 .*func2.*" "up from func1 (3)"
52 gdb_test "info frame" ".*inlined into frame.*" "func2 inlined (3)"