[gdbserver] Move malloc.h include to server.h.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.trace / infotrace.exp
CommitLineData
4c38e0a4 1# Copyright 1998, 2007, 2008, 2009, 2010 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
18load_lib "trace-support.exp";
19
20if $tracelevel then {
21 strace $tracelevel
22}
23
c906108c
SS
24
25gdb_exit
26gdb_start
27
f8b7eaf3
DJ
28set testfile "actions"
29set srcfile ${testfile}.c
30set binfile $objdir/$subdir/infotrace
31if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
32 executable {debug nowarnings}] != "" } {
33 untested infotrace.exp
34 return -1
c906108c
SS
35}
36gdb_reinitialize_dir $srcdir/$subdir
37
38# If testing on a remote host, download the source file.
39# remote_download host $srcdir/$subdir/$srcfile
40
41gdb_file_cmd $binfile
42
43#
44# test "info tracepoints" command
45#
46
47gdb_delete_tracepoints
48set c_test_num [gdb_gettpnum gdb_c_test];
49set asm_test_num [gdb_gettpnum gdb_asm_test];
50if { $c_test_num <= 0 || $asm_test_num <= 0 } then {
51 fail "setting tracepoints"
52 return;
53}
54
55# 2.1 info tracepoints (all)
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\]+.
59\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+." \
c906108c
SS
60 "2.1: info tracepoints (all)"
61
62# 2.2 info tracepoint (specific)
63gdb_test "info tracepoint $c_test_num" \
1042e4c0
SS
64 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
65\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+." \
c906108c
SS
66 "2.2a: info tracepoint $c_test_num (gdb_c_test)"
67
68gdb_test "info tracepoint $asm_test_num" \
1042e4c0
SS
69 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
70\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+." \
c906108c
SS
71 "2.2b: info tracepoint $asm_test_num (gdb_asm_test)"
72
73# 2.3 info tracepoint (invalid tracepoint number)
74gdb_test "info tracepoint [expr $c_test_num + $asm_test_num]" \
d77f58be 75 "No tracepoint number [expr $c_test_num + $asm_test_num]." \
c906108c
SS
76 "2.3: info tracepoint (invalid tracepoint number)"
77
78# 2.4 info tracepoints (list of numbers)
0ab48859
MS
79gdb_test_multiple "info tracepoints $c_test_num $asm_test_num " \
80 "2.4: info trace rejects multiple tracepoint numbers" {
81 -re "Num Enb .*$gdb_prompt $" {
82 fail "2.4: info trace rejects multiple tracepoint numbers"
83 }
84 -re ".*$gdb_prompt $" {
85 pass "2.4: info trace rejects multiple tracepoint numbers"
86 }
c906108c 87 }
c906108c
SS
88
89# 2.5 help info trace
90gdb_test "help info tracepoints" \
91 "Status of tracepoints, or tracepoint number NUMBER.*" \
92 "2.5: help info tracepoints"
93
This page took 0.971872 seconds and 4 git commands to generate.