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