]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.opt/inline-bt.exp
Fix more cases of improper test names
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.opt / inline-bt.exp
CommitLineData
618f726f 1# Copyright 2008-2016 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
efc9d70a 16standard_testfile .c inline-markers.c
edb3359d 17
5b362f04 18if {[prepare_for_testing "failed to prepare" $testfile \
efc9d70a 19 [list $srcfile $srcfile2] \
1f960ced 20 {debug additional_flags=-Winline}]} {
edb3359d
DJ
21 return -1
22}
23
edb3359d
DJ
24runto_main
25
4c93b1db 26get_compiler_info
edb3359d
DJ
27get_debug_format
28if { [skip_inline_frame_tests] } {
5b362f04 29 untested "skipping inline frame tests"
edb3359d
DJ
30 return
31}
32
33set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}]
34gdb_breakpoint $srcfile2:$line1
35
36gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)"
37gdb_test "backtrace" "#0 bar.*#1 .*main.*" "backtrace from bar (1)"
38gdb_test "info frame" ".*called by frame.*" "bar not inlined"
39
40gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (2)"
41gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*main.*" \
42 "backtrace from bar (2)"
43gdb_test "up" "#1 .*func1.*" "up from bar (2)"
44gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)"
45
46gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (3)"
47gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*func2.*#3 .*main.*" \
48 "backtrace from bar (3)"
49gdb_test "up" "#1 .*func1.*" "up from bar (3)"
50gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (3)"
51gdb_test "up" "#2 .*func2.*" "up from func1 (3)"
52gdb_test "info frame" ".*inlined into frame.*" "func2 inlined (3)"
51d48146
PA
53
54# A regression test for having a backtrace limit that forces unwinding
55# to stop after an inline frame. GDB needs to compute the frame_id of
56# the inline frame, which requires unwinding past all the inline
57# frames to the real stack frame, even if that means bypassing the
58# user visible backtrace limit. See PR backtrace/15558.
59#
60# Set a backtrace limit that forces an unwind stop after an inline
61# function.
62gdb_test_no_output "set backtrace limit 2"
63# Force flushing the frame cache.
64gdb_test "flushregs" "Register cache flushed."
65gdb_test "up" "#1 .*func1.*" "up from bar (4)"
66gdb_test "info frame" ".*in func1.*" "info frame still works"
67# Verify the user visible limit works as expected.
68gdb_test "up" "Initial frame selected; you cannot go up." "up hits limit"