<div dir="ltr">Hi!<br>I attach some code to be able to step into quick return methods from the debugger, and there's also <a href="https://drive.google.com/file/d/1Iv5-hJ4TNjmR0pG-qm02KpTxCvKzsDZC/view?usp=sharing" target="_blank">a demo video</a>. Being able to step into a quick return method is very useful, especially in situations where we are doing TDD (because the first implementation of a method probably ends up being a quick return).<br><br>Most of these changes were developed during the Camp Smalltalk event of the Smalltalks 2023 conference by me, Juan Vuletich and Felipe Zak (thank you guys!).<br><br>I included automated tests for various debugging scenarios. The class <font face="monospace">QuickReturnDebuggingTest</font> should probably be moved to an appropriate category (it's currently in the "Smalltalks 2023" category, just because the changes were developed during the conference) or be merged into another existing test class (I wasn't sure where to put it).<br><br>ℹ️ Extra interesting info: there are other places in which we're currently treating quick return methods in a special way. See for example <font face="monospace">Debugger>>#contents:notifying:</font>, which handles the special case of a normal method becoming a quick return method after saving the changes on the debugger (the stack frame is removed in that case, try it!). As a curiosity, another quirk related to quick returns is that you cannot debug an expression that will compile to a quick return (e.g. <font face="monospace">^2</font>), the debugger simply doesn't show up! None of this is modified on the code I'm submitting.<br><br>I include a summary of the changes below, that could be useful during code review 👇<br><br>Cheers!<br>Facu<br><div><br><hr style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"></div>📝 Changes summary:<br><ul><li style="margin-left:15px">Do not run a quick return as a primitive in <font face="monospace">ContextPart>>#send:to:with:lookupIn:</font>, treat it as a normal instruction —before which we can stop— and create a new stack frame for it.</li><li style="margin-left:15px">Refactor: extracted an <font face="monospace">isPrimitive</font> variable in <font face="monospace">ContextPart>>#send:to:with:lookupIn:</font>, to avoid having repeated code.</li><li style="margin-left:15px">Changed <font face="monospace">InstructionStream>>#willReturn</font> to include quick returns there. This ends up telling the debugger that it's possible to pause the execution there.</li><li style="margin-left:15px">In <font face="monospace">Process>>#resume</font>, resolve pending quick returns before running <font face="monospace">#primitiveResume</font>, so that the VM can resume the process without having an unexpected stack frame (if you remove this, the VM crashes).</li><li style="margin-left:15px">Refactor: extracted the method <font face="monospace">Debugger class>>#newDebugging:</font>, which is useful for tests (because it does not open the debugger UI).</li></ul></div>