<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi Denis, what's the test? &nbsp;Send me the code and I'll try it in Squeak<br><br><span style="background-color: rgba(255, 255, 255, 0);">_,,,^..^,,,_ (phone)</span></div><div><br>On Feb 29, 2016, at 2:39 AM, Denis Kudriashov &lt;<a href="mailto:dionisiydk@gmail.com">dionisiydk@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><span></span></div></blockquote><blockquote type="cite"><div><div dir="ltr">But this change not makes debugging test working. During debugging prim call return nil.&nbsp;</div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-29 11:12 GMT+01:00 Denis Kudriashov <span dir="ltr">&lt;<a href="mailto:dionisiydk@gmail.com" target="_blank">dionisiydk@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Eliot.&nbsp;<div><br></div><div>We have test for debugging failed named primitive. And without template trick this test is not working. Debugging this test step by step shows what is really not working. We not got error code from prim call while doing step over it.</div><div>It is CodeSimulationTest&gt;&gt;testErrorCodeNotFound</div><div><br></div><div>Beside your fix with method header not helps alone. I make all tests working with another change. But I am not really understand this code:</div><div><br></div><div><div style="color:rgb(0,0,0);font-size:13px">tryNamedPrimitiveIn: aCompiledMethod for: aReceiver withArgs: arguments</div><div style="color:rgb(0,0,0);font-size:13px"><span style="white-space:pre-wrap">        </span>"Invoke the named primitive for aCompiledMethod, answering its result, or,</div><div style="color:rgb(0,0,0);font-size:13px"><span style="white-space:pre-wrap">        </span>&nbsp;if the primiitve fails, answering the error code."</div><div style="color:rgb(0,0,0);font-size:13px"><span style="white-space:pre-wrap">        </span>&lt;primitive: 218 error: ec&gt;</div><div style="color:rgb(0,0,0);font-size:13px"><span style="white-space:pre-wrap">        </span>ec ifNotNil:</div><div style="color:rgb(0,0,0);font-size:13px"><span style="white-space:pre-wrap">                </span>["If ec is an integer other than -1 there was a problem with primitive 218,</div><div style="color:rgb(0,0,0);font-size:13px"><span style="white-space:pre-wrap">                </span>&nbsp;&nbsp;not with the external primitive itself. &nbsp;-1 indicates a generic failure (where</div><div style="color:rgb(0,0,0);font-size:13px"><span style="white-space:pre-wrap">                </span>&nbsp;&nbsp;ec should be nil) but ec = nil means primitive 218 is not implemented.&nbsp; So</div><div style="color:rgb(0,0,0);font-size:13px"><span style="white-space:pre-wrap">                </span>&nbsp;&nbsp;interpret -1 to mean the external primitive failed with a nil error code."</div><div style="color:rgb(0,0,0);font-size:13px"><span style="white-space:pre-wrap">                </span>&nbsp;ec isInteger ifTrue:</div><div style="color:rgb(0,0,0);font-size:13px"><span style="white-space:pre-wrap">                        </span>[ec = -1</div><div style="color:rgb(0,0,0);font-size:13px"><span style="white-space:pre-wrap">                                </span>ifTrue: [ec := nil]</div><div style="color:rgb(0,0,0);font-size:13px"><span style="white-space:pre-wrap">                                </span>ifFalse: [<b>^self class primitiveFailTokenFor: ec</b>]]].</div><div style="color:rgb(0,0,0);font-size:13px"><span style="white-space:pre-wrap">        </span>^"execute prim by template method"&nbsp;</div></div><div><br></div><div>So it is fixes Pharo tests problem. But I don't know what other issues it can produce.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-02-27 11:39 GMT+01:00 Denis Kudriashov <span dir="ltr">&lt;<a href="mailto:dionisiydk@gmail.com" target="_blank">dionisiydk@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Hi Eliot</div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-27 0:25 GMT+01:00 Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>So the code to change the number of arguments is fine.&nbsp; What's wrong is the code to store the error code.&nbsp; That comes /after/ the three byte call primitive bytecode at the start of the method.&nbsp; So it should read</div><div><br></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><span style="white-space:pre-wrap">        xpc := self initialPC + 3.</span></div><span><div><span style="white-space:pre-wrap">        "long store temp"</span></div><div><span style="white-space:pre-wrap">        (self at: xpc) = 129 </span><span style="white-space:pre-wrap">ifTrue:</span></div><div><span style="white-space:pre-wrap">                [self at: xpc + 1 put: (16r40 + numArgs).</span></div><div><span style="white-space:pre-wrap">                 self at: xpc + 3 put: (16r10 + numArgs)]</span></div></span></blockquote><div></div></div><div><br></div><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Is there any solution to make it working?<br></div></div></blockquote></span></div><div class="gmail_extra"><br></div>The above should work.&nbsp; But there's a much easier way</blockquote></div><br>This works. Thank's. I will try your attachment later.&nbsp;</div><div class="gmail_extra"><br></div><div class="gmail_extra">Best regards,</div><div class="gmail_extra">Denis</div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></blockquote></body></html>