mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-02 04:27:46 +08:00
Add VAX specific disassembler option -Mentry: to specify a function entry
address, and add code to test this new option.
This commit is contained in:
11
binutils/testsuite/binutils-all/vax/entrymask.s
Normal file
11
binutils/testsuite/binutils-all/vax/entrymask.s
Normal file
@ -0,0 +1,11 @@
|
||||
.text
|
||||
|
||||
.global label1
|
||||
label1:
|
||||
.word 0x0110
|
||||
|
||||
.global label2
|
||||
.type label2,@function
|
||||
label2:
|
||||
.word 0x0224
|
||||
|
82
binutils/testsuite/binutils-all/vax/objdump.exp
Normal file
82
binutils/testsuite/binutils-all/vax/objdump.exp
Normal file
@ -0,0 +1,82 @@
|
||||
#
|
||||
# Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2002, 2005
|
||||
# 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 2 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, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
|
||||
#
|
||||
# This file was written by Jan-Benedict Glaw <jbglaw@lug-owl.de>. It's goal
|
||||
# is to check the VAX-specific support of the -M entry:0xf00 switch, which
|
||||
# allows to force function entry masks at given addresses.
|
||||
#
|
||||
|
||||
if ![istarget vax*-*-*] then {
|
||||
return
|
||||
}
|
||||
|
||||
if {[which $OBJDUMP] == 0} then {
|
||||
perror "$OBJDUMP does not exist"
|
||||
return
|
||||
}
|
||||
|
||||
send_user "Version [binutil_version $OBJDUMP]"
|
||||
|
||||
if {![binutils_assemble $srcdir/$subdir/entrymask.s tmpdir/entrymask.o]} then {
|
||||
return
|
||||
}
|
||||
|
||||
if [is_remote host] {
|
||||
set objfile [remote_download host tmpdir/entrymask.o]
|
||||
} else {
|
||||
set objfile tmpdir/entrymask.o
|
||||
}
|
||||
|
||||
#
|
||||
# First run. We expect the function to be a function and the sole label
|
||||
# not to produce an entry mask.
|
||||
#
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -d $objfile"]
|
||||
set want1 "\[ \]+0:\[ \]+10 01\[ \]+bsbb 3"
|
||||
set want2 "\[ \]+2:\[ \]+24 02\[ \]+\\.word 0x0224.\*r9 r5 r2"
|
||||
if [regexp $want1 $got] then {
|
||||
pass "entrymask test 1"
|
||||
} else {
|
||||
fail "entrymask test 1"
|
||||
}
|
||||
if [regexp $want2 $got] then {
|
||||
pass "entrymask test 2"
|
||||
} else {
|
||||
fail "entrymask test 2"
|
||||
}
|
||||
|
||||
#
|
||||
# Second run. Now, we force the label as a function, so we expect that
|
||||
# it also produces an entry mask, as any call'able function should.
|
||||
#
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -d -M entry:0x0 $objfile"]
|
||||
set want3 "\[ \]+0:\[ \]+10 01\[ \]+\\.word 0x0110.\*r8 r4"
|
||||
set want4 "\[ \]+2:\[ \]+24 02\[ \]+\\.word 0x0224.\*r9 r5 r2"
|
||||
if [regexp $want3 $got] then {
|
||||
pass "entrymask test 3"
|
||||
} else {
|
||||
fail "entrymask test 3"
|
||||
}
|
||||
if [regexp $want4 $got] then {
|
||||
pass "entrymask test 4"
|
||||
} else {
|
||||
fail "entrymask test 4"
|
||||
}
|
||||
|
Reference in New Issue
Block a user