run copyright.sh for 2011.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.trace / while-stepping.exp
CommitLineData
7b6bb8da
JB
1# Copyright 1998, 2007, 2008, 2009, 2010, 2011
2# Free Software Foundation, Inc.
c906108c
SS
3#
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
e22f8b7c 6# the Free Software Foundation; either version 3 of the License, or
c906108c 7# (at your option) any later version.
e22f8b7c 8#
c906108c
SS
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
e22f8b7c 13#
c906108c 14# You should have received a copy of the GNU General Public License
e22f8b7c 15# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c 16
c906108c
SS
17# This file was written by Michael Snyder (msnyder@cygnus.com)
18
19load_lib "trace-support.exp";
20
21if $tracelevel then {
22 strace $tracelevel
23}
24
c906108c
SS
25
26gdb_exit
27gdb_start
28
f8b7eaf3
DJ
29set testfile "actions"
30set srcfile ${testfile}.c
31set binfile ${objdir}/${subdir}/while-stepping
32if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \
33 executable {debug nowarnings}] != "" } {
34 untested while-stepping.exp
35 return -1
c906108c
SS
36}
37gdb_reinitialize_dir $srcdir/$subdir
38
39# If testing on a remote host, download the source file.
40# remote_download host $srcdir/$subdir/$srcfile
41
42gdb_file_cmd $binfile
43
44#
45# test while-stepping command
46#
47
48gdb_delete_tracepoints
49set trcpt1 [gdb_gettpnum gdb_c_test]
50if { $trcpt1 <= 0 } then {
51 fail "Could not find gdb_c_test function"
52 return;
53}
54
55# 5.12 basic while-stepping command (collect regs)
56
57gdb_test "info tracepoints" \
1042e4c0
SS
58 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
59\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+" \
c906108c
SS
60 "5.12: set a tracepoint, stepcount is zero"
61
62set stepcount 12
63
64gdb_trace_setactions "5.12: set stepcount to $stepcount" \
65 "" \
66 "while-stepping $stepcount" "" \
67 "collect \$regs" "^$" \
68 "end" ""
69
70gdb_test "info tracepoints" \
1042e4c0
SS
71 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
72\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
a7bdde9e 73\[\t \]+while-stepping 12.*" \
c906108c
SS
74 "5.12: info trace shows \"while-stepping\""
75
c906108c
SS
76# 5.13 step out of context while collecting local variable
77# [deferred to dynamic test section]
78
79proc while_stepping_bogus_arg { bogus msgstring } {
80 global gdb_prompt;
81
82 gdb_trace_setactions "$msgstring" \
83 "" \
fff87407 84 "while-stepping $bogus" ".*while-stepping step count"
c906108c
SS
85}
86
87# 5.14 while-stepping (no argument)
88
89while_stepping_bogus_arg "" "5.14: while-stepping null stepcount"
90
91# 5.15 while-stepping (zero stepcount)
92
93while_stepping_bogus_arg "0" "5.15: while-stepping rejects zero stepcount"
94
95# 5.16 while-stepping without collecting anything
96gdb_trace_setactions "5.16: step without collecting anything" \
97 "" \
98 "while-stepping $stepcount" "^$" \
99 "end" ""
100
101gdb_test "info tracepoints" \
1042e4c0
SS
102 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
103\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
104.*while-stepping $stepcount.*
1042e4c0 105.*end.*" \
c906108c
SS
106 "5.16: confirm actions, step without collecting anything"
107
This page took 1.102773 seconds and 4 git commands to generate.