2011-02-16 Tom Tromey <tromey@redhat.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.trace / infotrace.exp
1 # Copyright 1998, 2007, 2008, 2009, 2010, 2011
2 # Free Software Foundation, Inc.
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
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
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.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
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
25
26 gdb_exit
27 gdb_start
28
29 set testfile "actions"
30 set srcfile ${testfile}.c
31 set binfile $objdir/$subdir/infotrace
32 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
33 executable {debug nowarnings}] != "" } {
34 untested infotrace.exp
35 return -1
36 }
37 gdb_reinitialize_dir $srcdir/$subdir
38
39 # If testing on a remote host, download the source file.
40 # remote_download host $srcdir/$subdir/$srcfile
41
42 gdb_file_cmd $binfile
43
44 #
45 # test "info tracepoints" command
46 #
47
48 gdb_delete_tracepoints
49 set c_test_num [gdb_gettpnum gdb_c_test];
50 set asm_test_num [gdb_gettpnum gdb_asm_test];
51 if { $c_test_num <= 0 || $asm_test_num <= 0 } then {
52 fail "setting tracepoints"
53 return;
54 }
55
56 # 2.1 info tracepoints (all)
57 gdb_test "info tracepoints" \
58 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
59 \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
60 \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+." \
61 "2.1: info tracepoints (all)"
62
63 # 2.2 info tracepoint (specific)
64 gdb_test "info tracepoint $c_test_num" \
65 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
66 \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+." \
67 "2.2a: info tracepoint $c_test_num (gdb_c_test)"
68
69 gdb_test "info tracepoint $asm_test_num" \
70 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
71 \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+." \
72 "2.2b: info tracepoint $asm_test_num (gdb_asm_test)"
73
74 # 2.3 info tracepoint (invalid tracepoint number)
75 gdb_test "info tracepoint [expr $c_test_num + $asm_test_num]" \
76 "No tracepoint number [expr $c_test_num + $asm_test_num]." \
77 "2.3: info tracepoint (invalid tracepoint number)"
78
79 # 2.4 info tracepoints (list of numbers)
80 gdb_test_multiple "info tracepoints $c_test_num $asm_test_num " \
81 "2.4: info trace rejects multiple tracepoint numbers" {
82 -re "Num Enb .*$gdb_prompt $" {
83 fail "2.4: info trace rejects multiple tracepoint numbers"
84 }
85 -re ".*$gdb_prompt $" {
86 pass "2.4: info trace rejects multiple tracepoint numbers"
87 }
88 }
89
90 # 2.5 help info trace
91 gdb_test "help info tracepoints" \
92 "Status of tracepoints, or tracepoint number NUMBER.*" \
93 "2.5: help info tracepoints"
94
This page took 0.03069 seconds and 4 git commands to generate.