And because two pictures say more than two-thousand words ...

If you choose the first option, everything will behave as usual. If you choose the second option, a second debugger will open:



Von: Squeak-dev <> im Auftrag von Thiede, Christoph
Gesendet: Sonntag, 6. Februar 2022 21:02:17
Betreff: Re: [squeak-dev] Debugging through #fork
Hi all,

please see the attached changeset which implements "debugging through fork" based on SimulationSideEffect. Please load SimulationSideEffectWarning.5.cs before loading the attached changeset.

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. :-)


=============== Summary ===============

Change Set:        debugFork
Date:            6 February 2022
Author:            Christoph Thiede

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.


=============== Diff ===============

Debugger>>handleLabelUpdatesIn:whenExecuting: {context stack menu} ct 2/6/2022 20:40 (changed)
handleLabelUpdatesIn: aBlock whenExecuting: aContext
    "Send the selected message in the accessed method, and regain control
    after the invoked method returns."
        on: Notification
        do: [:ex|
            (ex tag isArray
             and: [ex tag size = 2
             and: [(ex tag first == aContext or: [ex tag first hasSender: aContext])]])
                    [self labelString: ex tag second description.
                     ex resume]
-                     [ex pass]]
+                     [ex pass]]
+         on: SimulationSideEffectWarning
+         do: [:ex |
+             ex isControlPrimitive ifTrue: [ex unsuppress].
+             ex primitive = 87 "primitiveResume" ifTrue:
+                 [| process |
+                 process := ex theReceiver.
+                 (Project uiManager
+                     chooseFromLabeledValues: (OrderedDictionary new
+                         at: 'Continue and resume (default)' translated put: [ex resume];
+                         at: 'Debug the new process' translated put: [process debug. ex skipPrimitive];
+                         yourself)
+                     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
+                         allBold;
+                         addAttribute: (TextInspectIt on: process);
+                         yourself})) value].
+             ex pass]

Sent from Squeak Inbox Talk

On 2022-02-06T19:44:24+01:00, wrote:

> Hi all,
> 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.
> 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. :-)
> Best,
> Christoph
> [1]
> ---
> Sent from Squeak Inbox Talk
> On 2022-01-22T19:48:24-06:00, asqueaker at wrote:
> > > Dear Squeakers,
> > >
> > > I was just asking myself, why we cannot debug process forking like this:
> > >
> > > 0. In the Debugger: [ self doSomething ] "--> next send" fork. nextStatement.
> > > 1. Press the Through button.
> > > 2. The debugger stops at the next step after the send of #fork: [ self
> > > doSomething ] fork. "-->" nextStatement.
> > > 3. A second full debugger opens on the new (and now suspended)
> > > process: [ self "-->" doSomething ] fork. nextStatement.
> >
> > I would love that!
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <>