Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / skip-inline.exp
CommitLineData
88b9d363 1# Copyright 2019-2022 Free Software Foundation, Inc.
45d73523
BE
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
16standard_testfile
17
18if { [prepare_for_testing "failed to prepare" "skip-inline" \
19 {skip-inline.c skip1.c } \
20 {debug nowarnings}] } {
21 return -1
22}
23
24set srcfile skip-inline.c
25set srcfile1 skip1.c
26
27if ![runto_main] {
28 fail "can't run to main"
29 return
30}
31
32# Create a skiplist entry for a specified file and function.
33
34gdb_test "skip function foo" "Function foo will be skipped when stepping\."
35
36gdb_test "bt" "\\s*\\#0\\s+main.*" "in the main"
37gdb_test "step" ".*" "step into baz, since foo will be skipped"
38gdb_test "bt" "\\s*\\#0\\s+baz.*" "in the baz, since foo was skipped"
39gdb_test "step" ".*" "step in the baz"
40gdb_test "bt" "\\s*\\#0\\s+baz.*" "still in the baz"
41gdb_test "step" ".*" "step back to main"
42gdb_test "bt" "\\s*\\#0\\s+main.*" "again in the main"
43gdb_test "step" ".*" "step again into baz, since foo will be skipped"
44gdb_test "bt" "\\s*\\#0\\s+baz.*" "again in the baz"
45gdb_test "step" ".*" "step in the baz, again"
46gdb_test "bt" "\\s*\\#0\\s+baz.*" "still in the baz, again"
47gdb_test "step" ".*" "step back to main, again"
48gdb_test "bt" "\\s*\\#0\\s+main.*" "again back to main"
49
50if ![runto_main] {
51 fail "can't run to main"
52 return
53}
54
55with_test_prefix "double step" {
56 gdb_test "bt" "\\s*\\#0\\s+main.*" "in the main"
57 gdb_test "step 2" ".*" "step into baz, since foo will be skipped"
58 gdb_test "bt" "\\s*\\#0\\s+baz.*" "still in the baz"
59 gdb_test "step" ".*" "step back to main"
60 gdb_test "bt" "\\s*\\#0\\s+main.*" "again in the main"
61 gdb_test "step 2" ".*" "step again into baz, since foo will be skipped"
62 gdb_test "bt" "\\s*\\#0\\s+baz.*" "again in the baz"
63 gdb_test "step" ".*" "step back to main, again"
64 gdb_test "bt" "\\s*\\#0\\s+main.*" "again back to main"
65}
66
67if ![runto_main] {
68 fail "can't run to main"
69 return
70}
71
72with_test_prefix "triple step" {
73 gdb_test "bt" "\\s*\\#0\\s+main.*" "in the main"
74 gdb_test "step 3" ".*" "step over baz"
75 gdb_test "bt" "\\s*\\#0\\s+main.*" "again in the main"
76 gdb_test "step 3" ".*" "step over baz, again"
77 gdb_test "bt" "\\s*\\#0\\s+main.*" "again back to main"
78}
717c684d
BE
79
80if ![runto_main] {
81 fail "can't run to main"
82 return
83}
84
85gdb_test "skip delete" ".*" "skip delete"
86
87with_test_prefix "skip current frame" {
88 gdb_test "bt" "\\s*\\#0\\s+main.*" "in the main"
89 gdb_test "step" ".*" "step into foo"
90 gdb_test "bt" "\\s*\\#0\\s+foo.*" "in the foo"
91 gdb_test "skip" "Function foo will be skipped when stepping\." "skip"
92}
This page took 0.288451 seconds and 4 git commands to generate.