author | sr |
Tue, 21 Feb 2017 16:54:14 +0100 | |
branch | expecco_2_11_0 |
changeset 4129 | c690dec12b7e |
parent 4001 | c59cafbd9d60 |
child 4007 | 95308b6e887e |
child 4360 | 023577f390b9 |
permissions | -rw-r--r-- |
2552 | 1 |
"{ Package: 'stx:libcomp' }" |
2 |
||
3758 | 3 |
"{ NameSpace: Smalltalk }" |
4 |
||
2552 | 5 |
Object subclass:#BreakpointDescription |
3478
10e2a710037f
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
6 |
instanceVariableNames:'state condition icon' |
2552 | 7 |
classVariableNames:'' |
8 |
poolDictionaries:'' |
|
9 |
category:'System-Compiler-Debugging' |
|
10 |
! |
|
11 |
||
12 |
!BreakpointDescription class methodsFor:'documentation'! |
|
13 |
||
14 |
documentation |
|
15 |
" |
|
16 |
I describe a breakpoint: its state (enabled/disabled), |
|
17 |
condition, etc. |
|
18 |
||
19 |
I may be shared by multiple instances of Breakpoint, |
|
20 |
since there may be multiple version of same method |
|
21 |
with breakpoints on different position but representing |
|
3113
4d7936f562c2
class: BreakpointDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2969
diff
changeset
|
22 |
the same logical breakpoint (the one set by the user). |
2552 | 23 |
|
24 |
[author:] |
|
25 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
|
26 |
||
27 |
[instance variables:] |
|
28 |
||
29 |
[class variables:] |
|
30 |
||
31 |
[see also:] |
|
32 |
||
33 |
" |
|
34 |
! ! |
|
35 |
||
36 |
!BreakpointDescription class methodsFor:'instance creation'! |
|
37 |
||
38 |
new |
|
39 |
"return an initialized instance" |
|
40 |
||
41 |
^ self basicNew initialize. |
|
42 |
! ! |
|
43 |
||
44 |
!BreakpointDescription methodsFor:'accessing'! |
|
45 |
||
46 |
condition |
|
47 |
^ condition |
|
48 |
! |
|
49 |
||
50 |
condition:something |
|
51 |
condition := something. |
|
52 |
! ! |
|
53 |
||
54 |
!BreakpointDescription methodsFor:'initialization'! |
|
55 |
||
56 |
initialize |
|
57 |
"Invoked when a new instance is created." |
|
58 |
||
59 |
state := #enabled |
|
60 |
||
61 |
"/ super initialize. -- commented since inherited method does nothing |
|
62 |
||
63 |
"Modified: / 17-06-2011 / 13:41:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
64 |
! ! |
|
65 |
||
66 |
!BreakpointDescription methodsFor:'support'! |
|
67 |
||
3197
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
68 |
beInvisible |
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
69 |
state := #hidden. |
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
70 |
! |
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
71 |
|
2794 | 72 |
beTracepoint |
73 |
state := #tracing. |
|
74 |
||
75 |
"Created: / 27-01-2012 / 13:55:20 / cg" |
|
76 |
! |
|
77 |
||
2969 | 78 |
disable |
79 |
state == #deleted ifTrue:[^self]. |
|
80 |
||
81 |
state := #disabled. |
|
82 |
! |
|
83 |
||
2552 | 84 |
shouldBreakIn: aContext |
85 |
state ~~ #enabled ifTrue:[^false]. |
|
86 |
||
2793 | 87 |
^ condition isNil or:[condition value: thisContext sender] |
2552 | 88 |
|
89 |
"Created: / 11-07-2011 / 18:16:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2793 | 90 |
"Modified (format): / 27-01-2012 / 13:42:28 / cg" |
91 |
! |
|
92 |
||
93 |
shouldTraceIn: aContext |
|
94 |
state ~~ #tracing ifTrue:[^false]. |
|
95 |
||
96 |
^ condition isNil or:[condition value: thisContext sender] |
|
97 |
||
98 |
"Created: / 27-01-2012 / 13:41:58 / cg" |
|
2552 | 99 |
! |
100 |
||
101 |
toggle |
|
102 |
state == #deleted ifTrue:[^self]. |
|
103 |
||
2793 | 104 |
(state == #enabled) ifTrue:[ |
105 |
state := #disabled. |
|
106 |
] ifFalse:[ |
|
2794 | 107 |
state := #enabled |
2793 | 108 |
]. |
2552 | 109 |
|
110 |
"Created: / 17-06-2011 / 13:40:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2794 | 111 |
"Modified: / 27-01-2012 / 13:52:54 / cg" |
112 |
! |
|
113 |
||
114 |
toggleTracing |
|
115 |
state == #deleted ifTrue:[^self]. |
|
116 |
||
117 |
(state == #tracing) ifTrue:[ |
|
118 |
state := #disabled |
|
119 |
] ifFalse:[ |
|
120 |
state := #tracing. |
|
121 |
]. |
|
122 |
||
123 |
"Created: / 27-01-2012 / 13:52:41 / cg" |
|
2552 | 124 |
! ! |
125 |
||
126 |
!BreakpointDescription methodsFor:'testing'! |
|
127 |
||
128 |
isEnabled |
|
129 |
||
130 |
"Bad coding here, state should be full object" |
|
131 |
||
3392
8ce7c295de8c
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3197
diff
changeset
|
132 |
^ state == #enabled or:[ state == #tracing ] |
2552 | 133 |
|
134 |
"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
|
135 |
! |
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
136 |
|
4001 | 137 |
isTracepoint |
138 |
^ condition isNil and:[state == #tracing] |
|
139 |
! |
|
140 |
||
3197
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
141 |
isVisible |
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
142 |
"Bad coding here, state should be full object" |
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
143 |
|
fe2be038af11
class: BreakpointDescription
Claus Gittinger <cg@exept.de>
parents:
3113
diff
changeset
|
144 |
^state ~~ #hidden |
2552 | 145 |
! ! |
146 |
||
147 |
!BreakpointDescription class methodsFor:'documentation'! |
|
148 |
||
149 |
version |
|
3758 | 150 |
^ '$Header$' |
2552 | 151 |
! |
152 |
||
153 |
version_CVS |
|
3758 | 154 |
^ '$Header$' |
2552 | 155 |
! ! |
3113
4d7936f562c2
class: BreakpointDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2969
diff
changeset
|
156 |