* [PATCH-RFC] Testcase(s) for VAX' new -M entry:0xf00 feature
@ 2005-03-25 3:28 Jan-Benedict Glaw
2005-03-26 13:33 ` Jan-Benedict Glaw
0 siblings, 1 reply; 6+ messages in thread
From: Jan-Benedict Glaw @ 2005-03-25 3:28 UTC (permalink / raw)
To: binutils
Hi!
This is my very first try to add something to the testsuite. It's
a new test checking that the -M entry:0xf00 feature (of objdump)
for VAX works as expected. This test is currently be run for
vax-*, but I'm not sure if this is correct. At least, I expect
it to be run for vax-dec-linux-gnu ...
This adds 4 single tests, of which one will fail (only for VAX)
until Nick actually checks in this feature. Just in case this is
already correct, here's the changelog:
2005-03-4 Jan-Benedict Glaw <jbglaw@lug-owl.de>
binutils/binutils/testsuite/binutils-all/vax:
* entrymask.s: New file, simple assembler test.
* objdump.exp: New file, implementing 4 tests for the
VAX-specific objdump option '-M entry:0xf000'.
diff -Nurp src-fresh/binutils/testsuite/binutils-all/vax/entrymask.s src-hacked/binutils/testsuite/binutils-all/vax/entrymask.s
--- src-fresh/binutils/testsuite/binutils-all/vax/entrymask.s 1970-01-01 01:00:00.000000000 +0100
+++ src-hacked/binutils/testsuite/binutils-all/vax/entrymask.s 2005-03-24 23:00:50.000000000 +0100
@@ -0,0 +1,11 @@
+.text
+
+.global label1
+label1:
+ .word 0x0110
+
+.global label2
+.type label2,@function
+label2:
+ .word 0x0224
+
diff -Nurp src-fresh/binutils/testsuite/binutils-all/vax/objdump.exp src-hacked/binutils/testsuite/binutils-all/vax/objdump.exp
--- src-fresh/binutils/testsuite/binutils-all/vax/objdump.exp 1970-01-01 01:00:00.000000000 +0100
+++ src-hacked/binutils/testsuite/binutils-all/vax/objdump.exp 2005-03-24 23:06:53.000000000 +0100
@@ -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"
+}
+
MfG, JBG
--
AWEK microdata GmbH -- Am Wellbach 4 -- 33609 Bielefeld
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH-RFC] Testcase(s) for VAX' new -M entry:0xf00 feature
2005-03-25 3:28 [PATCH-RFC] Testcase(s) for VAX' new -M entry:0xf00 feature Jan-Benedict Glaw
@ 2005-03-26 13:33 ` Jan-Benedict Glaw
2005-03-26 14:21 ` Jan-Benedict Glaw
2005-03-29 19:53 ` Nick Clifton
0 siblings, 2 replies; 6+ messages in thread
From: Jan-Benedict Glaw @ 2005-03-26 13:33 UTC (permalink / raw)
To: binutils
On Thu, Mar 24, 2005 at 11:40:26PM +0100, Jan-Benedict Glaw wrote:
> diff -Nurp src-fresh/binutils/testsuite/binutils-all/vax/entrymask.s src-hacked/binutils/testsuite/binutils-all/vax/entrymask.s
> --- src-fresh/binutils/testsuite/binutils-all/vax/entrymask.s 1970-01-01 01:00:00.000000000 +0100
> +++ src-hacked/binutils/testsuite/binutils-all/vax/entrymask.s 2005-03-24 23:00:50.000000000 +0100
> @@ -0,0 +1,11 @@
> +.text
> +
> +.global label1
> +label1:
> + .word 0x0110
> +
> +.global label2
> +.type label2,@function
> +label2:
> + .word 0x0224
> +
I've built this for vax-netbsd and vax-netbsdelf. The ELF variant
works as expected, but vax-netbsd (a.out) seems to ignore the
".type label2,@function" and thus objdump -d won't disassemble
label2 as a function.
I'd modify the test in two ways, which one do you think is preferrable:
- Exclude non-ELF targets from the test (how do I do that?)
- Also add a -M entry:0x... for label2 (which I'd prefer to do)
I'll intentionally keep /most/ of the rest of the patch, in case
someone wants to make a suggestion, but drop comments:
> diff -Nurp src-fresh/binutils/testsuite/binutils-all/vax/objdump.exp src-hacked/binutils/testsuite/binutils-all/vax/objdump.exp
> --- src-fresh/binutils/testsuite/binutils-all/vax/objdump.exp 1970-01-01 01:00:00.000000000 +0100
> +++ src-hacked/binutils/testsuite/binutils-all/vax/objdump.exp 2005-03-24 23:06:53.000000000 +0100
> @@ -0,0 +1,82 @@
> +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
> +}
> +
> +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"
> +}
> +
> +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"
> +}
> +
Thanks, JBG
--
AWEK microdata GmbH -- Am Wellbach 4 -- 33609 Bielefeld
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH-RFC] Testcase(s) for VAX' new -M entry:0xf00 feature
2005-03-26 13:33 ` Jan-Benedict Glaw
@ 2005-03-26 14:21 ` Jan-Benedict Glaw
2005-03-29 19:53 ` Nick Clifton
1 sibling, 0 replies; 6+ messages in thread
From: Jan-Benedict Glaw @ 2005-03-26 14:21 UTC (permalink / raw)
To: binutils
On Fri, Mar 25, 2005 at 06:12:22PM +0100, Jan-Benedict Glaw wrote:
> On Thu, Mar 24, 2005 at 11:40:26PM +0100, Jan-Benedict Glaw wrote:
> > diff -Nurp src-fresh/binutils/testsuite/binutils-all/vax/entrymask.s src-hacked/binutils/testsuite/binutils-all/vax/entrymask.s
> I've built this for vax-netbsd and vax-netbsdelf. The ELF variant
> works as expected, but vax-netbsd (a.out) seems to ignore the
> ".type label2,@function" and thus objdump -d won't disassemble
> label2 as a function.
>
> I'd modify the test in two ways, which one do you think is preferrable:
>
> - Exclude non-ELF targets from the test (how do I do that?)
> - Also add a -M entry:0x... for label2 (which I'd prefer to do)
Third option would be to
- Handle ELF and a.out targets different; expect working entry mask
decoding for ELF, but not for a.out.
MfG, JBG
--
AWEK microdata GmbH -- Am Wellbach 4 -- 33609 Bielefeld
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH-RFC] Testcase(s) for VAX' new -M entry:0xf00 feature
2005-03-26 13:33 ` Jan-Benedict Glaw
2005-03-26 14:21 ` Jan-Benedict Glaw
@ 2005-03-29 19:53 ` Nick Clifton
2005-03-30 14:28 ` Jan-Benedict Glaw
1 sibling, 1 reply; 6+ messages in thread
From: Nick Clifton @ 2005-03-29 19:53 UTC (permalink / raw)
To: Jan-Benedict Glaw; +Cc: binutils
Hi Jan-Benedict,
I have checked your new VAX test patch into the CVS repository.
>>+.type label2,@function
>>+label2:
>
> I've built this for vax-netbsd and vax-netbsdelf. The ELF variant
> works as expected, but vax-netbsd (a.out) seems to ignore the
> ".type label2,@function"
Yes - the .type directive is not supported by the a.out format.
> and thus objdump -d won't disassemble
> label2 as a function.
>
> I'd modify the test in two ways, which one do you think is preferrable:
>
> - Exclude non-ELF targets from the test (how do I do that?)
See the proc is_elf_format defined in
binutils/testsuite/lib/utils-lib.exp and used for example in
binutils-all/readelf.exp.
> - Also add a -M entry:0x... for label2 (which I'd prefer to do)
I think that I would prefer this approach as well.
Cheers
Nick
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH-RFC] Testcase(s) for VAX' new -M entry:0xf00 feature
2005-03-29 19:53 ` Nick Clifton
@ 2005-03-30 14:28 ` Jan-Benedict Glaw
2005-04-04 17:20 ` Nick Clifton
0 siblings, 1 reply; 6+ messages in thread
From: Jan-Benedict Glaw @ 2005-03-30 14:28 UTC (permalink / raw)
To: Nick Clifton; +Cc: binutils
On Tue, Mar 29, 2005 at 05:19:52PM +0100, Nick Clifton wrote:
> Hi Jan-Benedict,
>
> I have checked your new VAX test patch into the CVS repository.
Thanks!
> > - Also add a -M entry:0x... for label2 (which I'd prefer to do)
>
> I think that I would prefer this approach as well.
Here's the patch. Passes cross-build/hosted on my PC for vax-linux,
vax-ultrix, vax-netbsd and vax-netbsdelf.
2005-03-29 Jan-Benedict Glaw <jbglaw@lug-owl.>
binutils/testsuite/binutils-all/vax/
* objdump.exp: Condense the two tests into one and add a
"-m entry:" for the second label.
diff -Nurp src-fresh/binutils/testsuite/binutils-all/vax/objdump.exp src-hacked/binutils/testsuite/binutils-all/vax/objdump.exp
--- src-fresh/binutils/testsuite/binutils-all/vax/objdump.exp 2005-03-29 18:13:48.000000000 +0200
+++ src-hacked/binutils/testsuite/binutils-all/vax/objdump.exp 2005-03-29 23:03:07.000000000 +0200
@@ -45,11 +45,12 @@ if [is_remote host] {
}
#
-# First run. We expect the function to be a function and the sole label
-# not to produce an entry mask.
+# We check both function entry points. The second one at offset 2 will
+# show up automatically on ELF targets, but needs to be set on a.out
+# targets.
#
-set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -d $objfile"]
-set want1 "\[ \]+0:\[ \]+10 01\[ \]+bsbb 3"
+set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -d -M entry:0x0 -M entry:2 $objfile"]
+set want1 "\[ \]+0:\[ \]+10 01\[ \]+\\.word 0x0110.\*r8 r4"
set want2 "\[ \]+2:\[ \]+24 02\[ \]+\\.word 0x0224.\*r9 r5 r2"
if [regexp $want1 $got] then {
pass "entrymask test 1"
@@ -62,21 +63,3 @@ if [regexp $want2 $got] then {
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"
-}
-
MfG, JBG
--
AWEK microdata GmbH -- Am Wellbach 4 -- 33609 Bielefeld
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH-RFC] Testcase(s) for VAX' new -M entry:0xf00 feature
2005-03-30 14:28 ` Jan-Benedict Glaw
@ 2005-04-04 17:20 ` Nick Clifton
0 siblings, 0 replies; 6+ messages in thread
From: Nick Clifton @ 2005-04-04 17:20 UTC (permalink / raw)
To: Jan-Benedict Glaw; +Cc: binutils
Hi Jan-Benedict,
> 2005-03-29 Jan-Benedict Glaw <jbglaw@lug-owl.>
>
> binutils/testsuite/binutils-all/vax/
> * objdump.exp: Condense the two tests into one and add a
> "-m entry:" for the second label.
Approved and applied.
Cheers
Nick
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-04-04 17:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-25 3:28 [PATCH-RFC] Testcase(s) for VAX' new -M entry:0xf00 feature Jan-Benedict Glaw
2005-03-26 13:33 ` Jan-Benedict Glaw
2005-03-26 14:21 ` Jan-Benedict Glaw
2005-03-29 19:53 ` Nick Clifton
2005-03-30 14:28 ` Jan-Benedict Glaw
2005-04-04 17:20 ` Nick Clifton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).