> I have a prototype sparc disassembler I've put
> together available at
> http://www.madhack.com/~jason/dis_sparc.c
> 
> There are still some things left to do (mostly
> implement support for most of the standard synthetic
> instructions), plus whatever shows up during
> testing.
> 
> Unfortunately, I don't have access to Sparc machines
> outside of work, so sort of starting to manually
> assemble sparc instructions and feed them to the
> code, I have no way of testing the code, so I'm
> hoping to solicit some assistance with testing and
> validation.
> 
> Any takers?

I can't seem to access the above site, but a good start for testing would be to 
iterate over all possible instructions and compare the output with the existing 
libdisasm.  When I was finishing up the amd64 disassembler work, I did a 
similar thing with the GNU disassembler, though the fundamental output 
differences meant it would never work perfectly.  The SPARC version should be 
significantly easier since you don't have to deal with variable-length 
instructions, and you're doing an apples-to-apples comparison.  One additional 
hack I made was to detect when I was dealing with an immediate value, and then 
skip any remaining iterations, to cut down on the number of different 
instructions to test.
The assumption was that 'movq 0x0, %rax' would be the same as 'movq 0x1, %rax' 
for all possible constants.  Also, make sure you test all varieties of 
DIS_SPARC_* disassembler flags (v8, v9, etc).

After that is working, you should be able to verify that dis(1) produces the 
same output for all of /usr/bin/* and /usr/lib/*.  You'll then want to verify 
that '::dis' produces the same output in mdb(1) for a random selection of 
functions in running programs and the kernel.  And check kmdb(1M), though if 
mdb is working it's pretty hard to break kmdb.

If you get all of the above working, then there's not much that running on 
different machines will give you, though running the object tests for both 
sun4u and sun4v machines would be a useful test.

Let me know if you need any additional help once you get to this point,

- Eric
 
 
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to