<div dir="ltr">Hi Chris,<div><br></div><div>    this won't work as written.  Suspending the active process within a critical: block prevents the critical: block from completing and releasing the lock.  So with the changes as written another debugger won't open when one is already open.</div><div><br></div><div>One should never do this:</div><div><br></div><div>      aMutexOrSemaphore critical:</div><div>            [self doStuff.</div><div>             Processor activeProcess suspend]</div><div><br></div><div>I'm revising these cases to pull the suspend out of the critical block.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 4, 2017 at 1:49 PM,  <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Chris Muller uploaded a new version of Tools to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Tools-cmm.755.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/<wbr>trunk/Tools-cmm.755.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Tools-cmm.755<br>
Author: cmm<br>
Time: 4 April 2017, 3:49:36.354898 pm<br>
UUID: d6acf9c9-c3e4-4076-b2a5-<wbr>9757eefe0b0e<br>
Ancestors: Tools-eem.754<br>
<br>
Fix the race condition introduced with Debugger>>'ErrorRecursion' which resulted in the Emergency Evaluator being opened too eagerly (and unable to be closed!) -- even when there was no recursion.<br>
<br>
=============== Diff against Tools-eem.754 ===============<br>
<br>
Item was changed:<br>
  CodeHolder subclass: #Debugger<br>
        instanceVariableNames: 'interruptedProcess interruptedController contextStack contextStackIndex contextStackList receiverInspector contextVariablesInspector externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject errorWasInUIProcess labelString message untilExpression'<br>
+       classVariableNames: 'ContextStackKeystrokes ErrorRecursion ErrorRecursionGuard ErrorReportServer InterruptUIProcessIfBlockedOnE<wbr>rrorInBackgroundProcess WantsAnnotationPane'<br>
-       classVariableNames: 'ContextStackKeystrokes ErrorRecursion ErrorReportServer InterruptUIProcessIfBlockedOnE<wbr>rrorInBackgroundProcess WantsAnnotationPane'<br>
        poolDictionaries: ''<br>
        category: 'Tools-Debugger'!<br>
<br>
  !Debugger commentStamp: '<historical>' prior: 0!<br>
  I represent the machine state at the time of an interrupted process. I also represent a query path into the state of the process. The debugger is typically viewed through a window that views the stack of suspended contexts, the code for, and execution point in, the currently selected message, and inspectors on both the receiver of the currently selected message, and the variables in the current context.<br>
<br>
  Special note on recursive errors:<br>
  Some errors affect Squeak's ability to present a debugger.  This is normally an unrecoverable situation.  However, if such an error occurs in an isolation layer, Squeak will attempt to exit from the isolation layer and then present a debugger.  Here is the chain of events in such a recovery.<br>
<br>
        * A recursive error is detected.<br>
        * The current project is queried for an isolationHead<br>
        * Changes in the isolationHead are revoked<br>
        * The parent project of isolated project is returned to<br>
        * The debugger is opened there and execution resumes.<br>
<br>
  If the user closes that debugger, execution continues in the outer project and layer.  If, after repairing some damage, the user proceeds from the debugger, then the isolationHead is re-invoked, the failed project is re-entered, and execution resumes in that world. !<br>
<br>
Item was changed:<br>
  ----- Method: Debugger class>>initialize (in category 'class initialization') -----<br>
  initialize<br>
        ErrorRecursion := false.<br>
+       ErrorRecursionGuard := Mutex new.<br>
        ContextStackKeystrokes := Dictionary new<br>
                at: $e put: #send;<br>
                at: $t put: #doStep;<br>
                at: $T put: #stepIntoBlock;<br>
                at: $p put: #proceed;<br>
                at: $r put: #restart;<br>
                at: $f put: #fullStack;<br>
                at: $w put: #where;<br>
                yourself.<br>
<br>
        "Debugger initialize"!<br>
<br>
Item was changed:<br>
+ (PackageInfo named: 'Tools') postscript: 'Debugger initialize.'!<br>
- (PackageInfo named: 'Tools') postscript: 'ProcessBrowser initialize.'!<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div>