Remove checking vCont;s in exec_cmd_expect_vCont_count
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.trace / status-stop.exp
CommitLineData
32d0add0 1# Copyright 2011-2015 Free Software Foundation, Inc.
4511b1ba
YQ
2# This program is free software; you can redistribute it and/or modify
3# it under the terms of the GNU General Public License as published by
4# the Free Software Foundation; either version 3 of the License, or
5# (at your option) any later version.
6#
7# This program is distributed in the hope that it will be useful,
8# but WITHOUT ANY WARRANTY; without even the implied warranty of
9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10# GNU General Public License for more details.
11#
12# You should have received a copy of the GNU General Public License
13# along with this program. If not, see <http://www.gnu.org/licenses/>.
14
4ec70201 15load_lib "trace-support.exp"
4511b1ba 16
497a5eb0 17standard_testfile
4511b1ba 18set executable $testfile
4511b1ba
YQ
19set expfile $testfile.exp
20
21
22if [prepare_for_testing $expfile $executable $srcfile \
23 {debug nowarnings}] {
24 untested "failed to prepare for trace tests"
25 return -1
26}
27
ff7d1690
YQ
28if ![runto_main] {
29 fail "Can't run to main to check for trace support"
30 return -1
31}
32
33if ![gdb_target_supports_trace] {
34 unsupported "target does not support trace"
4ec70201 35 return -1
ff7d1690
YQ
36}
37
4511b1ba
YQ
38# Verify that the sequence of commands "tstart tstop tstart" works well.
39
0a251e08
YQ
40proc test_tstart_tstop_tstart { } {
41 with_test_prefix "tstart_tstop_tstart" {
42 global executable
43 global hex
4511b1ba 44
0a251e08
YQ
45 # Start with a fresh gdb.
46 clean_restart ${executable}
47 if ![runto_main] {
48 fail "Can't run to main"
49 return -1
50 }
4511b1ba 51
0a251e08
YQ
52 gdb_test "trace func1" "Tracepoint \[0-9\] at $hex: file.*"
53 gdb_test_no_output "tstart"
4511b1ba 54
0a251e08
YQ
55 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*"
56 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
57 "continue to end"
4511b1ba 58
0a251e08 59 gdb_test_no_output "tstop"
4511b1ba 60
0a251e08 61 gdb_test_no_output "tstart"
4511b1ba 62 }
0a251e08 63}
4511b1ba 64
0a251e08 65# Verify the sequence of commands "tstart tstart" works well.
4511b1ba 66
0a251e08
YQ
67proc test_tstart_tstart { } {
68 with_test_prefix "tstart_tstart" {
69 global executable
70 global hex
4511b1ba 71
0a251e08
YQ
72 # Start with a fresh gdb.
73 clean_restart ${executable}
74 if ![runto_main] {
75 fail "Can't run to main"
76 return -1
77 }
4511b1ba 78
0a251e08
YQ
79 gdb_test "trace func1" "Tracepoint \[0-9\] at $hex: file.*"
80 gdb_test_no_output "tstart"
4511b1ba 81
1ebff1fd
HAQ
82 set test "tstart again"
83 gdb_test_multiple "tstart" $test {
84 -re "A trace is running already. Start a new run.*y or n.*" {
85 # Send 'y' and make sure that we don't get any error.
86 gdb_test_no_output "y" $test
87 }
88 }
4511b1ba 89 }
0a251e08 90}
4511b1ba 91
0a251e08 92# Verify that trace stops clearly when trace buffer is full.
4511b1ba 93
0a251e08
YQ
94proc test_buffer_full_tstart { } {
95 with_test_prefix "buffer_full_tstart" {
96 global executable
97 global hex
98
99 # Start with a fresh gdb.
100 clean_restart ${executable}
101 if ![runto_main] {
102 fail "Can't run to main"
103 return -1
104 }
105
106 gdb_test "trace func2" "Tracepoint \[0-9\] at $hex: file.*"
107 gdb_trace_setactions "collect buf: define actions" \
108 "" \
109 "collect buf" "^$"
110
111 gdb_test_no_output "tstart"
112 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*"
113 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end"
114
115 gdb_test "tstatus" ".*buffer was full.*"
116 gdb_test_no_output "tstart"
117 }
118}
4511b1ba
YQ
119
120test_tstart_tstop_tstart
121
122test_tstart_tstart
123
6a5870ce 124test_buffer_full_tstart
This page took 0.466179 seconds and 4 git commands to generate.