[squeak-dev] Detecting DNU sent by VM, not by code

Michael van der Gulik mikevdg at gmail.com
Mon Nov 24 01:34:48 UTC 2008


On Mon, Nov 24, 2008 at 2:08 PM, Igor Stasenko <siguctua at gmail.com> wrote:

> Hello list,
> is there any way to detect that DNU message was sent by VM , as result
> of failed method lookup, not intentionally by language side?
>
> I need to have a pseudo-class which intercepts _any_ message you
> sending to its instance, including #doesNotUnderstood: sent directly
> by language side.
> Of course, i can't do anything with messages which handled directly by
> VM , such as #class , but at least i want to make sure that rest of
> messages is intercepted with guarantee.
>


Spoon has one of these; it involves VM modifications. Craig made a *special*
class that the VM is aware of, which captures any message sent to it. I
believe it'll capture every sent message.

Otherwise, it might be possible to kludge together a message catcher which
uses various techniques to detect special messages sent to it. I remember
doing something like that to catch >>ifTrue: and friends somehow using
exceptions (I forget). You could probably detect #doesNotUnderstand: by
determining whether the sender actually sent #doesNotUnderstand: explicitely
somehow by looking at thisContext and tracing back to see what the sent
selector was.

Gulik.

-- 
http://people.squeakfoundation.org/person/mikevdg
http://gulik.pbwiki.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20081124/a5690c1a/attachment.htm


More information about the Squeak-dev mailing list