Hi Eliot. I am fighting since several hours with something in Cog and I cannot realize it. I am blind. <br><br>I need to intercept all messages sent to an object. I have already done this for Interpreter VM and for StackVM. Now,  I am trying latest CogMTVM, and there is something I am not sying...I have this test:<br>


<br>testBlah<br><br>    ClassWith1Var new fooLong.<br>    ClassWith1Var new fooLong.<br>    ClassWith1Var new fooLong.<br>    <br><br>ClassWith1Var &gt;&gt; fooLong<br>    | aaa |<br>    Object new.<br>    self foo.<br><br>


<br>Now, I modified <br><br>CoInterpreter &gt;&gt; commonSend<br>    &quot;Send a message, starting lookup with the receiver&#39;s class.&quot;<br>    &quot;Assume: messageSelector and argumentCount have been set, and that <br>


    the receiver and arguments have been pushed onto the stack,&quot;<br>    &quot;Note: This method is inlined into the interpreter dispatch loop.&quot;<br>    &lt;sharedCodeNamed: &#39;commonSend&#39; inCase: 131&gt;<br>


    self sendBreak: messageSelector + BaseHeaderSize<br>        point: (objectMemory lengthOf: messageSelector)<br>        receiver: (self internalStackValue: argumentCount).<br>    cogit recordSendTrace ifTrue:<br>        [self recordTrace: lkupClass thing: messageSelector source: TraceIsFromInterpreter].<br>


    self internalFindNewMethod.<br>   <span style="background-color:rgb(255, 255, 51)"> self print: &#39;called: &#39;; printStringOf: messageSelector; cr.</span><br>    self internalExecuteNewMethod.<br>    self fetchNextBytecode<br>


<br><br>And when running the VM from gdb, &#39;called: fooLong&#39;  doesn&#39;t appear at all!!!  why ?  <br>In addition, it appears &#39;called: foo&#39; which is correct because #fooLong sends #foo<br>but it appears only ONCE. <br>


<br>#fooLong as I can see is not a quick return method but instead it goes by #sendLiteralSelector0ArgsBytecode. But the same happens if I put the print in that method... (which makes sense).<br>I tried with a StackVM and the same....so it seems that #fooLong is going by another place than #commonSend. <br>
<br>As far as I understand, there is nothing related with PIC or Jitt. In any of those cases, as what I can see, the #commonSend is called anyways. <br><br>So...I am completly lost. <br><br>Thanks in advance for any help.<br>
<br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br><br>