6cov x86 support

37 views
Skip to first unread message

Lorenzo Stoakes

unread,
Jun 24, 2011, 10:14:50 AM6/24/11
to golan...@googlegroups.com
Hi,

Following the recent activity on the cov tool, I was wondering about
its x86 support. According to the documentation:-

"For reasons of disambiguation it is installed as 6cov although it
also serves as an 8cov and a 5cov."

However, when I run 6cov on x86 output, I get the following error:-

6cov: cannot read pc: can't translate address 90

However, if I change src/cmd/cov/main.c thusly:-

- #include <ureg_amd64.h>
+ #include <ureg_x86.h>

...

- if(get8(mem, offsetof(Ureg, ip), &pc) < 0) {
+ if(get8(mem, offsetof(Ureg, pc), &pc) < 0) {

...

- if(put8(mem, offsetof(Ureg, ip), pc) < 0)
+ if(put8(mem, offsetof(Ureg, pc), pc) < 0)

The tool seems to work (though I wonder whether (get|put)8 ought to be
(get|put)4. Is the tool not designed to work in an x86 environment
(I'm testing it in x86/linux)?

--
Lorenzo Stoakes
http://www.codegrunt.co.uk

Anthony Martin

unread,
Jun 24, 2011, 2:54:29 PM6/24/11
to Lorenzo Stoakes, golan...@googlegroups.com
Lorenzo Stoakes <lsto...@gmail.com> once said:
> Is the tool not designed to work in an x86 environment
> (I'm testing it in x86/linux)?

It will work on x86 with minimal changes. If you
want to see what it will look like, check out the
code for prof (specifcally how it handles the Ureg
types for each architecture). My plan is to do the
same in cov or put the code into libmach to avoid
duplication. I haven't decided.

There are a few other fixes that need to be made
in libmach before this. I have the patches ready.
They'll go out this evening (US/Pacific time).

If you want, I can CC you when I send them out.

Anthony

Lorenzo Stoakes

unread,
Jun 24, 2011, 9:13:46 PM6/24/11
to Anthony Martin, golan...@googlegroups.com
On 24 June 2011 19:54, Anthony Martin <al...@pbrane.org> wrote:
> If you want, I can CC you when I send them out.

Please do, appreciated :)

Reply all
Reply to author
Forward
0 new messages