author | Claus Gittinger <cg@exept.de> |
Wed, 21 May 2014 10:10:41 +0200 | |
changeset 3447 | fdae5e7e5379 |
parent 3392 | 8ce7c295de8c |
child 3478 | 10e2a710037f |
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 |
|
3113
4d7936f562c2
class: BreakpointDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2969
diff
changeset
|
20 |
the same logical breakpoint (the one set by the user). |
2552 | 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 |
||
3197
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
71 |
beInvisible |
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
72 |
state := #hidden. |
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
73 |
! |
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
74 |
|
2794 | 75 |
beTracepoint |
76 |
state := #tracing. |
|
77 |
||
78 |
"Created: / 27-01-2012 / 13:55:20 / cg" |
|
79 |
! |
|
80 |
||
2969 | 81 |
disable |
82 |
state == #deleted ifTrue:[^self]. |
|
83 |
||
84 |
state := #disabled. |
|
85 |
! |
|
86 |
||
2552 | 87 |
shouldBreakIn: aContext |
88 |
state ~~ #enabled ifTrue:[^false]. |
|
89 |
||
2793 | 90 |
^ condition isNil or:[condition value: thisContext sender] |
2552 | 91 |
|
92 |
"Created: / 11-07-2011 / 18:16:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2793 | 93 |
"Modified (format): / 27-01-2012 / 13:42:28 / cg" |
94 |
! |
|
95 |
||
96 |
shouldTraceIn: aContext |
|
97 |
state ~~ #tracing ifTrue:[^false]. |
|
98 |
||
99 |
^ condition isNil or:[condition value: thisContext sender] |
|
100 |
||
101 |
"Created: / 27-01-2012 / 13:41:58 / cg" |
|
2552 | 102 |
! |
103 |
||
104 |
toggle |
|
105 |
state == #deleted ifTrue:[^self]. |
|
106 |
||
2793 | 107 |
(state == #enabled) ifTrue:[ |
108 |
state := #disabled. |
|
109 |
] ifFalse:[ |
|
2794 | 110 |
state := #enabled |
2793 | 111 |
]. |
2552 | 112 |
|
113 |
"Created: / 17-06-2011 / 13:40:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2794 | 114 |
"Modified: / 27-01-2012 / 13:52:54 / cg" |
115 |
! |
|
116 |
||
117 |
toggleTracing |
|
118 |
state == #deleted ifTrue:[^self]. |
|
119 |
||
120 |
(state == #tracing) ifTrue:[ |
|
121 |
state := #disabled |
|
122 |
] ifFalse:[ |
|
123 |
state := #tracing. |
|
124 |
]. |
|
125 |
||
126 |
"Created: / 27-01-2012 / 13:52:41 / cg" |
|
2552 | 127 |
! ! |
128 |
||
129 |
!BreakpointDescription methodsFor:'testing'! |
|
130 |
||
131 |
isEnabled |
|
132 |
||
133 |
"Bad coding here, state should be full object" |
|
134 |
||
3392
8ce7c295de8c
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3197
diff
changeset
|
135 |
^ state == #enabled or:[ state == #tracing ] |
2552 | 136 |
|
137 |
"Created: / 28-06-2011 / 08:27:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3197
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
138 |
! |
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
139 |
|
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
140 |
isVisible |
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
141 |
"Bad coding here, state should be full object" |
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
142 |
|
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
143 |
^state ~~ #hidden |
2552 | 144 |
! ! |
145 |
||
146 |
!BreakpointDescription class methodsFor:'documentation'! |
|
147 |
||
148 |
version |
|
3392
8ce7c295de8c
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3197
diff
changeset
|
149 |
^ '$Header: /cvs/stx/stx/libcomp/BreakpointDescription.st,v 1.10 2014-02-28 14:23:17 cg Exp $' |
2552 | 150 |
! |
151 |
||
152 |
version_CVS |
|
3392
8ce7c295de8c
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3197
diff
changeset
|
153 |
^ '$Header: /cvs/stx/stx/libcomp/BreakpointDescription.st,v 1.10 2014-02-28 14:23:17 cg Exp $' |
2552 | 154 |
! ! |
3113
4d7936f562c2
class: BreakpointDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2969
diff
changeset
|
155 |