Update copyright year range in all GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.btrace / cpu.exp
1 # This testcase is part of GDB, the GNU debugger.
2 #
3 # Copyright 2018-2019 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 gdb_start
19
20 proc test_good { arg } {
21 gdb_test_no_output "set record btrace cpu $arg" "set cpu $arg"
22 gdb_test "show record btrace cpu" "btrace cpu is '$arg'\." \
23 "show cpu $arg"
24 }
25
26 proc test_bad { arg current } {
27 gdb_test "set record btrace cpu $arg" \
28 "Bad format\. See \"help set record btrace cpu\"\." \
29 "set cpu $arg"
30 gdb_test "show record btrace cpu" "btrace cpu is '$current'\." \
31 "show cpu $arg"
32 }
33
34 proc test_junk { arg junk current } {
35 gdb_test "set record btrace cpu $arg" \
36 "Trailing junk: '$junk'\." \
37 "set cpu $arg"
38 gdb_test "show record btrace cpu" "btrace cpu is '$current'\." \
39 "show cpu $arg"
40 }
41
42 gdb_test "show record btrace cpu" "btrace cpu is 'auto'\." "default cpu"
43
44 gdb_test "set record" \
45 "\"set record\" must be followed by an appropriate subcommand.*" \
46 "set record"
47 gdb_test "set record btrace" \
48 "\"set record btrace\" must be followed by an appropriate subcommand.*" \
49 "set record btrace"
50 test_bad "" "auto"
51
52 test_good "intel: 0/0"
53 test_good "intel: 0/0/1"
54
55 # We omit a zero stepping in the output.
56 gdb_test_no_output "set record btrace cpu intel: 0/0/0" \
57 "set cpu intel: 0/0/0"
58 gdb_test "show record btrace cpu" "btrace cpu is 'intel: 0/0'\." \
59 "show cpu intel: 0/0/0"
60
61 test_good "auto"
62 test_good "none"
63
64 test_bad "intel: foo" "none"
65 test_bad "intel: 0" "none"
66 test_bad "intel: 0/" "none"
67 test_bad "intel: 0/foo" "none"
68 test_bad "intel: foo/bar" "none"
69 test_bad "intel: foo/0" "none"
70 test_bad "intel: 0x0/0" "none"
71
72 test_junk "intel: 0/0 foo" " foo" "none"
73 test_junk "intel: 0/0x0" "x0" "none"
74 test_junk "intel: 0/0/foo" "/foo" "none"
75 test_junk "intel: 0/0/0 foo" " foo" "none"
76 test_junk "intel: 0/0/0x0" "x0" "none"
This page took 0.030905 seconds and 4 git commands to generate.