1 # Copyright
1998 Free Software Foundation
, Inc.
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
5 # the Free Software Foundation
; either version
2 of the License
, or
6 #
(at your option
) any later version.
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.
13 # You should have received a copy of the GNU General Public License
14 # along with this
program; if not
, write to the Free Software
15 # Foundation
, Inc.
, 59 Temple Place
- Suite
330, Boston
, MA
02111-1307, USA.
17 # Please email
any bugs
, comments
, and
/or additions to this file to
:
18 # bug
-gdb@prep.ai.mit.edu
20 # This file was written by Michael Snyder
(msnyder@cygnus.com
)
22 load_lib
"trace-support.exp"
34 if [istarget
"m68k-*-elf"] then {
35 load_lib
"emc-support.exp"
36 set testfile
"gdb_c_test"
37 set srcfile $testfile.c
38 set binfile
[board_info target d490_binfile
];
39 gdb_test
"set remotetimeout 6" "" ""
41 gdb_target_monitor
"$binfile"
42 # Give a TSTOP and ignore errors
, to make sure
any previous
trace is
off
43 gdb_test
"tstop" "" ""
44 gdb_test
"tfind none" "" ""
45 send_gdb
"compare-section CS\n"
47 -re
"MIS-MATCHED.*$gdb_prompt $" {
48 gdb_suppress_entire_file
"Symbol file does not match target!
49 all tests in this module will fail.
";
51 -re
".*$gdb_prompt $" { }
54 set testfile
"actions"
55 set srcfile $testfile.c
56 set binfile $objdir
/$subdir
/$testfile
57 if { [gdb_compile
"$srcdir/$subdir/$srcfile" $binfile \
58 executable
{debug nowarnings
}] != "" } {
59 gdb_suppress_entire_file
"Testcase compile failed, so all tests in this file will automatically fail."
62 gdb_test
"tstop" "" ""
63 gdb_test
"tfind none" "" ""
66 gdb_reinitialize_dir $srcdir
/$subdir
68 # We generously give ourselves one
"pass" if we successfully
69 # detect that this test cannot be run
on this target
!
70 if { ![gdb_target_supports_trace
] } then {
71 pass
"Current target does not supporst trace"
76 #
If testing
on a remote host
, download the source file.
77 # remote_download host $srcdir
/$subdir
/$srcfile
80 # test
while-stepping dynamically
(live target
)
83 ## verify number of
trace frames collected matches stepcount
85 gdb_delete_tracepoints
86 gdb_test
"trace gdb_c_test" \
87 "Tracepoint $decimal at .*" \
88 "Set tracepoint at gdb_c_test"
90 gdb_trace_setactions
"5.12: define while-stepping <stepcount>" \
93 "while-stepping 5" "^$" \
98 gdb_test
"tstart" "" ""
100 if [istarget
"m68k-*-elf"] then {
101 gdb_emclaptop_command
"85,1,2,3,4,5,6"
104 gdb_test
"break end" "" ""
105 gdb_test
"continue" \
106 "Continuing.*Breakpoint $decimal, end.*" \
107 "run trace experiment"
110 gdb_test
"tstop" "" ""
112 gdb_tfind_test
"5.12: frame 5 should be the last one collected" "5" "5"
116 -re
"failed to find.*$gdb_prompt $" {
117 pass
"5.12: trace stopped after 5 stepping frames"
119 -re
".*$gdb_prompt $" {
120 fail
"5.12: trace stopped after 5 stepping frames"
124 gdb_test
"tfind none" "" ""