]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.opt/inline-bt.exp
* elfxx-tilegx.c (tilegx_elf_relocate_section): Silence bogus warning.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.opt / inline-bt.exp
CommitLineData
0b302171 1# Copyright 2008, 2010-2012 Free Software Foundation, Inc.
edb3359d
DJ
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 "inline-bt"
17set srcfile ${testfile}.c
18set srcfile2 "inline-markers.c"
19set fullsrcfile "${srcdir}/${subdir}/${srcfile}"
20set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}"
21set sources [list ${fullsrcfile} ${fullsrcfile2}]
22set binfile ${objdir}/${subdir}/${testfile}
23
24if { [gdb_compile ${sources} ${binfile} \
5283e9e1 25 executable {debug optimize=-O2 additional_flags=-Winline}] != "" } {
edb3359d
DJ
26 untested inline-bt.exp
27 return -1
28}
29
30gdb_exit
31gdb_start
32gdb_reinitialize_dir $srcdir/$subdir
33gdb_load ${binfile}
34
35runto_main
36
37get_compiler_info $binfile
38get_debug_format
39if { [skip_inline_frame_tests] } {
40 untested inline-bt.exp
41 return
42}
43
44set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}]
45gdb_breakpoint $srcfile2:$line1
46
47gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)"
48gdb_test "backtrace" "#0 bar.*#1 .*main.*" "backtrace from bar (1)"
49gdb_test "info frame" ".*called by frame.*" "bar not inlined"
50
51gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (2)"
52gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*main.*" \
53 "backtrace from bar (2)"
54gdb_test "up" "#1 .*func1.*" "up from bar (2)"
55gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)"
56
57gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (3)"
58gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*func2.*#3 .*main.*" \
59 "backtrace from bar (3)"
60gdb_test "up" "#1 .*func1.*" "up from bar (3)"
61gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (3)"
62gdb_test "up" "#2 .*func2.*" "up from func1 (3)"
63gdb_test "info frame" ".*inlined into frame.*" "func2 inlined (3)"