<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Christoph, hi all.<div><br></div><div>I would like to continue the discussion about this proposal based on the current Trunk #20404 and <span style="font-size: 10pt"><a href="http://forum.world.st/The-Trunk-Morphic-mt-1751-mcz-tp5128614p5128621.html" style="font-size: 10pt">http://forum.world.st/The-Trunk-Morphic-mt-1751-mcz-tp5128614p5128621.html</a>.</span></div><div><span style="font-size: 10pt"><br></span></div><div><span style="font-size: 10pt">At the moment, we have a "#...ContextThat:" lookup in Processor(Scheduler) to find the signaler context of an exception. This proposal includes such a lookup for manually constructed and (</span><span style="font-size: 13.3333px">explicitly)</span><span style="font-size: 10pt"> simulated processes via Process.</span></div><div><span style="font-size: 10pt"><br></span></div><div>As a client, I think that Process class >> #forBlock:runUntil: is sufficient. Especially that check for #isTerminated with an interactive notice might not be wanted in all cases. Hmm...</div><div><br></div><div>Best,</div><div>Marcel</div><div><span style="font-size: 10pt"><br></span></div><div><br></div><div><br></div><div class="mb_sig"></div>
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 29.03.2020 14:36:22 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style="font-family:Arial,Helvetica,sans-serif">Christoph Thiede uploaded a new version of System to project The Inbox:<br>http://source.squeak.org/inbox/System-ct.1149.mcz<br><br>==================== Summary ====================<br><br>Name: System-ct.1149<br>Author: ct<br>Time: 29 March 2020, 1:35:58.40756 pm<br>UUID: 1bf6e87f-fc73-7747-af4d-df3e339a0627<br>Ancestors: System-ul.1148<br><br>Proposal: Add some convenience methods for debugging blocks. See examples in #debugFromContextThat:title:.<br><br>While I know that we already talked about the sense of convenience methods that are not actually used in the base system, I think that these ones actually add value and should be used in the base system. We are experiencing an ascending number of methods that implement "debugging of a specific action", such as "debug action" and "debug get-list invocation" in Morphic, or "debug test" in SUnit (see SUnit-ct.125). As they have little duplication at the moment, it is also hard to make them more convenient: For example, if you try to debug a test case that overrides #performTest in a way that it does not actually invoke the test selector; or for another example, if you try to debug the action of a morphic button that we do not support properly at the moment (e. g. the buttons in a UserDialogBox), the current approach opens a debugger on a terminated process on #newProcess. If we follow this suggestion to refactor that behavior into one place, this will allow us to be a bit smarter and mo<br> re convenient, as you can see in the edge case in #debugFromContextThat:title:. My follow-up proposal would thus be to call this convenience methods from all implementors of #debugAction & Co. This commit also tries to solve the issue mentioned in [1].<br><br>However, I'm not sure whether BlockClosure is the optimal place for this. I am open for your suggestions to move this somewhere else, for example into Debugger, Process or ToolSet.<br><br>[1] http://forum.world.st/The-Inbox-Morphic-ct-1590-mcz-tp5106996p5107059.html<br><br>=============== Diff against System-ul.1148 ===============<br><br>Item was added:<br>+ ----- Method: BlockClosure>>debug (in category '*System-debugging') -----<br>+ debug<br>+ <br>+       ^ self debugWithTitle: nil!<br><br>Item was added:<br>+ ----- Method: BlockClosure>>debugFromContextThat: (in category '*System-debugging') -----<br>+ debugFromContextThat: contextBlock<br>+ <br>+  ^ self debugFromContextThat: contextBlock title: nil!<br><br>Item was added:<br>+ ----- Method: BlockClosure>>debugFromContextThat:title: (in category '*System-debugging') -----<br>+ debugFromContextThat: contextBlock title: title<br>+         "Evaluate the receiver on a new process (synchronously). Once the contextBlock criterium is satisfied, open a debugger on that process. If the criterium is never satisfied until the process terminates, offer the user to debug the receiver again without waiting for contextBlock again.<br>+    <br>+     [self halt] debug.<br>+   [15 factorial] debugWithTitle: 'Fun with Math!!'.<br>+    [self inform: #foo] debugFromContextThat: [:ctxt | ctxt receiver isMorph] title: 'Debug dialog invocation'.<br>+  [15 factorial] debugFromContextThat: [:ctxt | ctxt selector = #+]."<br>+ <br>+         | process |<br>+  process := self newProcess.<br>+  process runUntil: contextBlock.<br>+      process isTerminated ifTrue: [<br>+               ^ (self confirm: 'Did not reach the desired piece of code.\Would you like to debug the whole process again?' withCRs translated)<br>+                     ifTrue: [self debugWithTitle: title]<br>+                         ifFalse: [self]].<br>+    ^ process debugWithTitle: title!<br><br>Item was added:<br>+ ----- Method: BlockClosure>>debugWithTitle: (in category '*System-debugging') -----<br>+ debugWithTitle: title<br>+ <br>+        ^ self<br>+               debugFromContextThat: [:ctx | ctx closure == self]<br>+           title: title!<br><br><br></div></blockquote></div>