Commit | Line | Data |
---|---|---|
52834460 MM |
1 | # This testcase is part of GDB, the GNU debugger. |
2 | # | |
88b9d363 | 3 | # Copyright 2013-2022 Free Software Foundation, Inc. |
52834460 MM |
4 | # |
5 | # Contributed by Intel Corp. <markus.t.metzger@intel.com> | |
6 | # | |
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. | |
11 | # | |
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. | |
16 | # | |
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/>. | |
19 | # | |
20 | # | |
21 | # Test that we can reverse-next over the dynamic linker's symbol | |
22 | # lookup code. | |
23 | ||
b5ac99b0 MM |
24 | if { [skip_btrace_tests] } { |
25 | unsupported "target does not support record-btrace" | |
26 | return -1 | |
27 | } | |
52834460 | 28 | |
52834460 | 29 | standard_testfile |
82333781 MM |
30 | if [prepare_for_testing "failed to prepare" $testfile $srcfile \ |
31 | {c++ debug ldflags=-Wl,-z,lazy}] { | |
52834460 MM |
32 | return -1 |
33 | } | |
b5ac99b0 | 34 | |
52834460 | 35 | if ![runto_main] { |
b5ac99b0 | 36 | untested "failed to run to main" |
52834460 MM |
37 | return -1 |
38 | } | |
39 | ||
40 | # trace the code for the call to test | |
41 | gdb_test_no_output "record btrace" | |
f0778fc1 | 42 | gdb_test "next" ".*main\.2.*" |
52834460 MM |
43 | |
44 | # just dump the function-call-history to help debugging | |
45 | gdb_test_no_output "set record function-call-history-size 0" | |
46 | gdb_test "record function-call-history /cli 1" ".*" | |
47 | ||
48 | # check that we can reverse-next and next | |
f0778fc1 MM |
49 | with_test_prefix "main" { |
50 | gdb_test "reverse-next" ".*main\.1.*" | |
51 | gdb_test "next" ".*main\.2.*" | |
52 | } | |
53 | ||
54 | # now go into test and try to (reverse-)next over the library call | |
55 | # | |
56 | # reverse-stepping through the epilogue is not very reliable; depending on | |
57 | # debug information we may stop at the closing brace or at the return. | |
58 | # | |
59 | # instead, run to test | |
60 | gdb_breakpoint test {temporary} | |
61 | gdb_test "reverse-continue" ".*test\.1.*" | |
62 | ||
63 | with_test_prefix "test" { | |
64 | gdb_test "next" ".*test\.2.*" | |
65 | gdb_test "reverse-next" ".*test\.1.*" | |
66 | } |