[Cuis-dev] Context in Exception

Juan Vuletich juan at cuis.st
Fri Apr 26 12:40:05 PDT 2024


Hi Hilaire,

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.

Can you provide a ready made image, or point to instructions on how to 
build one?

Cheers,

On 4/25/2024 3:01 PM, Hilaire Fernandes via Cuis-dev wrote:
>
> Hi,
>
> I will need some help there because this is uncharted territory for me.
>
> 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.
>
> What I do is this:
>
> 	sketchProcess  :=  [
> 		(DrGeoSystem  preferences  at:  #advancedDebugger)
> 			ifTrue:  [Compiler  evaluate:  model]
> 			ifFalse:  [
> 				[Compiler  evaluate:  model]
> 					on:  Exception
> 					do:  [:ex  |  |  myContext|
> 						myContext  :=  ex  signalerContext  findContextSuchThat:  [:aContext  |
> 							aContext  method  defaultSelector  ==  #DoIt].
> 					debugger  :=  Debugger
> 							openMinimalDebuggingProcess:  sketchProcess
> 							context:  myContext.
> 					self  plugDebugger  ]
> 			].
> 	sketchProcess
> 		priority:  Processor  userSchedulingPriority  ;
> 		name:  '[DrGeo] Smalltalk Sketch execution';
> 		resume.
>
>
> 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:
>
>     Debugger openProcess: sketchProcess context: myContext label: 'Debug'
>
> the variable values are ok. I tried to mimic the behavior of the 
> regular debugger, but I likely miss something.
>
> ...
>
>
> Thanks
>
> -- 
> GNU Dr. Geo
> http://gnu.org/s/dr-geo/
> http://gnu-drgeo.blogspot.com/


-- 
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240426/da2e1d49/attachment.htm>


More information about the Cuis-dev mailing list