<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:12.666666984558105px">Hello,</span><div style="font-family:arial,sans-serif;font-size:12.666666984558105px"><br></div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">

I gave it a shot based on the generator.image that PharoVM uses to generate the VM.</div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px"><br></div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">

But none of :</div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px"><br></div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px"><div>(| vm |</div><div>vm := StackInterpreterSimulator newWithOptions: #().</div>

<div>vm openOn: &#39;/Users/eliot/Cog/startreader.image&#39;.</div><div>vm openAsMorph; run)</div><div><br></div><div>and</div><div><br></div><div>(| vm |</div><div>vm := CogVMSimulator newWithOptions: #(ObjectMemory Spur32BitCoMemoryManager</div>

<div><span style="white-space:pre-wrap">                                                                </span>Cogit StackToRegisterMappingCogit).</div><div>vm desiredNumStackPages: 8.</div><div>vm objectMemory setCheckForLeaks: 1.</div><div>vm openOn: &#39;/Users/eliot/Cog/spurreader.image&#39;.</div>

<div>vm openAsMorph; toggleTranscript; halt; run)</div><div><br></div><div>is going to work right away as newWithOptions: isn&#39;t there in that image.</div><div><br></div><div>So, there is a initializeWithOptions: #().</div>

<div><br></div><div>When trying out that one, I do get another error.</div><div><br></div><div>In fact, the initializeWithOptions: method is wrong:<br></div><div><br></div><div><div>initializeWithOptions: optionsDictionary</div>

<div><span style="white-space:pre-wrap">        </span>&quot;ObjectMemory initializeWithOptions: Dictionary new&quot;</div><div><br></div><div><span style="white-space:pre-wrap">        </span>self initBytesPerWord: (optionsDictionary at: #BytesPerWord ifAbsent: [4]).</div>

</div><div><br></div><div>...</div><div><br></div><div>the thing is doing #BytesPerWork ifAbsent: ... :-(</div><div><br></div><div>Of course, as #() is an Array an not a Dictionary.</div><div><br></div><div>So, I tried:</div>

<div><br></div><div><div>StackInterpreterSimulator initializeWithOptions: Dictionary new.</div><div>vm := StackInterpreterSimulator new.</div></div><div><br></div><div>Which got the ball rolling.</div><div><br></div><div>

But then, of course, same story as here:</div><div><br></div><div><a href="http://forum.world.st/Got-quot-Error-basicNew-failed-quot-when-running-InterpreterSimulator-td3835723.html" target="_blank">http://forum.world.st/Got-quot-Error-basicNew-failed-quot-when-running-InterpreterSimulator-td3835723.html</a><br>

</div><div><br></div><div><br></div><div>Well, based on Clement&#39;s comments, I fiddled a bit with the TranscriptStream, which I turned into a simple Transcript and let go of the local image name for the display window.</div>

<div><br></div><div>Also, did </div><div><br></div><div>transcript := Transcript.</div><div>displayForm := (ImageMorph fromString: &#39;Display has not yet been installed&#39;) form.</div><div><br></div><div>in StackInterpreterSimulator initialize.</div>

<div><br></div><div><br></div><div>So, here is the current stance:</div><div><br></div><div><div>| vm |</div><div>StackInterpreterSimulator initializeWithOptions: Dictionary new.</div><div>vm := StackInterpreterSimulator new.</div>

<div>vm openOn: &#39;C:\MinGW\msys\1.0\home\User\pharo\pharo.image&#39;.</div><div>vm openAsMorph.</div><div>vm run.</div></div><div><br></div><div><br></div><div>the morph opens.</div><div><br></div><div>Now, when I do run, I do get a problem in:</div>

<div><br></div><div>InterpreterStackPage&gt;&gt;headFP: pointer</div><div><br></div><div><br></div><div>There is an self assert: (pointer = 0 or: [pointer &lt; baseAddress and: [realStackLimit - (LargeContextBytes / 2) &lt;= pointer]]).</div>

<div><br></div><div>And LargeContextBytes is nil.</div><div><br></div><div>I looked around for initialization for that one.</div><div><br></div><div>It is only in the InterpreterStackPage class &gt;&gt; initialize</div><div>

<br></div><div><br></div><div>So I did;</div><div><br></div><div><div>| vm |</div><div>StackInterpreterSimulator initializeWithOptions: Dictionary new.</div><div>vm := StackInterpreterSimulator new.</div><div>InterpreterStackPage initialize.</div>

<div>vm openOn: &#39;C:\MinGW\msys\1.0\home\User\pharo\pharo.image&#39;.</div><div>vm openAsMorph.</div><div>vm run.</div></div><div><br></div><div>Then I got a blinking square running in the top corner.</div><div><br></div>

<div>No amount of stopping processes would interrupt it.</div><div><br></div><div>So the simulator is running the run loop:<br></div><div><br></div><div><div>self fetchNextBytecode.</div><div><span style="white-space:pre-wrap">        </span>[true] whileTrue:</div>

<div><span style="white-space:pre-wrap">                </span>[self assertValidExecutionPointers.</div><div><span style="white-space:pre-wrap">                </span> atEachStepBlock value. &quot;N.B. may be nil&quot;</div><div><span style="white-space:pre-wrap">                </span> self dispatchOn: currentBytecode in: BytecodeTable.</div>

<div><span style="white-space:pre-wrap">                </span> self incrementByteCount].</div></div><div><br></div><div>and relinquishing processor every once in a while and this square is shown (Display reverse below] ...</div><div>
<br>
</div><div>(which is where I end up when interrupting)<br></div><div><br></div><div><div>ioRelinquishProcessorForMicroseconds: microseconds</div><div><span style="white-space:pre-wrap">        </span>&quot;In the simulator give an indication that we&#39;re idling and check for input.&quot;</div>

<div><span style="white-space:pre-wrap">        </span>Display reverse: (0@0 extent: 16@16).</div><div><span style="white-space:pre-wrap">        </span>Sensor peekEvent ifNotNil:</div><div><span style="white-space:pre-wrap">                </span>[self forceInterruptCheck].</div>

<div><span style="white-space:pre-wrap">        </span>Processor activeProcess == UIManager default uiProcess ifTrue:</div><div><span style="white-space:pre-wrap">                </span>[World doOneCycle].</div><div><span style="white-space:pre-wrap">        </span>microseconds &gt;= 1000</div>

<div><span style="white-space:pre-wrap">                </span>ifTrue: [(Delay forMilliseconds: microseconds + 999 // 1000) wait]</div><div><span style="white-space:pre-wrap">                </span>ifFalse: [Processor yield]</div></div><div><br></div>

<div>If one could tell me how to get the display to show, it would be welcome.</div><div><br></div><div>The display instVar contains stuff in the debugger but isn&#39;t ok to open with something like:</div><div><br></div>

<div>In the transcript, I do see things related to initialization:</div><div><br></div><div><div>(56) Looking for primitiveSetGCBiasToGrowGCLimit in vm</div><div>Looking for module  ... not found</div><div>(3751) Looking for primitiveFileWrite in FilePlugin</div>

<div>Looking for module FilePlugin</div><div>(3751) Looking for secCanCreatePathOfSize in SecurityPlugin</div><div>Looking for module SecurityPlugin ... loaded</div><div>(3751) Looking for secCanDeletePathOfSize in SecurityPlugin</div>

<div>(3751) Looking for secCanGetFileTypeOfSize in SecurityPlugin</div><div>(3751) Looking for secCanListPathOfSize in SecurityPlugin</div><div>(3751) Looking for secCanSetFileTypeOfSize in SecurityPlugin</div><div>(3751) Looking for secDisableFileAccess in SecurityPlugin</div>

<div>(3751) Looking for secCanDeleteFileOfSize in SecurityPlugin</div><div>(3751) Looking for secCanOpenFileOfSizeWritable in SecurityPlugin</div><div>(3751) Looking for secCanRenameFileOfSize in SecurityPlugin</div><div>

(3751) Looking for secHasFileAccess in SecurityPlugin ... loaded</div><div>(3774) Looking for primitiveFileSize in FilePlugin</div><div>(4390) Looking for primitiveCompareString in MiscPrimitivePlugin</div><div>Looking for module MiscPrimitivePlugin ... loaded</div>

<div>(4623) Looking for primitiveDirectoryDelimitor in FilePlugin</div><div>(7806) Looking for primitiveIndexOfAsciiInString in MiscPrimitivePlugin</div><div>(57216) Looking for primitiveStringHash in MiscPrimitivePlugin</div>

<div>(177977) Looking for primitiveFindFirstInString in MiscPrimitivePlugin</div><div>(179055) Looking for primitiveFileOpen in FilePlugin</div><div>(179815) Looking for primitiveFileGetPosition in FilePlugin</div><div>(179832) Looking for primitiveFileAtEnd in FilePlugin</div>

<div>(179873) Looking for primitiveFileRead in FilePlugin</div><div>(182837) Looking for primitiveFileSize in FilePlugin</div><div>(182868) Looking for primitiveFileSetPosition in FilePlugin</div><div>(186627) Looking for primDigitCompare in LargeIntegers</div>

<div>Looking for module LargeIntegers ... loaded</div><div>(186688) Looking for primDigitMultiplyNegative in LargeIntegers</div><div>(186884) Looking for primNormalizeNegative in LargeIntegers</div><div>(186985) Looking for primDigitAdd in LargeIntegers</div>

<div>(186986) Looking for primNormalizePositive in LargeIntegers</div><div>(187038) Looking for primDigitSubtract in LargeIntegers</div></div><div><br></div><div>Is there a way to stop the interpreter in order to debug things?</div>

<div><br></div><div>I saw: runAtEachStep: aBlock</div><div><span style="white-space:pre-wrap">        </span>self initStackPages.</div><div><span style="white-space:pre-wrap">        </span>self loadInitialContext.</div><div><span style="white-space:pre-wrap">        </span>self internalizeIPandSP.</div>

<div><span style="white-space:pre-wrap">        </span>self fetchNextBytecode.</div><div><span style="white-space:pre-wrap">        </span>[true] whileTrue:</div><div><span style="white-space:pre-wrap">                </span>[self assertValidExecutionPointers.</div>

<div><span style="white-space:pre-wrap">                </span> aBlock value: currentBytecode.</div><div><span style="white-space:pre-wrap">                </span> self dispatchOn: currentBytecode in: BytecodeTable.</div><div><span style="white-space:pre-wrap">                </span> self incrementByteCount].</div>

<div><span style="white-space:pre-wrap">        </span>localIP := localIP - 1.</div><div><span style="white-space:pre-wrap">        </span>&quot;undo the pre-increment of IP before returning&quot;</div><div><span style="white-space:pre-wrap">        </span>self externalizeIPandSP</div>

<div><br></div><div>How to use that?</div><div><br></div><div>Why do I not see the display in the sim?</div><div><br></div><div>I saw a &quot;quitBlock&quot;. What is this about?</div><div><br></div><div>I am not far from getting this working...</div>

<div><br></div><div>Thanks for some clues!</div><div><br></div><div>Phil</div></div><div><div dir="ltr"><div>---</div><div>Philippe Back</div><div>Dramatic Performance Improvements</div><div>Mob: +32(0) 478 650 140 | Fax: +32 (0) 70 408 027</div>

<div><a href="mailto:Mail%3Aphil@highoctane.be" target="_blank">Mail:phil@highoctane.be</a> | Web: <a href="http://philippeback.eu" target="_blank">http://philippeback.eu</a></div><div>Blog: <a href="http://philippeback.be" target="_blank">http://philippeback.be</a> | Twitter: @philippeback</div>

<div>Youtube: <a href="http://www.youtube.com/user/philippeback/videos" target="_blank">http://www.youtube.com/user/philippeback/videos</a></div><div><br></div><div>High Octane SPRL</div><div>rue cour Boisacq 101 | 1301 Bierges | Belgium</div>

<div><br></div><div>Pharo Consortium Member - <a href="http://consortium.pharo.org/" target="_blank">http://consortium.pharo.org/</a></div><div>Featured on the Software Process and Measurement Cast - <a href="http://spamcast.libsyn.com" target="_blank">http://spamcast.libsyn.com</a><br>

</div><div>Sparx Systems Enterprise Architect and Ability Engineering EADocX Value Added Reseller</div><div> </div><div><br></div></div></div>
</div>