MethodWithBreakpoints.st
author Stefan Vogel <sv@exept.de>
Wed, 29 Jan 2014 14:35:26 +0100
changeset 15922 af9427f065b7
parent 15718 061ac6f47a57
child 15928 c73eba7ee86c
child 18093 2b786a9af1d0
permissions -rw-r--r--
initialize methods

"
 COPYRIGHT (c) 2012 by Claus Gittinger
              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:libbasic' }"

Method variableSubclass:#MethodWithBreakpoints
	instanceVariableNames:'originalMethod'
	classVariableNames:''
	poolDictionaries:''
	category:'Kernel-Methods'
!

!MethodWithBreakpoints class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2012 by Claus Gittinger
              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.
"
!

documentation
"
    support for line-Breakpoints

    instances of me are created when line-breakpoints are placed.
    The only function I serve is to provide the originalMethod information,
    and an easy way to check for having a breakpoint (is breakpointed).

    [author:]
        Claus Gittinger

    [see also:]
        Tools::BreakpointService
"
! !

!MethodWithBreakpoints methodsFor:'accessing'!

originalMethod
    ^ originalMethod
!

originalMethod:something
    originalMethod := something.
! !

!MethodWithBreakpoints methodsFor:'misc'!

restoreOriginalMethod
    "remove myself - i.e. replace by the original method 
     (i.e. the one without line breakpoints)"

    |cls selector|

    (cls := self mclass) notNil ifTrue:[
        (selector := self selector) notNil ifTrue:[
            self breakPoint:#cg.
            cls basicAddSelector:selector withMethod:originalMethod    
        ]
    ]

    "Modified: / 29-08-2013 / 01:17:05 / cg"
! !

!MethodWithBreakpoints methodsFor:'queries'!

isMethodWithBreakpoints
    ^ true

    "Created: / 01-08-2012 / 17:26:59 / cg"
! !

!MethodWithBreakpoints class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic/MethodWithBreakpoints.st,v 1.3 2013-08-28 23:18:23 cg Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/libbasic/MethodWithBreakpoints.st,v 1.3 2013-08-28 23:18:23 cg Exp $'
! !