<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 8, 2018 at 4:57 PM, Eliot Miranda <span dir="ltr"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="auto"><div>Hi Alistair,<br></div><div><br><div><br><br><span style="background-color:rgba(255,255,255,0)">_,,,^..^,,,_ (phone)</span></div>On Mar 8, 2018, at 6:59 AM, Alistair Grant <<a href="mailto:akgrant0710@gmail.com" target="_blank">akgrant0710@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><span></span></div></blockquote><blockquote type="cite"><div><span>Hi Eliot,</span><br><span></span><br><span>On Wed, Mar 07, 2018 at 10:46:41PM +0000, <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> wrote:</span><br><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Eliot Miranda uploaded a new version of VMMaker to project VM Maker:</span><br></blockquote><blockquote type="cite"><span><a href="http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2347.mcz" target="_blank">http://source.squeak.org/<wbr>VMMaker/VMMaker.oscog-eem.<wbr>2347.mcz</a></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>==================== Summary ====================</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Name: VMMaker.oscog-eem.2347</span><br></blockquote><blockquote type="cite"><span>Author: eem</span><br></blockquote><blockquote type="cite"><span>Time: 7 March 2018, 2:46:20.98144 pm</span><br></blockquote><blockquote type="cite"><span>UUID: 062614a7-e3da-4b30-997a-<wbr>9568911b9ff5</span><br></blockquote><blockquote type="cite"><span>Ancestors: VMMaker.oscog-akg.2346</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Review of Alistair's recent FilePlugin changes:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Alistair, in var:type: declarations use symbols for types, as these are shared in lots of cases.</span><br></blockquote><span></span><br><span>In my defense, the slang code I was looking at used strings.  But this</span><br><span>makes sense and I'll change.</span><br><span></span><br><span></span><br><blockquote type="cite"><span>With several plugins, but especially the FilePlugin and SocketPlugin, avoid using cCode: 'aString(...)' inSmalltalk: [passive default] because this is not simulateable.  For example in FilePlugin>>#<wbr>primitiveFileWrite you'll see</span><br></blockquote><blockquote type="cite"><span>    bytesWritten := self</span><br></blockquote><blockquote type="cite"><span>                        sqFile: file</span><br></blockquote><blockquote type="cite"><span>                        Write: count * elementSize</span><br></blockquote><blockquote type="cite"><span>                        From: (interpreterProxy cCoerce: (interpreterProxy firstIndexableField: array) to: #'char *')</span><br></blockquote><blockquote type="cite"><span>                        At: startIndex - 1 * elementSize.</span><br></blockquote><blockquote type="cite"><span>instead of a self cCode: 'sqFileWriteFromAt(...)' form and you'll find an implementation at FilePluginSimulator>>#sqFile:<wbr>Write:From:At:</span><br></blockquote><span></span><br><span>It looks like it's at the point where I need to understand</span><br><span>the simulator (which I haven't looked at yet).</span><br><span></span><br><span>I haven't seen it yet, but I'll definitely watch Clémnt's video.</span><br><span>Where else should I look to get started with the simulator?</span></div></blockquote></div></blockquote><div><br></div><div>Here is a description with some warm-up exercises to get started with the VM simulator:</div><div><a href="https://clementbera.wordpress.com/2016/05/30/simulating-the-cog-vm/">https://clementbera.wordpress.com/2016/05/30/simulating-the-cog-vm/</a><br></div><div>(Note that now the does not feature any more the processor simulators by default that post is 2y old)</div><div><br></div><div>My video deals with machine code stepping. I'm happy if you watch it, but that's different from what you want to do with the simulator. I would use the StackVMSimulator to debug a plugin like yours unless there's a specific bug with a JIT interaction. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><blockquote type="cite"><div><br></div></blockquote><div><br></div>It should be as simple as following the instructions on <a href="http://www.mirandabanda.org/cogblog/build-image/" target="_blank">http://www.mirandabanda.<wbr>org/cogblog/build-image/</a><div>but since we no longer include the processor simulator plugins in the standard vm builds, the VM obtained by</div><div>    image/getGoodSpur[64]VM.sh</div><div>won't allow simulating the CoInterpreter (the JIT), only the StackInterpreter.  So this needs to be fixed.</div><div><br></div><div>I could build <span style="background-color:rgba(255,255,255,0)">the processor simulator plugins</span> and put them on my website or we could set up a build on the CI infrastructure.  But with the latter I could do with some help.</div><div><br><blockquote type="cite"><div><span></span><br><span></span><br><blockquote type="cite"><span>In primitiveConnectToFile[<wbr>Descriptor] you write</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>    interpreterProxy failed ifFalse:</span><br></blockquote><blockquote type="cite"><span>        [^interpreterProxy pop: 3 "rcvr, name, writeFlag"</span><br></blockquote><blockquote type="cite"><span>                            thenPush: filePointer].</span><br></blockquote><blockquote type="cite"><span>    ^interpreterProxy primitiveFail.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>but there's no point calling primitiveFail a secoind time given that interpreterProxy failed tells you the primitive has already failed.  Simply write</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>    interpreterProxy failed ifFalse: </span><br></blockquote><blockquote type="cite"><span>        [interpreterProxy pop: 3 "rcvr, name, writeFlag"</span><br></blockquote><blockquote type="cite"><span>                            thenPush: filePointer]</span><br></blockquote><span></span><br><span>OK.</span><br><span></span><br><span>Thanks for the feedback,</span><br><span>Alistair</span><br></div></blockquote></div></div><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8px">Clément Béra</span><div style="font-size:12.8px">Pharo consortium engineer</div><span style="color:rgb(0,0,238)"><a href="https://clementbera.github.io/" target="_blank">https://clementbera.github.io/</a></span><div style="font-size:12.8px"><a href="https://clementbera.wordpress.com/" target="_blank">https://clementbera.wordpress.com/</a><br></div><div style="font-size:12.8px"><span style="line-height:16px">Bâtiment B 40, avenue Halley 59650 </span><span style="font-weight:bold;line-height:16px">Villeneuve d'Ascq</span></div></div></div></div></div>
</div></div>