Maybe you should use MethodWrappers.
http://forum.world.st/MethodWrappers-td3829576.html
On 09/23/2013 09:56 AM, Alejandro Pulver wrote:
> Hello,
>
> I would like to intercept all messages sent in the system, as part of a
> small project to investigate if the information can be used in useful
> ways (autocompletion, object compatibility detection, etc).
>
> It will also involve filtering, aggregating and enabling/disabling it
> for space and time conservation,
>
> I'm new to Pharo, but had some success by changing the main perform
> (perform:withArguments: IIRC) method in Object, and making others use it
> instead of the primitives.
> Someone told me it doesn't capture most messages because of
> optimizations done by the system.
>
> My other thought was to use the profiler's spyOn as an approximation.
>
> What do you think?
>
> Thanks in Advance,
> Alejandro