Breakpoint.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 11 Jul 2011 19:23:33 +0200
changeset 2551 4470029ad63a
parent 2545 da9e57300192
child 2554 31516fc84824
permissions -rw-r--r--
Breakpoint state extracted to BreakpointDescription object

"
 COPYRIGHT (c) 2006 by eXept Software AG
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libcomp' }"

Object subclass:#Breakpoint
	instanceVariableNames:'method position description line isReached'
	classVariableNames:''
	poolDictionaries:''
	category:'System-Compiler-Debugging'
!

!Breakpoint class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2006 by eXept Software AG
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
! !

!Breakpoint class methodsFor:'instance creation'!

new
    "return an initialized instance"

    ^ self basicNew initialize.
! !

!Breakpoint methodsFor:'accessing'!

description
    ^ description
!

description:aBreakpointDescription
    description := aBreakpointDescription.
!

isReached
    ^ isReached
!

isReached:aBoolean
    isReached := aBoolean.
!

line
    ^ line
!

line:anInteger
    line := anInteger.
!

position
    ^ position
!

position:something
    position := something.
! !

!Breakpoint methodsFor:'initialization'!

initialize
    "Invoked when a new instance is created."

    "/ please change as required (and remove this comment)
    "/ method := nil.
    "/ position := nil.
    description := BreakpointDescription new.
    "/ line := nil.

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

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

!Breakpoint methodsFor:'printing & storing'!

printOn:aStream
    "append a printed representation if the receiver to the argument, aStream"

    aStream
        nextPutAll: 'BPNT';
        nextPut:    $(;
        nextPutAll: position printString;
        nextPut:    $).

    "Modified: / 16-06-2011 / 14:48:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!Breakpoint methodsFor:'support'!

break
    "invoked by the breakPoint's code (see BreakPointNode)"

    <resource: #skipInDebuggersWalkBack>

    (description shouldBreakIn: thisContext sender) ifTrue:[
        HaltSignal
            raiseRequestWith: self
            errorString:('Breakpoint encountered at line %1' bindWith:self line)
            in:thisContext sender.
    ]

    "Created: / 15-06-2011 / 12:48:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 06-07-2011 / 10:11:55 / cg"
    "Modified: / 11-07-2011 / 18:17:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

toggle

    description toggle

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

!Breakpoint methodsFor:'testing'!

isEnabled

    "Bad coding here, state should be full object"

    ^description isEnabled

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

!Breakpoint class methodsFor:'documentation'!

version_CVS
    ^ '$Header: /cvs/stx/stx/libcomp/Breakpoint.st,v 1.4 2011-07-11 17:23:33 vrany Exp $'
!

version_SVN
    ^ '§ Id §'
! !