<!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">I come to this solution but it is not that great.
Because I lost the variable name, may be it could be good to
have the stack but this adds complexity, that's why I removed it
in my mini pluggable debugger. Anyway, from the exception (<i>ex</i>)
</font><font size="4">it searches </font><font size="4">the
context with the method named #DoIt.<br>
</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: #0066BB; font-weight: bold">executeSketch</span>
<span style="color: #007020">self</span> <span
style="color: #0066BB; font-weight: bold">stopSketch</span>.
<span style="color: #996633">codeView</span> <span
style="color: #0066BB; font-weight: bold">scroller</span> <span
style="color: #0066BB; font-weight: bold">acceptContents</span>.
<span style="color: #007020">self</span> <span
style="color: #0066BB; font-weight: bold">switchToPauseButton</span>.
<span style="color: #BB0066; font-weight: bold">DrGeoSketch</span> <span
style="color: #0066BB; font-weight: bold">when:</span> <span
style="color: #AA6600">#newSmalltalkSketch</span> <span
style="color: #0066BB; font-weight: bold">send:</span> <span
style="color: #AA6600">#compiledSketch:</span> <span
style="color: #0066BB; font-weight: bold">to:</span> <span
style="color: #007020">self</span>.
<span style="color: #996633">sketchProcess</span> <span
style="color: #333333">:=</span> [ <span style="color: #333333">|</span> <span
style="color: #996633">t</span> <span
style="color: #0066BB; font-weight: bold">|</span>
<span style="color: #996633">t</span> <span style="color: #333333">:=</span> <span
style="color: #BB0066; font-weight: bold">DateAndTime</span> <span
style="color: #0066BB; font-weight: bold">now</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: #888888">" When we get there, sketch has been entirely executed, switch back to play button "</span>
<span style="color: #007020">self</span> <span
style="color: #0066BB; font-weight: bold">switchToPlayButton</span>.
<span style="color: #BB0066; font-weight: bold">Transcript</span> <span
style="color: #0066BB; font-weight: bold">show:</span> <span
style="color: #BB0066; font-weight: bold">DateAndTime</span> <span
style="color: #0066BB; font-weight: bold">now</span> <span
style="color: #0066BB; font-weight: bold">-</span> <span
style="color: #996633">t</span> ;<span
style="color: #0066BB; font-weight: bold">cr</span>] <span
style="color: #0066BB; font-weight: bold">newProcess</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">It looks like as below in the sketch editor. The
name of the variable is lost and there is this strange DoIt as
the method name. <br>
</font></p>
<img moz-do-not-send="false"
src="cid:part1.nG5ZpnRj.0kUAEvUo@free.fr" alt="debug" width="715"
height="532">
<p><font size="4"><br>
</font></p>
<p><font size="4">What am I missing to get the variable name in the
debugger? The user edited code looks like below, there is one
variable named <i>fig</i> which is present in the debugger
under the name <i>temp1</i>. It will be confusing for the user
to read her code presented differently.<br>
</font></p>
<img moz-do-not-send="false"
src="cid:part2.ZGS7U1E0.PNT16lzK@free.fr" alt="user edit"
width="396" height="272">
<p><font size="4">Progressing on the issue...<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>