[Cuis-dev] Debug leads a locked UI

Hilaire Fernandes hfern at free.fr
Tue Feb 21 12:41:14 PST 2023


Hi,

I tested latest DrGeo with my students last Friday. There are very good 
bug discoverers! My plate is full.

It is in the context of programming Smalltalk sketch. So we use the 
SmalltalkSketchEditor of DrGeo with its minimalist debugger.

One student found that when hitting the "Step by Step" button of the 
editor when there is an empty code to compile, leads to an infinite loop 
(hopefully breakable with alt-[.])

The problem also occurs with simple code as "1".

I don't understand the arcane of the debugger and related compiler 
stuff, so help will be welcome to found out. I enclosed the debug log.

The involved methods are the my init of the debugger session:

*DrGSmalltalkEditor>>debugSketch*
     "model ifEmpty: [^ self]."
     self stopSketch.
     self isDocVisible ifTrue: [self toggleHelp].
     codeView scroller acceptContents.
     codeView editor
         afterCompiling: model
         do:  [ :compiler :method :receiver :context | method ifNotNil: [
             debugger _ Debugger
                 openMinimalDebugging: [
                     method
                         valueWithReceiver: receiver
                         arguments: (context ifNil: [ #() ] ifNotNil: [ 
{ context } ])]
                 to: method.
             debugger layoutMorph borderWidth: 1.
             codeAndViewPanel replaceSubmorph: codeView by: debugger 
layoutMorph.
             debugger model when: #closeViews send: #stopDebbuger to: self.
             debugger     contextVariableInspector selectionIndex: 3.]
             ]
         ifFail: [].

and

*Debugger class>>openMinimalDebugging: aBlock to: aCompiledMethod *
     "Create a new process to debug aBlock, and step into it."

     | processToDebug debugger window |
     debugger _ self new.
     processToDebug _ aBlock newProcess name: 'debugIt'.
     debugger process: processToDebug context: processToDebug 
suspendedContext.
     window _ debugger openMinimalMorphic.
     [debugger interruptedContext method == aCompiledMethod]
         whileFalse: [debugger send].
     ^ window


Then image is stuck in the method***doPrimitive: primitiveIndex method: 
meth receiver: receiver args: arguments*

I also observed in this method several messages**are unimplemented 
methods (colored in red in the Browser)

I can't tell if it is a problem of Cuis or DrGeo...

If one want to experiment the bug, just download latest DrGeo at 
http://dev.drgeo.eu and open its Smalltalk Sketch editor from the world 
menu then hit the "step by step" iconic button.

Thanks

Hilaire

-- 
GNU Dr. Geo
http://drgeo.eu
http://blog.drgeo.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230221/0fca8cd5/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CuisDebug-2023-02-21_21.25.39.log
Type: text/x-log
Size: 30414 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230221/0fca8cd5/attachment-0001.bin>


More information about the Cuis-dev mailing list