cpu.exp revision 1.1.1.2
1# This testcase is part of GDB, the GNU debugger. 2# 3# Copyright 2018-2020 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 18gdb_start 19 20proc 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 26proc 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 34proc 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 42gdb_test "show record btrace cpu" "btrace cpu is 'auto'\." "default cpu" 43 44gdb_test "set record" \ 45 "List of set record subcommands.*" 46gdb_test "set record btrace" \ 47 "List of set record btrace subcommands.*" 48test_bad "" "auto" 49 50test_good "intel: 0/0" 51test_good "intel: 0/0/1" 52 53# We omit a zero stepping in the output. 54gdb_test_no_output "set record btrace cpu intel: 0/0/0" \ 55 "set cpu intel: 0/0/0" 56gdb_test "show record btrace cpu" "btrace cpu is 'intel: 0/0'\." \ 57 "show cpu intel: 0/0/0" 58 59test_good "auto" 60test_good "none" 61 62test_bad "intel: foo" "none" 63test_bad "intel: 0" "none" 64test_bad "intel: 0/" "none" 65test_bad "intel: 0/foo" "none" 66test_bad "intel: foo/bar" "none" 67test_bad "intel: foo/0" "none" 68test_bad "intel: 0x0/0" "none" 69 70test_junk "intel: 0/0 foo" " foo" "none" 71test_junk "intel: 0/0x0" "x0" "none" 72test_junk "intel: 0/0/foo" "/foo" "none" 73test_junk "intel: 0/0/0 foo" " foo" "none" 74test_junk "intel: 0/0/0x0" "x0" "none" 75