Commit | Line | Data |
---|---|---|
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 | ||
19 | load_lib "trace-support.exp" | |
20 | ||
21 | if $tracelevel then { | |
22 | strace $tracelevel | |
23 | } | |
24 | ||
c906108c SS |
25 | |
26 | gdb_exit | |
27 | gdb_start | |
28 | ||
f8b7eaf3 DJ |
29 | set testfile "actions" |
30 | set srcfile ${testfile}.c | |
31 | set binfile $objdir/$subdir/packetlen | |
32 | if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ | |
33 | executable {debug nowarnings}] != "" } { | |
34 | untested packetlen.exp | |
35 | return -1 | |
c906108c | 36 | } |
f8b7eaf3 | 37 | gdb_load $binfile |
de7ff789 MS |
38 | gdb_test "tstop" ".*" "" |
39 | gdb_test "tfind none" ".*" "" | |
f8b7eaf3 | 40 | runto_main |
c906108c SS |
41 | gdb_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! | |
45 | if { ![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 | ||
59 | gdb_delete_tracepoints | |
de7ff789 | 60 | gdb_test "trace gdb_c_test" ".*" "" |
c906108c SS |
61 | gdb_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 | 72 | gdb_test_no_output "tstart" "survive the long packet send" |
de7ff789 | 73 | gdb_test "break end" ".*" "" |
f8b7eaf3 DJ |
74 | gdb_test "continue" \ |
75 | "Continuing.*Breakpoint $decimal, end.*" \ | |
76 | "run trace experiment" | |
c906108c | 77 | |
e68d8fd4 | 78 | gdb_test_no_output "tstop" "confirm: survived the long packet send" |
c906108c | 79 |