[squeak-dev] Mirror primitives

Colin Putney cputney at wiresong.ca
Mon Sep 7 20:47:44 UTC 2009

On 7-Sep-09, at 1:10 PM, Eliot Miranda wrote:

> I can imagine a way using withArgs:evaluate:.  Compile the methods,
> save them in class variables of ContextPart and access them through a
> checking interface that only allows their execution in the context of
> the debugger.  But I still think this is overkill.  What, in Squeak,
> is to stop one compiling a method on ProtoObject and using it to
> subvert encapsulation on all objects?  Nothing.  So the issue of
> security is not made any worse by the introduction of the mirror
> primitives, but the debugger is enhanced significantly.  So for me
> they're a clear win.

One year at StS I had a discussion with Travis about Trippy. He  
mentioned to me that they had planned to use the mirror primitives for  
Trippy, but ultimately found that it was better to do something  
similar to what you describe above: compile a method that answers an  
instvar then execute with the object as the receiver using the inverse  
of #withArgs:evaluate: something like #valueWithReciever:args: on  
CompiledMethod. This seems like a powerful and flexible approach to  
me. You can do anything the object its self can do with its internal  
state, but completely bypass message dispatch. Best of all there's  
only one primitive required.

Admittedly a debugger involves a bit more than an inspector, but the  
technique would seem to be applicable. Is there some reason that this  
combined with traditional simulation wouldn't work well?


More information about the Squeak-dev mailing list