gdb/testsuite: fix gdb.trace/signal.exp on x86
[binutils-gdb/blckswan.git] / gdb / testsuite / gdb.base / skip-inline.exp
blobf6e9926b66cbfc594e25fe3c0b6edb00dac64cd4
1 # Copyright 2019-2022 Free Software Foundation, Inc.
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.
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.
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/>.
16 standard_testfile
18 if { [prepare_for_testing "failed to prepare" "skip-inline" \
19 {skip-inline.c skip1.c } \
20 {debug nowarnings}] } {
21 return -1
24 set srcfile skip-inline.c
25 set srcfile1 skip1.c
27 if ![runto_main] {
28 return
31 # Create a skiplist entry for a specified file and function.
33 gdb_test "skip function foo" "Function foo will be skipped when stepping\."
35 gdb_test "bt" "\\s*\\#0\\s+main.*" "in the main"
36 gdb_test "step" ".*" "step into baz, since foo will be skipped"
37 gdb_test "bt" "\\s*\\#0\\s+baz.*" "in the baz, since foo was skipped"
38 gdb_test "step" ".*" "step in the baz"
39 gdb_test "bt" "\\s*\\#0\\s+baz.*" "still in the baz"
40 gdb_test "step" ".*" "step back to main"
41 gdb_test "bt" "\\s*\\#0\\s+main.*" "again in the main"
42 gdb_test "step" ".*" "step again into baz, since foo will be skipped"
43 gdb_test "bt" "\\s*\\#0\\s+baz.*" "again in the baz"
44 gdb_test "step" ".*" "step in the baz, again"
45 gdb_test "bt" "\\s*\\#0\\s+baz.*" "still in the baz, again"
46 gdb_test "step" ".*" "step back to main, again"
47 gdb_test "bt" "\\s*\\#0\\s+main.*" "again back to main"
49 if ![runto_main] {
50 return
53 with_test_prefix "double step" {
54 gdb_test "bt" "\\s*\\#0\\s+main.*" "in the main"
55 gdb_test "step 2" ".*" "step into baz, since foo will be skipped"
56 gdb_test "bt" "\\s*\\#0\\s+baz.*" "still in the baz"
57 gdb_test "step" ".*" "step back to main"
58 gdb_test "bt" "\\s*\\#0\\s+main.*" "again in the main"
59 gdb_test "step 2" ".*" "step again into baz, since foo will be skipped"
60 gdb_test "bt" "\\s*\\#0\\s+baz.*" "again in the baz"
61 gdb_test "step" ".*" "step back to main, again"
62 gdb_test "bt" "\\s*\\#0\\s+main.*" "again back to main"
65 if ![runto_main] {
66 return
69 with_test_prefix "triple step" {
70 gdb_test "bt" "\\s*\\#0\\s+main.*" "in the main"
71 gdb_test "step 3" ".*" "step over baz"
72 gdb_test "bt" "\\s*\\#0\\s+main.*" "again in the main"
73 gdb_test "step 3" ".*" "step over baz, again"
74 gdb_test "bt" "\\s*\\#0\\s+main.*" "again back to main"
77 if ![runto_main] {
78 return
81 gdb_test "skip delete" ".*" "skip delete"
83 with_test_prefix "skip current frame" {
84 gdb_test "bt" "\\s*\\#0\\s+main.*" "in the main"
85 gdb_test "step" ".*" "step into foo"
86 gdb_test "bt" "\\s*\\#0\\s+foo.*" "in the foo"
87 gdb_test "skip" "Function foo will be skipped when stepping\." "skip"