[squeak-dev] Debugger / Simulator cannot simulate (some) objects as methods

Marcel Taeumel marcel.taeumel at hpi.de
Wed Oct 21 13:40:50 UTC 2020


Hi Christan,

the object-as-method support in the debuuger and code simulator has never been good. :-( Not back in Squeak 3.x, not now. Maybe we can fix some of the most urgent bugs. :-)

Best,
Marcel
Am 21.10.2020 15:09:35 schrieb cmfcmf <cmfcmf.flach at gmail.com>:
Hi,

when using simple objects as methods, the simulator (and therefore the
debugger also) raises an error if the object used as method does not
implement certain methods from CompiledMethod (e.g., numArgs). If such code
is debugged, the debugger opens a never-ending stream of error windows.

I am under the (possibly wrong) assumption that objects as methods should
_not_ need to implement the complete CompiledMethod protocol to be
compatible with simulation and debugging.

I have attached a failing test called Context2Test that uses the simulator
to simulate a call of an object as method. You can also see the
"never-ending stream of error windows" by placing a "self halt" at the top
of the test and then stepping through the first assertion using the "over"
button. WARNING: Might make your image unusable.

The root cause is the Context >> #send:to:with:lookupIn: method which
assumes that all methods are CompiledMethods. I have attached a simple fix
that works great for me – let me know what you think about it.

Best
Christian

Context2Test.st
Context-sendtowithlookupIn.st




--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20201021/e2bc4f60/attachment.html>


More information about the Squeak-dev mailing list