<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>And because two pictures say more than two-thousand words ...</p>
<p><br>
</p>
<p><img size="41628" contenttype="image/png" id="img635790" style="max-width: 99.9%; user-select: none;" contextid="img327407" tabindex="0" src="cid:199fca0b-9899-401f-bc76-4e481cc26545"><br>
</p>
<p><br>
</p>
<p>If you choose the first option, everything will behave as usual. If you choose the second option, a second debugger will open:</p>
<p><br>
</p>
<p><img size="24369" contenttype="image/png" id="img362291" style="max-width: 99.9%; user-select: none;" contextid="img686849" tabindex="0" src="cid:eafe9018-ab85-4001-be49-dbe183539cc4"><br>
</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Thiede, Christoph<br>
<b>Gesendet:</b> Sonntag, 6. Februar 2022 21:02:17<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> Re: [squeak-dev] Debugging through #fork</font>
<div> </div>
</div>
<div>Hi all,<br>
<br>
please see the attached changeset which implements "debugging through fork" based on SimulationSideEffect. Please load SimulationSideEffectWarning.5.cs before loading the attached changeset.<br>
<br>
Hope you like it! Still, I did not withdraw my caveats from my previous message, so maybe we should test this change for some more time. I would recommend merging this patch after the release (but SimulationSideEffect) before the release. Looking forward to
 your opinions. :-)<br>
<br>
Best,<br>
Christoph<br>
<br>
<b>=============== Summary ===============</b><br>
<br>
Change Set:        debugFork<br>
Date:            6 February 2022<br>
Author:            Christoph Thiede<br>
<br>
This changeset allows to debug forked/resumed processes. When users steps through/into a send that will resume another process, they are presented a small dialog to either resume the process or debug it.<br>
<br>
See: http://lists.squeakfoundation.org/pipermail/squeak-dev/2022-January/218552.html<br>
<br>
<b>=============== Diff ===============</b><br>
<br>
<b>Debugger>>handleLabelUpdatesIn:whenExecuting: {context stack menu} · ct 2/6/2022 20:40 (changed)</b><br>
handleLabelUpdatesIn: aBlock whenExecuting: aContext<br>
    "Send the selected message in the accessed method, and regain control <br>
    after the invoked method returns."<br>
    <br>
    ^aBlock<br>
        on: Notification<br>
        do: [:ex|<br>
            (ex tag isArray<br>
             and: [ex tag size = 2<br>
             and: [(ex tag first == aContext or: [ex tag first hasSender: aContext])]])<br>
                ifTrue:<br>
                    [self labelString: ex tag second description.<br>
                     ex resume]<br>
                ifFalse:<br>
<s><font color="#0000FF">-                     [ex pass]]<br>
</font></s><font color="#FF0000">+                     [ex pass]]<br>
+         on: SimulationSideEffectWarning<br>
+         do: [:ex |<br>
+             ex isControlPrimitive ifTrue: [ex unsuppress].<br>
+             ex primitive = 87 "primitiveResume" ifTrue:<br>
+                 [| process |<br>
+                 process := ex theReceiver.<br>
+                 (Project uiManager<br>
+                     chooseFromLabeledValues: (OrderedDictionary new<br>
+                         at: 'Continue and resume (default)' translated put: [ex resume];<br>
+                         at: 'Debug the new process' translated put: [process debug. ex skipPrimitive];<br>
+                         yourself)<br>
+                     title: ('The process you are debugging is starting or resuming another process:\\    {1}\\Would you like to debug the new process?' withCRs translated asText format: {process printString asText<br>
+                         allBold;<br>
+                         addAttribute: (TextInspectIt on: process);<br>
+                         yourself})) value].<br>
+             ex pass]</font><br>
<br>
<br>
<font color="#808080">---<br>
</font><font color="#808080"><i>Sent from </i></font><font color="#808080"><i><a href="https://github.com/hpi-swa-lab/squeak-inbox-talk"><u><font color="#808080">Squeak Inbox Talk</font></u></a></i></font><br>
<br>
On 2022-02-06T19:44:24+01:00, christoph.thiede@student.hpi.uni-potsdam.de wrote:<br>
<br>
> Hi all,<br>
> <br>
> I would be cautious with adding such a feature since it would be likely to overflow you with redundant debuggers when you are stepping "through" some very complex operation. Still, I see your need for such a feature and thank this might be a nice extra feature,
 maybe as an opt-in or when combined with some clever heuristics.<br>
> <br>
> On the implementation side, detecting the resumption of a process during simulating is pretty easy. See SimulationSideEffectWarning [1] which prepares the simulator for reacting to these events conveniently from the debugger. Maybe I should revise and merge
 this one soon. :-)<br>
> <br>
> Best,<br>
> Christoph<br>
> <br>
> [1] http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-May/215469.html<br>
> <br>
> ---<br>
> Sent from Squeak Inbox Talk<br>
> <br>
> On 2022-01-22T19:48:24-06:00, asqueaker at gmail.com wrote:<br>
> <br>
> > > Dear Squeakers,<br>
> > ><br>
> > > I was just asking myself, why we cannot debug process forking like this:<br>
> > ><br>
> > > 0. In the Debugger: [ self doSomething ] "--> next send" fork. nextStatement.<br>
> > > 1. Press the Through button.<br>
> > > 2. The debugger stops at the next step after the send of #fork: [ self<br>
> > > doSomething ] fork. "-->" nextStatement.<br>
> > > 3. A second full debugger opens on the new (and now suspended)<br>
> > > process: [ self "-->" doSomething ] fork. nextStatement.<br>
> > <br>
> > I would love that!<br>
> > <br>
> > <br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220206/f367d25e/attachment.html><br>
> <br>
> <br>
["debugFork.1.cs"]</div>
</body>
</html>