Fix in transient data holder: remember the last sequence number
Due to this bug the factory was evaluated every time a holder's value
has been read. The reading routine (#value) must remember the current
sequence number when a factory is called in order to properly cache data.
"{ Package: 'jv:libgdbs' }"
"{ NameSpace: Smalltalk }"
Object subclass:#GDBTransientDataHolder
instanceVariableNames:'debugger factory value seqno'
classVariableNames:''
poolDictionaries:''
category:'GDB-Private'
!
!GDBTransientDataHolder class methodsFor:'instance creation'!
debugger: aGDBDebugger factory: aBlock
^ self new setDebugger: aGDBDebugger factory: aBlock
"Created: / 17-09-2014 / 22:08:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GDBTransientDataHolder methodsFor:'accessing'!
value
(value notNil and:[debugger currentInferiorStateSequnceNumber == seqno]) ifTrue:[
^ value.
].
seqno := debugger currentInferiorStateSequnceNumber.
value := factory value.
^ value
"Created: / 17-09-2014 / 22:06:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 10-03-2015 / 00:18:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GDBTransientDataHolder methodsFor:'initialization'!
setDebugger: aGDBDebugger factory: aBlock
debugger := aGDBDebugger.
factory := aBlock.
"Created: / 17-09-2014 / 22:08:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GDBTransientDataHolder class methodsFor:'documentation'!
version_HG
^ '$Changeset: <not expanded> $'
! !