author | Claus Gittinger <cg@exept.de> |
Wed, 20 Jul 2011 20:16:33 +0200 | |
changeset 2571 | b441a3fc0ce6 |
parent 2553 | 32377c387672 |
child 2793 | 7809025f7e41 |
permissions | -rw-r--r-- |
2552 | 1 |
"{ Package: 'stx:libcomp' }" |
2 |
||
3 |
Object subclass:#BreakpointDescription |
|
4 |
instanceVariableNames:'state condition' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
7 |
category:'System-Compiler-Debugging' |
|
8 |
! |
|
9 |
||
10 |
!BreakpointDescription class methodsFor:'documentation'! |
|
11 |
||
12 |
documentation |
|
13 |
" |
|
14 |
I describe a breakpoint: its state (enabled/disabled), |
|
15 |
condition, etc. |
|
16 |
||
17 |
I may be shared by multiple instances of Breakpoint, |
|
18 |
since there may be multiple version of same method |
|
19 |
with breakpoints on different position but representing |
|
20 |
the same logical breakpoint (the one use entered). |
|
21 |
||
22 |
[author:] |
|
23 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
|
24 |
||
25 |
[instance variables:] |
|
26 |
||
27 |
[class variables:] |
|
28 |
||
29 |
[see also:] |
|
30 |
||
31 |
" |
|
32 |
! ! |
|
33 |
||
34 |
!BreakpointDescription class methodsFor:'instance creation'! |
|
35 |
||
36 |
new |
|
37 |
"return an initialized instance" |
|
38 |
||
39 |
^ self basicNew initialize. |
|
40 |
! ! |
|
41 |
||
42 |
!BreakpointDescription methodsFor:'accessing'! |
|
43 |
||
44 |
condition |
|
45 |
^ condition |
|
46 |
! |
|
47 |
||
48 |
condition:something |
|
49 |
condition := something. |
|
50 |
! ! |
|
51 |
||
52 |
!BreakpointDescription methodsFor:'initialization'! |
|
53 |
||
54 |
initialize |
|
55 |
"Invoked when a new instance is created." |
|
56 |
||
57 |
"/ please change as required (and remove this comment) |
|
58 |
"/ method := nil. |
|
59 |
"/ position := nil. |
|
60 |
"/ condition := nil. |
|
61 |
state := #enabled |
|
62 |
"/ line := nil. |
|
63 |
||
64 |
"/ super initialize. -- commented since inherited method does nothing |
|
65 |
||
66 |
"Modified: / 17-06-2011 / 13:41:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
67 |
! ! |
|
68 |
||
69 |
!BreakpointDescription methodsFor:'support'! |
|
70 |
||
71 |
shouldBreakIn: aContext |
|
72 |
||
73 |
state ~~ #enabled ifTrue:[^false]. |
|
74 |
||
75 |
(condition isNil or:[condition value: thisContext sender]) ifTrue:[^true]. |
|
76 |
||
77 |
^false |
|
78 |
||
79 |
"Created: / 11-07-2011 / 18:16:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
80 |
! |
|
81 |
||
82 |
toggle |
|
83 |
state == #deleted ifTrue:[^self]. |
|
84 |
||
85 |
state := (state == #enabled) |
|
86 |
ifTrue:[#disabled] |
|
87 |
ifFalse:[#enabled]. |
|
88 |
||
89 |
"Created: / 17-06-2011 / 13:40:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
90 |
"Modified (format): / 06-07-2011 / 12:33:10 / cg" |
|
91 |
! ! |
|
92 |
||
93 |
!BreakpointDescription methodsFor:'testing'! |
|
94 |
||
95 |
isEnabled |
|
96 |
||
97 |
"Bad coding here, state should be full object" |
|
98 |
||
99 |
^state == #enabled |
|
100 |
||
101 |
"Created: / 28-06-2011 / 08:27:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
102 |
! ! |
|
103 |
||
104 |
!BreakpointDescription class methodsFor:'documentation'! |
|
105 |
||
106 |
version |
|
2553
32377c387672
#icon moved to stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2552
diff
changeset
|
107 |
^ '$Header: /cvs/stx/stx/libcomp/BreakpointDescription.st,v 1.2 2011-07-11 17:27:50 vrany Exp $' |
2552 | 108 |
! |
109 |
||
110 |
version_CVS |
|
2553
32377c387672
#icon moved to stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2552
diff
changeset
|
111 |
^ '$Header: /cvs/stx/stx/libcomp/BreakpointDescription.st,v 1.2 2011-07-11 17:27:50 vrany Exp $' |
2552 | 112 |
! ! |