1 # Copyright 2013-2024 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 load_lib "trace-support.exp"
17 load_lib "range-stepping-support.exp"
20 set executable $testfile
22 if [prepare_for_testing "failed to prepare" $executable $srcfile \
31 if ![gdb_target_supports_trace] {
32 unsupported "target does not support trace"
36 if ![gdb_range_stepping_enabled] {
37 unsupported "range stepping not supported by the target"
41 # Check that range stepping works well with tracepoints.
43 proc range_stepping_with_tracepoint { type } {
44 with_test_prefix "${type}" {
45 gdb_breakpoint [gdb_get_line_number "location 1"]
46 gdb_continue_to_breakpoint "location 1"
49 gdb_test "${type} *set_point" ".*"
50 gdb_test_no_output "tstart"
52 # Step a line with a tracepoint in the middle. The tracepoint
53 # itself shouldn't have any effect on range stepping. We
54 # should see one vCont;r.
55 exec_cmd_expect_vCont_count "step" 1
56 gdb_test_no_output "tstop"
57 gdb_test "tfind" "Found trace frame .*" "first tfind"
59 "Target failed to find requested trace frame.*" \
66 range_stepping_with_tracepoint "trace"
68 require allow_shlib_tests
70 require allow_in_proc_agent
71 set libipa [get_in_proc_agent]
72 set remote_libipa [gdb_load_shlib $libipa]
74 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
75 executable [list debug nowarnings shlib=$libipa] ] != "" } {
76 untested "failed to compile"
80 clean_restart ${executable}
86 gdb_reinitialize_dir $srcdir/$subdir
87 if { [gdb_test "info sharedlibrary" ".*${remote_libipa}.*" "IPA loaded"] != 0 } {
88 untested "could not find IPA lib loaded"
90 range_stepping_with_tracepoint "ftrace"