<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><font size="4">Hi, <br>
      </font></p>
    <p><font size="4">I will need some help there because this is
        uncharted territory for me.<br>
      </font></p>
    <p><font size="4">When the user executes a faulty Smalltalk sketch,
        I want to catch the exception and present the error in a
        simplified debugger. To not help, the Smalltalk sketch is
        evaluated in a low priority process, so the GUI remain
        interactive.</font></p>
    <p><font size="4">What I do is this:</font></p>
    <p><!-- HTML generated using hilite.me --></p>
    <div
style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;">
      <pre style="margin: 0; line-height: 125%">        <span
      style="color: #996633">sketchProcess</span> <span
      style="color: #333333">:=</span> [ 
                (<span style="color: #BB0066; font-weight: bold">DrGeoSystem</span> <span
      style="color: #0066BB; font-weight: bold">preferences</span> <span
      style="color: #0066BB; font-weight: bold">at:</span> <span
      style="color: #AA6600">#advancedDebugger</span>) 
                        <span style="color: #007020">ifTrue:</span> [<span
      style="color: #BB0066; font-weight: bold">Compiler</span> <span
      style="color: #0066BB; font-weight: bold">evaluate:</span> <span
      style="color: #996633">model</span>]
                        <span style="color: #007020">ifFalse:</span> [
                                [<span style="color: #BB0066; font-weight: bold">Compiler</span> <span
      style="color: #0066BB; font-weight: bold">evaluate:</span> <span
      style="color: #996633">model</span>] 
                                        <span style="color: #0066BB; font-weight: bold">on:</span> <span
      style="color: #BB0066; font-weight: bold">Exception</span> 
                                        <span style="color: #0066BB; font-weight: bold">do:</span> [<span
      style="color: #333333">:</span><span style="color: #996633">ex</span> <span
      style="color: #333333">|</span> <span style="color: #333333">|</span><span
      style="color: #996633"> myContext </span><span
      style="color: #333333">|</span>
                                                <span style="color: #996633">myContext</span> <span
      style="color: #333333">:=</span> <span style="color: #996633">ex</span> <span
      style="color: #0066BB; font-weight: bold">signalerContext</span> <span
      style="color: #0066BB; font-weight: bold">findContextSuchThat:</span> [<span
      style="color: #333333">:</span><span style="color: #996633">aContext</span> <span
      style="color: #333333">|</span> 
                                                        <span style="color: #996633">aContext</span> <span
      style="color: #0066BB; font-weight: bold">method</span> <span
      style="color: #0066BB; font-weight: bold">defaultSelector</span> <span
      style="color: #0066BB; font-weight: bold">==</span> <span
      style="color: #AA6600">#DoIt</span>].
                                        <span style="color: #996633">debugger</span> <span
      style="color: #333333">:=</span> <span
      style="color: #BB0066; font-weight: bold">Debugger</span> 
                                                        <span style="color: #0066BB; font-weight: bold">openMinimalDebuggingProcess:</span> <span
      style="color: #996633">sketchProcess</span> 
                                                        <span style="color: #0066BB; font-weight: bold">context:</span> <span
      style="color: #996633">myContext</span>.
                                        <span style="color: #007020">self</span> <span
      style="color: #0066BB; font-weight: bold">plugDebugger</span> ]
                        ].
        <span style="color: #996633">sketchProcess</span> 
                <span style="color: #0066BB; font-weight: bold">priority:</span> <span
      style="color: #BB0066; font-weight: bold">Processor</span> <span
      style="color: #0066BB; font-weight: bold">userSchedulingPriority</span> ;
                <span style="color: #0066BB; font-weight: bold">name:</span> <span
      style="background-color: #fff0f0">'[DrGeo] Smalltalk Sketch execution'</span>;
                <span style="color: #0066BB; font-weight: bold">resume</span>.
</pre>
    </div>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">Sadly, when I present the error with my
        MinimalDebbugger all the variables within the script are nil
        (see screenshot below). When  instead I use the standard
        Debugger with: <br>
      </font></p>
    <p><font size="4">    Debugger openProcess: sketchProcess context:
        myContext label: 'Debug'<br>
      </font></p>
    <p><font size="4">the variable values are ok. I tried to mimic the
        behavior of the regular debugger, but I likely miss something.<br>
      </font></p>
    <img moz-do-not-send="false"
      src="cid:part1.0PLd27Tz.6NBl0vfQ@free.fr" alt="debug" width="915"
      height="588">
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">Thanks<br>
      </font></p>
    <pre class="moz-signature" cols="72">-- 
GNU Dr. Geo
<a class="moz-txt-link-freetext" href="http://gnu.org/s/dr-geo/">http://gnu.org/s/dr-geo/</a>
<a class="moz-txt-link-freetext" href="http://gnu-drgeo.blogspot.com/">http://gnu-drgeo.blogspot.com/</a></pre>
  </body>
</html>