1 # Copyright 2017-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 require allow_xml_test 17 18 gdb_start 19 20 # Test whether it is OK to have `arc:HS` in the target description 21 # architecture. `HS` is a valid BFD architecture name, however the 22 # disassembler doesn't accept it as a CPU name. This test checks that GDB 23 # doesn't pass architecture from the target description directly to the 24 # disassembler and instead uses one of the valid CPU names. 25 26 gdb_test \ 27 "set tdesc filename $srcdir/$subdir/arc-tdesc-cpu.xml" \ 28 ".*" \ 29 "set tdesc filename \$srcdir/$subdir/arc-tdesc-cpu.xml" 30 31 # An error message is emitted by the disassembler, therefore it is not shown 32 # unless the disassembler is actually invoked. Address "0" is not invalid, 33 # but that doesn't matter for this test case, because it is only the 34 # disassembler error message that is interesting. 35 set cmd "x /i 0" 36 set msg "setting HS architecture" 37 gdb_test_multiple $cmd $msg { 38 -re "Unrecognised disassembler CPU option: HS.*$gdb_prompt" { 39 fail $msg 40 } 41 -re "^$cmd\r\n\\s*$hex:\\s+Cannot access memory at address $hex\r\n$gdb_prompt" 42 { 43 pass $msg 44 } 45 } 46