|
From: Doug R. <df...@nl...> - 2004-01-03 13:39:18
|
On Sat, 2004-01-03 at 13:23, Nicholas Nethercote wrote: > On Sat, 27 Dec 2003, Doug Rabson wrote: > > > Since I've had a bit of festive spare time available, I thought I would > > attempt to port valgrind 2.1.0 to FreeBSD-5.x. After a bit of a > > struggle, two falls and a submission, I have most of it working well > > enough to pass most of the tests (with the notable exception of the > > pthread stuff which I haven't even tried to port yet). > > Well done! A few people have tried this, but it sounds like you've got a > lot further than anyone else. Would you be able to write some kind of > summary describing the changes you had to make? That would be very useful > for people to get a grip on what you've done. I summarised most of the changes in a later message and you can get a patch against today's cvs at http://people.freebsd.org/~dfr/valgrind-20040103-dfr.diff. The most fiddly part was getting syscalls to work. FreeBSD (and probably all 4.4BSD derived systems) has a quite different syscall ABI with arguments on the stack and error-returns signalled with the carry flag. Add to that the fact that some (not all) syscalls return an extra 32bits in %edx and things get a bit tricky in vg_syscalls.c. Still, it helped that I've been hacking the FreeBSD kernel for about eight years and understand it about as well as anyone :-) |