<div dir="ltr"><span style="color:rgb(0,0,0);font-size:13px">And here example with not empty stack but still confusing:</span><div style="color:rgb(0,0,0);font-size:13px"><br></div><div style="color:rgb(0,0,0);font-size:13px"><pre style="white-space:pre-wrap;font-family:monospace,serif;font-size:1em;word-wrap:break-word;padding:0px 0px 0px 5px;margin-top:0px;margin-bottom:0px;border:0px"><span class="im"><span style="color:rgb(102,102,0);outline:none">|</span><span style="color:rgb(0,0,0);outline:none"> t </span><span style="color:rgb(102,102,0);outline:none">|</span><span style="color:rgb(0,0,0);outline:none">
</span><span style="color:rgb(102,102,0);outline:none">[</span><span style="color:rgb(0,0,0);outline:none"> t </span><span style="color:rgb(102,102,0);outline:none">:=</span><span style="color:rgb(0,0,0);outline:none"> </span><span style="color:rgb(0,136,0);outline:none">&#39;test&#39;</span><span style="color:rgb(102,102,0);outline:none">]</span><span style="color:rgb(0,0,0);outline:none"> value</span><span style="color:rgb(102,102,0);outline:none">.</span></span></pre></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-05-11 15:26 GMT+02:00 Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>[moving to squeak-dev since this does not appear to be a VM problem]</div><div><br></div><div>I’d say it’s not only confusing, but actually wrong, since at that point the stack is empty. The context’s stackPtr is 1, equal to the method’s numTemps, so there is no valid stack top.</div><div><br></div><div>Another confusing thing is that when you put these lines into a method and step into it, #(nil nil) will be on the stack. That’s because the context’s pc is 27, it just pushed the temp vector, but has not stored it yet:</div><div><br></div><div><div>25 &lt;8A 02&gt; push: (Array new: 2)</div><div>27 &lt;68&gt; popIntoTemp: 0</div><div>28 &lt;10&gt; pushTemp: 0</div><div>29 &lt;8F 10 00 09&gt; closureNumCopied: 1 numArgs: 0 bytes 33 to 41</div><div>33 <span style="white-space:pre-wrap">        </span>&lt;20&gt; pushConstant: &#39;test&#39;</div><div>34 <span style="white-space:pre-wrap">        </span>&lt;8E 00 00&gt; popIntoTemp: 0 inVectorAt: 0</div><div>37 <span style="white-space:pre-wrap">        </span>&lt;21&gt; pushConstant: &#39;test2&#39;</div><div>38 <span style="white-space:pre-wrap">        </span>&lt;8D 01 00&gt; storeIntoTemp: 1 inVectorAt: 0</div><div>41 <span style="white-space:pre-wrap">        </span>&lt;7D&gt; blockReturn</div><div>42 &lt;C9&gt; send: value</div><div>43 &lt;87&gt; pop</div><div>44 &lt;8C 01 00&gt; pushTemp: 1 inVectorAt: 0</div><div>47 &lt;D2&gt; send: halt</div><div>48 &lt;7C&gt; returnTop</div></div><div><br></div><div>Really the context should have been stepped over the temp vector initialization code … The way it is now, there is no “selection” at all, the first “step” in the debugger appears to do nothing.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>- Bert -</div></font></span><div><div class="h5"><div><br></div><div><div><br></div><div><blockquote type="cite"><div>On 11.05.2016, at 12:02, Denis Kudriashov &lt;<a href="mailto:dionisiydk@gmail.com" target="_blank">dionisiydk@gmail.com</a>&gt; wrote:</div><br><div><div dir="ltr"><span style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Arial,sans-serif;font-size:14px;line-height:19px"><font>I found reason about it.</font></span><div><font><span style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Arial,sans-serif;font-size:14px;line-height:19px">When message send executed it pops receiver from current stack.</span></font><br></div><div><br></div><div><font face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19px">But anyway it is very confusing to not see receiver as stack top in debugger. Maybe extra field &quot;current receiver&quot; should be added to debugger in that case</span></font></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-05-11 11:51 GMT+02: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">Here better example to see problem:<div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>| t d |</div></div><div><div>[ t := &#39;test&#39;.</div></div><div><div>d := &#39;test2&#39; ] value.</div></div><div><div>t.</div></div><div><div>^ d halt</div></div></blockquote><div><br></div><div>Stack top here will show #(&#39;test&#39; test2&#39;) which is completely confusing</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2016-05-11 11:45 GMT+02: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.<div><br></div><div>Try to debug following script:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>| t |</div></div><div><div>[ t := &#39;test&#39; ] value.</div></div><div><div>^ t halt</div></div></blockquote><div><br></div><div>You will see in debugger #(&#39;test&#39;) as stack top value. Why it is not &#39;test&#39;?</div><div>I understand that hidden arrays used for variables which are used in closures. But why &quot;context top&quot; in that cases points to vector instead of variable value?</div><div><br></div><div>Best regards,</div><div>Denis</div></div>
</blockquote></div></div></div></div></blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></div></blockquote></div><br></div>