[PATCH 10/11] make use of finish to leave function in gdb.base/skip-inline.exp
Bruno Larsen
blarsen@redhat.com
Wed Jan 26 19:50:52 GMT 2022
This test, once again, uses a set number of steps to exit a function
when it could just use finish. Once we are inside baz, we dont need
to use "step" to confirm where we are, so those tests were changed
to using finish instead. This also makes the first part of the test
run corectly when compiled using clang.
And because the second and third part of the test require a fixed amount
of steps, the test exits early if it detects that the compiler used was
clang.
---
gdb/testsuite/gdb.base/skip-inline.exp | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/gdb/testsuite/gdb.base/skip-inline.exp b/gdb/testsuite/gdb.base/skip-inline.exp
index f6e9926b66c..612210127cc 100644
--- a/gdb/testsuite/gdb.base/skip-inline.exp
+++ b/gdb/testsuite/gdb.base/skip-inline.exp
@@ -35,16 +35,20 @@ gdb_test "skip function foo" "Function foo will be skipped when stepping\."
gdb_test "bt" "\\s*\\#0\\s+main.*" "in the main"
gdb_test "step" ".*" "step into baz, since foo will be skipped"
gdb_test "bt" "\\s*\\#0\\s+baz.*" "in the baz, since foo was skipped"
-gdb_test "step" ".*" "step in the baz"
-gdb_test "bt" "\\s*\\#0\\s+baz.*" "still in the baz"
-gdb_test "step" ".*" "step back to main"
+gdb_test "finish" ".*" "finish baz"
gdb_test "bt" "\\s*\\#0\\s+main.*" "again in the main"
gdb_test "step" ".*" "step again into baz, since foo will be skipped"
gdb_test "bt" "\\s*\\#0\\s+baz.*" "again in the baz"
-gdb_test "step" ".*" "step in the baz, again"
-gdb_test "bt" "\\s*\\#0\\s+baz.*" "still in the baz, again"
-gdb_test "step" ".*" "step back to main, again"
-gdb_test "bt" "\\s*\\#0\\s+main.*" "again back to main"
+gdb_test "finish" ".*" "finish baz, again"
+gdb_test "bt" "\\s*\\#0.*main.*" "again back to main"
+
+# because clang doesn't add epilogue information, having a set number of
+# steps puts clang more and more out of sync with gcc. It is unlikely that
+# the effort of keeping both outputs will be useful.
+if {[test_compiler_info "clang-*"]} {
+ untested "Multiple steps are not supported with clang"
+ return
+}
if ![runto_main] {
return
--
2.31.1
More information about the Gdb-patches
mailing list