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

cmfcmf cmfcmf.flach at gmail.com
Wed Oct 21 13:09:25 UTC 2020


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 <http://forum.world.st/file/t372201/Context2Test.st>  
Context-sendtowithlookupIn.st
<http://forum.world.st/file/t372201/Context-sendtowithlookupIn.st>  



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


More information about the Squeak-dev mailing list