[Vm-dev] Freeze after Morph Activity
Dan Norton
dnorton at mindspring.com
Tue Jan 31 01:35:43 UTC 2017
Attached is a few lines of code which can reproduce the problem. File it
in then do:
Tokenish start
in a Cuis workspace. You may have to let it run for a while, the time to
failure is not predictable. Starting multiples of them may bring the
freeze sooner.
- Dan
On 01/30/2017 04:23 PM, Bert Freudenberg wrote:
>
>
>
> On Mon, Jan 30, 2017 at 9:43 PM, Dan Norton <dnorton at mindspring.com
> <mailto:dnorton at mindspring.com>> wrote:
>
>
> When a freeze occurs, it's usually(tm) during an animation,
> probably because the movement of an ellipse is done in small
> increments of 92 per hop. This is within a block like so:
>
>
> self when: #morphicStep evaluate: [ :delta | <movement> ].
>
> self startSteppingStepTime: step.
>
> How can the breakpoint be set in this block for gdb? We need
> source for some C module.
>
>
> With gdb you can't debug at the Smalltalk level (that's what alt-. is
> for). You can only attach to the process, break into it and figure out
> what's going on. Which may be very hard. Also, you may have to compile
> your own VM with debug info (or do we have pre-built ones somewhrere?)
>
> - Bert -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170130/071908be/attachment.html>
-------------- next part --------------
'From Cuis 5.0 of 7 November 2016 [latest update: #3043] on 30 January 2017 at 6:16:24 pm'!
!classDefinition: #Tokenish category: #'Game-Graphics'!
EllipseMorph subclass: #Tokenish
instanceVariableNames: ''
classVariableNames: 'HopVComponent'
poolDictionaries: ''
category: 'Game-Graphics'!
!Tokenish commentStamp: '<historical>' prior: 0!
A player's piece on the game board.!
!Tokenish methodsFor: 'stepping' stamp: 'dhn 1/30/2017 18:07:59'!
jump
"Make the receiver hop"
| step limit i hop horiz |
step _ 4. "time of each increment of the hop"
hop _ self class hopVComponent.
limit _ 1000000. "hack"
horiz _ 0. "hack"
i _ 0.
self when: #morphicStep evaluate: [ :delta |
i _ i + 1.
i < limit
ifTrue: [self morphPosition: (self morphPosition translatedBy: horiz@(hop atWrap: i))]
ifFalse: [
self stopStepping.
self triggerEvent: #jumped.
self removeActionsForEvent: #morphicStep]].
self startSteppingStepTime: step.
! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
!classDefinition: 'Tokenish class' category: #'Game-Graphics'!
Tokenish class
instanceVariableNames: ''!
!Tokenish class methodsFor: 'instance creation' stamp: 'dhn 1/30/2017 17:53:15'!
setupHop
"Answer the vertical component of a jump"
| col up |
up _ OrderedCollection new.
col _ OrderedCollection new.
0 to: 45 do: [:i | up add: ((i * 2) degreesToRadians cos * 2) negated].
col _ col addAll: up; yourself.
col _ col addAll: up reversed negated; yourself.
^ col! !
!Tokenish class methodsFor: 'instance creation' stamp: 'dhn 1/30/2017 18:13:49'!
start
^ (self new openInHand) jump! !
!Tokenish class methodsFor: 'operation' stamp: 'dhn 1/30/2017 17:53:15'!
hopVComponent
"Answer the value of HopVComponent"
HopVComponent ifNil: [HopVComponent _ self setupHop].
^ HopVComponent! !
More information about the Vm-dev
mailing list