<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Hilaire,<br>
<br>
As usual, for me to be able to help, I need to reproduce the
situation on my machine, so I can debug and understand what's going
on.<br>
<br>
Can you provide a ready made image, or point to instructions on how
to build one?<br>
<br>
Cheers,<br>
<br>
On 4/25/2024 3:01 PM, Hilaire Fernandes via Cuis-dev wrote:
<blockquote cite="mid:f93eff05-0f1d-403e-86a9-a5128aa04b68@free.fr"
type="cite">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<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: none repeat scroll 0% 0% rgb(255, 255,
255); overflow: auto; width: auto; border-style: solid;
border-color: gray; border-width: 0.1em 0.1em 0.1em 0.8em;
padding: 0.2em 0.6em;">
<pre style="margin: 0pt; line-height: 125%;"> <span style="color: rgb(153, 102, 51);">sketchProcess</span> <span style="color: rgb(51, 51, 51);">:=</span> [
(<span style="color: rgb(187, 0, 102); font-weight: bold;">DrGeoSystem</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">preferences</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">at:</span> <span style="color: rgb(170, 102, 0);">#advancedDebugger</span>)
<span style="color: rgb(0, 112, 32);">ifTrue:</span> [<span style="color: rgb(187, 0, 102); font-weight: bold;">Compiler</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">evaluate:</span> <span style="color: rgb(153, 102, 51);">model</span>]
<span style="color: rgb(0, 112, 32);">ifFalse:</span> [
[<span style="color: rgb(187, 0, 102); font-weight: bold;">Compiler</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">evaluate:</span> <span style="color: rgb(153, 102, 51);">model</span>]
<span style="color: rgb(0, 102, 187); font-weight: bold;">on:</span> <span style="color: rgb(187, 0, 102); font-weight: bold;">Exception</span>
<span style="color: rgb(0, 102, 187); font-weight: bold;">do:</span> [<span style="color: rgb(51, 51, 51);">:</span><span style="color: rgb(153, 102, 51);">ex</span> <span style="color: rgb(51, 51, 51);">|</span> <span style="color: rgb(51, 51, 51);">|</span><span style="color: rgb(153, 102, 51);"> myContext </span><span style="color: rgb(51, 51, 51);">|</span>
<span style="color: rgb(153, 102, 51);">myContext</span> <span style="color: rgb(51, 51, 51);">:=</span> <span style="color: rgb(153, 102, 51);">ex</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">signalerContext</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">findContextSuchThat:</span> [<span style="color: rgb(51, 51, 51);">:</span><span style="color: rgb(153, 102, 51);">aContext</span> <span style="color: rgb(51, 51, 51);">|</span>
<span style="color: rgb(153, 102, 51);">aContext</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">method</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">defaultSelector</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">==</span> <span style="color: rgb(170, 102, 0);">#DoIt</span>].
<span style="color: rgb(153, 102, 51);">debugger</span> <span style="color: rgb(51, 51, 51);">:=</span> <span style="color: rgb(187, 0, 102); font-weight: bold;">Debugger</span>
<span style="color: rgb(0, 102, 187); font-weight: bold;">openMinimalDebuggingProcess:</span> <span style="color: rgb(153, 102, 51);">sketchProcess</span>
<span style="color: rgb(0, 102, 187); font-weight: bold;">context:</span> <span style="color: rgb(153, 102, 51);">myContext</span>.
<span style="color: rgb(0, 112, 32);">self</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">plugDebugger</span> ]
].
<span style="color: rgb(153, 102, 51);">sketchProcess</span>
<span style="color: rgb(0, 102, 187); font-weight: bold;">priority:</span> <span style="color: rgb(187, 0, 102); font-weight: bold;">Processor</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">userSchedulingPriority</span> ;
<span style="color: rgb(0, 102, 187); font-weight: bold;">name:</span> <span style="background-color: rgb(255, 240, 240);">'[DrGeo] Smalltalk Sketch execution'</span>;
<span style="color: rgb(0, 102, 187); 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>
...<br>
<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 moz-do-not-send="true" class="moz-txt-link-freetext" href="http://gnu.org/s/dr-geo/">http://gnu.org/s/dr-geo/</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://gnu-drgeo.blogspot.com/">http://gnu-drgeo.blogspot.com/</a></pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich</pre>
</body>
</html>