[squeak-dev] Simulation discrepancy with #return:

Eliot Miranda eliot.miranda at gmail.com
Tue Mar 13 16:34:47 UTC 2012


On Tue, Mar 13, 2012 at 3:27 AM, Yoshiki Ohshima <Yoshiki.Ohshima at acm.org>wrote:

>  Hello,
>
> I noticed that step executing the following code in debugger yields
> different results:
>
> -------------------
> test
>
>        3 < 4 ifTrue: [
>                thisContext return: 42].
>        ^ 666.
> -------------------
>
> In the normal execution, you get 42 as expected, but if you debug it
> and step execute, #return: does not actuall return and you get 666.
>
> It appears that the primitive for #terminateTo: is the culprit...
>

I think it is the surrounding usage in the debugger.  The primitive seems
to work as advertised.  But the debugger gets confused as to what is the
correct continuation afterwards.  i note that if one does step into resume:
the right answer is returned, and when that happens doPrimitive:... runs
terminateTo:.  When doing step over resume: then terminateTo: is I think
run via perform:.

Once again this requires a careful (painful?) instrumenting of the debugger
to see what actually happens ;)



>
> -- Yoshiki
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20120313/2ea2871b/attachment.htm


More information about the Squeak-dev mailing list