49 lines
1.8 KiB
Plaintext
49 lines
1.8 KiB
Plaintext
# Copyright 2017 Free Software Foundation, Inc.
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
if {[gdb_skip_xml_test]} {
|
|
unsupported "arc-tdesc-cpu.exp"
|
|
return -1
|
|
}
|
|
|
|
gdb_start
|
|
|
|
# Test whether it is OK to have `arc:HS` in the target description
|
|
# architecture. `HS` is a valid BFD architecture name, however the
|
|
# disassembler doesn't accept it as a CPU name. This test checks that GDB
|
|
# doesn't pass architecture from the target description directly to the
|
|
# disassembler and instead uses one of the valid CPU names.
|
|
|
|
gdb_test \
|
|
"set tdesc filename $srcdir/$subdir/arc-tdesc-cpu.xml" \
|
|
".*" \
|
|
"set tdesc filename \$srcdir/$subdir/arc-tdesc-cpu.xml"
|
|
|
|
# An error message is emitted by the disassembler, therefore it is not shown
|
|
# unless the disassembler is actually invoked. Address "0" is not invalid,
|
|
# but that doesn't matter for this test case, because it is only the
|
|
# disassembler error message that is interesting.
|
|
set cmd "x /i 0"
|
|
set msg "setting HS architecture"
|
|
gdb_test_multiple $cmd $msg {
|
|
-re "Unrecognised disassembler CPU option: HS.*$gdb_prompt" {
|
|
fail $msg
|
|
}
|
|
-re "^$cmd\r\n\\s*$hex:\\s+Cannot access memory at address $hex\r\n$gdb_prompt"
|
|
{
|
|
pass $msg
|
|
}
|
|
}
|