]>
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/infotrace | |
32 | if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ | |
33 | executable {debug nowarnings}] != "" } { | |
34 | untested infotrace.exp | |
35 | return -1 | |
c906108c SS |
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" \ | |
1042e4c0 SS |
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\]+." \ | |
c906108c SS |
61 | "2.1: info tracepoints (all)" |
62 | ||
63 | # 2.2 info tracepoint (specific) | |
64 | gdb_test "info tracepoint $c_test_num" \ | |
1042e4c0 SS |
65 | "Num Type\[ \]+Disp Enb Address\[ \]+What.* |
66 | \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+." \ | |
c906108c SS |
67 | "2.2a: info tracepoint $c_test_num (gdb_c_test)" |
68 | ||
69 | gdb_test "info tracepoint $asm_test_num" \ | |
1042e4c0 SS |
70 | "Num Type\[ \]+Disp Enb Address\[ \]+What.* |
71 | \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+." \ | |
c906108c SS |
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]" \ | |
d77f58be | 76 | "No tracepoint number [expr $c_test_num + $asm_test_num]." \ |
c906108c SS |
77 | "2.3: info tracepoint (invalid tracepoint number)" |
78 | ||
79 | # 2.4 info tracepoints (list of numbers) | |
0ab48859 MS |
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 | } | |
c906108c | 88 | } |
c906108c SS |
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 |