Remove checking vCont;s in exec_cmd_expect_vCont_count
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.trace / deltrace.exp
CommitLineData
32d0add0 1# Copyright 1998-2015 Free Software Foundation, Inc.
c906108c
SS
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
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
c906108c 6# (at your option) any later version.
e22f8b7c 7#
c906108c
SS
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.
e22f8b7c 12#
c906108c 13# You should have received a copy of the GNU General Public License
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c 15
c906108c
SS
16# This file was written by Michael Snyder (msnyder@cygnus.com)
17
4ec70201 18load_lib "trace-support.exp"
c906108c 19
c906108c
SS
20
21gdb_exit
22gdb_start
23
497a5eb0 24standard_testfile actions.c
f8b7eaf3
DJ
25if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
26 executable {debug nowarnings}] != "" } {
27 untested deltrace.exp
28 return -1
c906108c
SS
29}
30gdb_reinitialize_dir $srcdir/$subdir
31
32# If testing on a remote host, download the source file.
33# remote_download host $srcdir/$subdir/$srcfile
34
35gdb_file_cmd $binfile
36
37# define relative source line numbers:
38# all subsequent line numbers are relative to this first one (baseline)
4ec70201 39set baseline [gdb_find_recursion_test_baseline $srcfile]
c906108c
SS
40if { $baseline == -1 } then {
41 fail "Could not find gdb_recursion_test function"
4ec70201 42 return
c906108c
SS
43}
44set testline1 [expr $baseline + 4]
45
46#
47# test "delete tracepoints" command
48#
49
50# 3.1 delete tracepoints (all)
51gdb_delete_tracepoints
52gdb_test "trace gdb_c_test" "Tracepoint \[0-9\]+ at .*" "set tracepoint 1"
53gdb_test "trace gdb_asm_test" "Tracepoint \[0-9\]+ at .*" "set tracepoint 2"
54gdb_test "trace $testline1" "Tracepoint \[0-9\]+ at .*" "set tracepoint 3"
55
56gdb_test "info tracepoints" \
1042e4c0
SS
57 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
58\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
f2a8bc8a 59\[\t \]+not installed on target.
1042e4c0 60\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
f2a8bc8a
YQ
61\[\t \]+not installed on target.
62\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
63\[\t \]+not installed on target." \
c906108c
SS
64 "3.1a: set three tracepoints"
65
0ab48859
MS
66gdb_test "delete tracepoints" \
67 "" \
68 "3.1b: delete all tracepoints" \
69 "Delete all tracepoints.*y or n.*$" \
70 "y"
71
c906108c
SS
72
73# 3.2 delete tracepoint <n>
74gdb_delete_tracepoints
4ec70201
PA
75set trcpt1 [gdb_gettpnum gdb_c_test]
76set trcpt2 [gdb_gettpnum gdb_asm_test]
77set trcpt3 [gdb_gettpnum $testline1]
c906108c
SS
78if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
79 fail "setting tracepoints"
4ec70201 80 return
c906108c
SS
81}
82
83gdb_test "info tracepoints" \
1042e4c0
SS
84 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
85\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
f2a8bc8a 86\[\t \]+not installed on target.
1042e4c0 87\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
f2a8bc8a
YQ
88\[\t \]+not installed on target.
89\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
90\[\t \]+not installed on target." \
c906108c
SS
91 "3.2a: set three tracepoints"
92
35ec993f 93#gdb_test_no_output "delete tracepoint $trcpt1" ""
0ab48859 94gdb_test_multiple "delete tracepoint $trcpt1" "3.2b: delete first tracepoint" {
c906108c
SS
95 -re "No tracepoint number.*$gdb_prompt $" {
96 fail "3.2b: delete first tracepoint"
97 }
98 -re ".*\[Ee\]rror.*$gdb_prompt $" {
99 fail "3.2b: delete first tracepoint"
100 }
101 -re "$gdb_prompt $" {
102 pass "3.2b: delete first tracepoint"
103 }
c906108c
SS
104}
105
1042e4c0
SS
106gdb_test "info tracepoints" \
107 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
108\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
f2a8bc8a
YQ
109\[\t \]+not installed on target.
110\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
111\[\t \]+not installed on target." \
1042e4c0 112 "3.2c: verify delete first tracepoint"
c906108c 113
35ec993f 114#gdb_test_no_output "delete tracepoint $trcpt2" ""
0ab48859 115gdb_test_multiple "delete tracepoint $trcpt2" "3.2d: delete second tracepoint" {
c906108c
SS
116 -re "No tracepoint number.*$gdb_prompt $" {
117 fail "3.2d: delete second tracepoint"
118 }
119 -re ".*\[Ee\]rror.*$gdb_prompt $" {
120 fail "3.2d: delete second tracepoint"
121 }
122 -re "$gdb_prompt $" {
123 pass "3.2d: delete second tracepoint"
124 }
c906108c
SS
125}
126
1042e4c0
SS
127gdb_test "info tracepoints" \
128 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
f2a8bc8a
YQ
129\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
130\[\t \]+not installed on target." \
1042e4c0 131 "3.2e: verify delete second tracepoint"
c906108c 132
35ec993f 133#gdb_test_no_output "delete tracepoint $trcpt3" ""
0ab48859 134gdb_test_multiple "delete tracepoint $trcpt3" "3.2f: delete third tracepoint" {
c906108c
SS
135 -re "No tracepoint number.*$gdb_prompt $" {
136 fail "3.2f: delete third tracepoint"
137 }
138 -re ".*\[Ee\]rror.*$gdb_prompt $" {
139 fail "3.2f: delete third tracepoint"
140 }
141 -re "$gdb_prompt $" {
142 pass "3.2f: delete third tracepoint"
143 }
c906108c
SS
144}
145
146# send_gdb "ARF! \\n\n"
1042e4c0
SS
147gdb_test "info tracepoints" \
148 "No tracepoints." \
149 "3.2g: verify delete third tracepoint"
c906108c
SS
150
151# 3.3 delete three tracepoints at once
152gdb_delete_tracepoints
4ec70201
PA
153set trcpt1 [gdb_gettpnum gdb_c_test]
154set trcpt2 [gdb_gettpnum gdb_asm_test]
155set trcpt3 [gdb_gettpnum $testline1]
c906108c
SS
156if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
157 fail "setting tracepoints"
4ec70201 158 return
c906108c
SS
159}
160
161gdb_test "info tracepoints" \
1042e4c0
SS
162 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
163\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
f2a8bc8a 164\[\t \]+not installed on target.
1042e4c0 165\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
f2a8bc8a
YQ
166\[\t \]+not installed on target.
167\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
168\[\t \]+not installed on target." \
c906108c
SS
169 "3.3a: set three tracepoints"
170
35ec993f 171#gdb_test_no_output "delete tracepoint $trcpt1 $trcpt2 $trcpt3" ""
0ab48859
MS
172gdb_test_multiple "delete tracepoint $trcpt1 $trcpt2 $trcpt3" \
173 "3.3b: delete three tracepoints" {
174 -re "No tracepoint number.*$gdb_prompt $" {
175 fail "3.3b: delete three tracepoints"
176 }
177 -re ".*\[Ee\]rror.*$gdb_prompt $" {
178 fail "3.3b: delete three tracepoints"
179 }
180 -re "$gdb_prompt $" {
181 pass "3.3b: delete three tracepoints"
182 }
c906108c 183 }
c906108c 184
1042e4c0
SS
185gdb_test "info tracepoints" \
186 "No tracepoints." \
187 "3.3c: verify delete three tracepoints"
c906108c
SS
188
189# 3.4 delete invalid tracepoint number
190gdb_test "delete tracepoint [expr $trcpt2 + $trcpt3]" \
1042e4c0 191 "No breakpoint number [expr $trcpt2 + $trcpt3]." \
c906108c
SS
192 "3.4: delete invalid tracepoint number"
193
194# 3.5 delete tracepoint number zero
1042e4c0 195gdb_test "delete tracepoint 0" "bad breakpoint number at or near '0'" \
c906108c
SS
196 "3.5: delete tracepoint number zero"
197
198# 3.6 help delete tracepoints
199gdb_test "help delete tracepoints" \
200 "Delete specified tracepoints.*" \
201 "3.6: help delete tracepoints"
This page took 1.513722 seconds and 4 git commands to generate.