BreakpointDescription.st
author Claus Gittinger <cg@exept.de>
Fri, 30 Sep 2011 12:29:09 +0200
changeset 2715 10a744f8ce68
parent 2553 32377c387672
child 2793 7809025f7e41
permissions -rw-r--r--
comments

"{ Package: 'stx:libcomp' }"

Object subclass:#BreakpointDescription
	instanceVariableNames:'state condition'
	classVariableNames:''
	poolDictionaries:''
	category:'System-Compiler-Debugging'
!

!BreakpointDescription class methodsFor:'documentation'!

documentation
"
    I describe a breakpoint: its state (enabled/disabled),
    condition, etc.

    I may be shared by multiple instances of Breakpoint,
    since there may be multiple version of same method
    with breakpoints on different position but representing
    the same logical breakpoint (the one use entered).

    [author:]
        Jan Vrany <jan.vrany@fit.cvut.cz>

    [instance variables:]

    [class variables:]

    [see also:]

"
! !

!BreakpointDescription class methodsFor:'instance creation'!

new
    "return an initialized instance"

    ^ self basicNew initialize.
! !

!BreakpointDescription methodsFor:'accessing'!

condition
    ^ condition
!

condition:something
    condition := something.
! !

!BreakpointDescription methodsFor:'initialization'!

initialize
    "Invoked when a new instance is created."

    "/ please change as required (and remove this comment)
    "/ method := nil.
    "/ position := nil.
    "/ condition := nil.
    state := #enabled
    "/ line := nil.

    "/ super initialize.   -- commented since inherited method does nothing

    "Modified: / 17-06-2011 / 13:41:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!BreakpointDescription methodsFor:'support'!

shouldBreakIn: aContext

    state ~~ #enabled ifTrue:[^false].

    (condition isNil or:[condition value: thisContext sender]) ifTrue:[^true].

    ^false

    "Created: / 11-07-2011 / 18:16:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

toggle
    state == #deleted ifTrue:[^self].

    state := (state == #enabled) 
                ifTrue:[#disabled] 
                ifFalse:[#enabled].

    "Created: / 17-06-2011 / 13:40:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (format): / 06-07-2011 / 12:33:10 / cg"
! !

!BreakpointDescription methodsFor:'testing'!

isEnabled

    "Bad coding here, state should be full object"

    ^state == #enabled

    "Created: / 28-06-2011 / 08:27:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!BreakpointDescription class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libcomp/BreakpointDescription.st,v 1.2 2011-07-11 17:27:50 vrany Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/libcomp/BreakpointDescription.st,v 1.2 2011-07-11 17:27:50 vrany Exp $'
! !