How to do logging (was Re: [squeak-dev] Files documentation)

Bert Freudenberg bert at freudenbergs.de
Thu Nov 27 19:52:43 UTC 2008


On 27.11.2008, at 18:44, Keith Hodges wrote:

> Hello All,
>
> I need a villainous superpower that I haven't needed before, can  
> anyone
> tell me how to achieve this.
>
> I have some code like this:
>
> self send a message to me.
> self nextThing.
>
> or
>
> self send a message to me.
> A := self nextThing.
>
> What naughty superpower code can I put in to #send that will jump
> execution to self nextThing directly?


send
	...
	thisContext sender jump: 4

This skips 4 bytecodes in the calling method before returning, so  
instead of pc=31 it continues at pc=35:

29 <70> self
30 <D4> send: send
31 <D3> send: a
32 <D2> send: message
33 <D1> send: to
34 <D0> send: me
35 <87> pop
36 <70> self
37 <D5> send: nextThing
38 <87> pop
39 <78> returnSelf

- Bert -





More information about the Squeak-dev mailing list