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