]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.trace/while-dyn.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.trace / while-dyn.exp
1 # Copyright 1998-2024 Free Software Foundation, Inc.
2 #
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.
7 #
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.
12 #
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/>.
15
16 # This file was written by Michael Snyder (msnyder@cygnus.com)
17
18 load_lib "trace-support.exp"
19
20 standard_testfile actions.c
21 set executable $testfile
22 require gdb_trace_common_supports_arch
23 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
24 executable {debug nowarnings}] != "" } {
25 untested "failed to compile"
26 return -1
27 }
28
29 clean_restart $binfile
30 runto_main
31
32 if {![gdb_target_supports_trace]} {
33 unsupported "current target does not support trace"
34 return 1
35 }
36
37 #
38 # test while-stepping dynamically (live target)
39 #
40
41 proc test_while_stepping { while_stepping } {
42 global fpreg
43 global decimal
44 global gdb_prompt
45 global executable
46
47 with_test_prefix "$while_stepping" {
48 clean_restart $executable
49
50 runto_main
51
52 ## verify number of trace frames collected matches stepcount
53
54 gdb_delete_tracepoints
55 gdb_test "trace gdb_c_test" \
56 "Tracepoint $decimal at .*" \
57 "Set tracepoint at gdb_c_test"
58
59 gdb_trace_setactions "define $while_stepping <stepcount>" \
60 "" \
61 "collect \$$fpreg" "^$" \
62 "$while_stepping 5" "^$" \
63 "collect p" "^$" \
64 "end" "^$" \
65 "end" ""
66
67 gdb_test "tstart" ".*"
68
69 gdb_breakpoint "end" qualified
70 gdb_test "continue" \
71 "Continuing.*Breakpoint $decimal, end.*" \
72 "run trace experiment"
73
74 gdb_test "tstop" ".*"
75
76 gdb_tfind_test "frame 5 should be the last one collected" "5" "5"
77
78 gdb_test "tfind 6" "failed to find.*" \
79 "trace stopped after 5 stepping frames"
80
81 gdb_test "tfind none" ".*"
82 }
83 }
84
85 # Test all while-stepping aliases.
86
87 test_while_stepping "while-stepping"
88 test_while_stepping "stepping"
89 test_while_stepping "ws"