|
From: Tom H. <th...@cy...> - 2005-01-20 00:10:28
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
> Why do we need general function wrapping? Currently all we care about
> is intercepting libpthread calls. I would prefer to write, in C, a
> libpthread stub library, and use the existing intercept mechanism to
> route all calls there. The stub library emits events -- using the
> client request mechanism -- to those who want to know, and calls onwards
> to the real pthread functions (my hands wave here). No need to mess with
> calling conventions, guest state layout or magic run-time code modification.
That's more like how I had envisaged function wrapping working. Use
the existing intercept machinery to redirect the original function
call, somehow passing the original function address as we do so.
The wrapper would then call the real function, ensuring that this
time the address didn't get redirected during translation. It would
then get control again when the real function returned. The only
problem then is the longjmp/exception case.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|