2011-02-16 Tom Tromey <tromey@redhat.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.trace / packetlen.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/packetlen
32if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
33 executable {debug nowarnings}] != "" } {
34 untested packetlen.exp
35 return -1
c906108c 36}
f8b7eaf3 37gdb_load $binfile
de7ff789
MS
38gdb_test "tstop" ".*" ""
39gdb_test "tfind none" ".*" ""
f8b7eaf3 40runto_main
c906108c
SS
41gdb_reinitialize_dir $srcdir/$subdir
42
f3ce5b9c
UW
43# We generously give ourselves one "pass" if we successfully
44# detect that this test cannot be run on this target!
45if { ![gdb_target_supports_trace] } then {
46 pass "Current target does not support trace"
47 return 1;
48
49}
50
c906108c
SS
51# If testing on a remote host, download the source file.
52# remote_download host $srcdir/$subdir/$srcfile
53
54#
55# Test collecting a whole bunch of stuff at a single tracepoint.
56# The test is whether this crashes GDB.
57#
58
59gdb_delete_tracepoints
de7ff789 60gdb_test "trace gdb_c_test" ".*" ""
c906108c
SS
61gdb_trace_setactions "setup collect actions" \
62 "" \
63 "collect parm\[0\], parm\[1\], parm\[2\], parm\[3\]" "^$" \
64 "collect parm\[4\], parm\[5\], parm\[6\], parm\[7\]" "^$" \
65 "collect p, local_reg, local_static, local_static_sizeof" "^$" \
66 "collect local_long, stack_ptr, end_of_stack" "^$" \
67 "collect gdb_char_test, gdb_short_test, gdb_long_test" "^$" \
68 "collect gdb_arr_test, gdb_struct1_test, gdb_struct2_test" "^$" \
69 "collect gdb_structp_test, gdb_structpp_test, gdb_union1_test" "^$" \
70 "end" ""
71
e68d8fd4 72gdb_test_no_output "tstart" "survive the long packet send"
de7ff789 73gdb_test "break end" ".*" ""
f8b7eaf3
DJ
74gdb_test "continue" \
75 "Continuing.*Breakpoint $decimal, end.*" \
76 "run trace experiment"
c906108c 77
e68d8fd4 78gdb_test_no_output "tstop" "confirm: survived the long packet send"
c906108c 79
This page took 1.031192 seconds and 4 git commands to generate.