1 # This testcase is part of GDB, the GNU debugger.
3 # Copyright 2013-2023 Free Software Foundation, Inc.
5 # Contributed by Intel Corp. <markus.t.metzger@intel.com>
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 # Test that we can reverse-next over the dynamic linker's symbol
24 require allow_btrace_tests
27 if [prepare_for_testing "failed to prepare" $testfile $srcfile \
28 {debug ldflags=-Wl,-z,lazy}] {
36 # trace the code for the call to test
37 gdb_test_no_output "record btrace"
38 gdb_test "next" ".*main\.2.*"
40 # just dump the function-call-history to help debugging
41 gdb_test_no_output "set record function-call-history-size 0"
42 gdb_test "record function-call-history /cli 1" ".*"
44 # check that we can reverse-next and next
45 with_test_prefix "main" {
46 gdb_test "reverse-next" ".*main\.1.*"
47 gdb_test "next" ".*main\.2.*"
50 # now go into test and try to (reverse-)next over the library call
52 # reverse-stepping through the epilogue is not very reliable; depending on
53 # debug information we may stop at the closing brace or at the return.
55 # instead, run to test
56 gdb_breakpoint test {temporary}
57 gdb_test "reverse-continue" ".*test\.1.*"
59 with_test_prefix "test" {
60 gdb_test "next" ".*test\.2.*"
61 gdb_test "reverse-next" ".*test\.1.*"