xref: /netbsd-src/external/gpl3/gdb/dist/gdb/testsuite/gdb.arch/arm-disassembler-options.exp (revision 95bd78b9f7fbf16eda985c92964bed563b3500a2)
1# Copyright 2014-2024 Free Software Foundation, Inc.
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
5# the Free Software Foundation; either version 3 of the License, or
6# (at your option) any later version.
7#
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.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16# This file is part of the gdb testsuite.
17
18# This test exercises set/show disassembler-options results are preserved
19# across multiple set architecture calls.
20
21require {istarget "arm*-*-*"}
22
23gdb_exit
24gdb_start
25
26set option "reg-names-gcc,force-thumb"
27set arch1 "armv2"
28set arch2 "armv5"
29
30gdb_test "set architecture $arch1" \
31	"The target architecture is set to \"$arch1\"\." \
32	"set architecture $arch1"
33
34gdb_test_no_output "set disassembler-options"
35gdb_test "show disassembler-options" \
36	"The current disassembler options are ''.*" \
37	"show NULL disassembler-options"
38
39gdb_test_no_output "set disassembler-options $option"
40gdb_test "show disassembler-options" \
41	"The current disassembler options are '$option'.*" \
42	"show disassembler-options $option"
43
44# Change architectures and verify the disassembler options have been preserved.
45
46gdb_test "set architecture $arch2" \
47	"The target architecture is set to \"$arch2\"\." \
48	"set architecture $arch2"
49
50gdb_test "show disassembler-options" \
51	"The current disassembler options are '$option'.*" \
52	"show disassembler-options $option, modified architecture"
53
54