1 # Copyright 2013-2014 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 $testfile.exp $executable $srcfile \
28 fail "Can't run to main to check for trace support"
32 if ![gdb_target_supports_trace] {
33 unsupported "target does not support trace"
37 # Check that range stepping works well with tracepoints.
39 proc range_stepping_with_tracepoint { type } {
40 with_test_prefix "${type}" {
41 gdb_breakpoint [gdb_get_line_number "location 1"]
42 gdb_continue_to_breakpoint "location 1"
45 gdb_test "${type} *set_point" ".*"
46 gdb_test_no_output "tstart"
48 # Step a line with a tracepoint in the middle. The tracepoint
49 # itself shouldn't have any effect on range stepping. We
50 # should see one vCont;r and no vCont;s's.
51 exec_cmd_expect_vCont_count "step" 0 1
52 gdb_test_no_output "tstop"
53 gdb_test "tfind" "Found trace frame .*" "first tfind"
55 "Target failed to find requested trace frame.*" \
62 range_stepping_with_tracepoint "trace"
64 set libipa [get_in_proc_agent]
65 gdb_load_shlibs $libipa
67 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
68 executable [list debug nowarnings shlib=$libipa] ] != "" } {
69 untested "failed to compile ftrace tests"
73 clean_restart ${executable}
76 fail "Can't run to main for ftrace tests"
80 gdb_reinitialize_dir $srcdir/$subdir
81 if { [gdb_test "info sharedlibrary" ".*${libipa}.*" "IPA loaded"] != 0 } {
82 untested "Could not find IPA lib loaded"
84 range_stepping_with_tracepoint "ftrace"