author | Claus Gittinger <cg@exept.de> |
Mon, 11 May 2015 15:20:01 +0200 | |
changeset 3628 | febf865a3ca9 |
parent 3588 | 9a435f75bc8c |
child 3631 | 88659350da26 |
permissions | -rw-r--r-- |
2510 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
3129
7b4542cc9a9e
Added support for new breakpoint implementation. Backward compatible.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3128
diff
changeset
|
3 |
All Rights Reserved |
2510 | 4 |
|
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 |
" |
|
12 |
"{ Package: 'stx:libcomp' }" |
|
13 |
||
3588 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
2510 | 16 |
Object subclass:#Breakpoint |
3509
96499f5b060d
Removed code for not-yet-finished new breakpoint support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3491
diff
changeset
|
17 |
instanceVariableNames:'position description line isReached method' |
3149 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
20 |
category:'System-Compiler-Debugging' |
|
2510 | 21 |
! |
22 |
||
23 |
!Breakpoint class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
3129
7b4542cc9a9e
Added support for new breakpoint implementation. Backward compatible.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3128
diff
changeset
|
28 |
All Rights Reserved |
2510 | 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 |
" |
|
3347 | 37 |
! |
38 |
||
39 |
documentation |
|
40 |
" |
|
41 |
statement breakpoint support. |
|
42 |
Instances of me are placed into a (bytecode-) compiled method's |
|
43 |
literal array and are sent messages dynamically when a statement |
|
44 |
with a breakpoint is about to be executed. |
|
45 |
" |
|
2510 | 46 |
! ! |
47 |
||
48 |
!Breakpoint class methodsFor:'instance creation'! |
|
49 |
||
50 |
new |
|
51 |
"return an initialized instance" |
|
52 |
||
53 |
^ self basicNew initialize. |
|
54 |
! ! |
|
55 |
||
3354 | 56 |
!Breakpoint class methodsFor:'utilities'! |
57 |
||
58 |
disableAllBreakpoints |
|
3491 | 59 |
MethodWithBreakpoints allBreakpointedMethods do:[:m | |
60 |
m disableAllBreakpoints |
|
3354 | 61 |
] |
62 |
||
63 |
"Created: / 03-02-2014 / 10:35:55 / cg" |
|
64 |
! ! |
|
65 |
||
2510 | 66 |
!Breakpoint methodsFor:'accessing'! |
67 |
||
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
68 |
description |
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
69 |
^ description |
2510 | 70 |
! |
71 |
||
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
72 |
description:aBreakpointDescription |
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
73 |
description := aBreakpointDescription. |
2510 | 74 |
! |
75 |
||
2541 | 76 |
isReached |
77 |
^ isReached |
|
78 |
! |
|
79 |
||
80 |
isReached:aBoolean |
|
81 |
isReached := aBoolean. |
|
82 |
! |
|
83 |
||
2510 | 84 |
line |
85 |
^ line |
|
86 |
! |
|
87 |
||
3465 | 88 |
line:lineArg |
89 |
self assert:lineArg >= 0. |
|
90 |
line := lineArg. |
|
2510 | 91 |
! |
92 |
||
3588 | 93 |
method:something |
94 |
method := something. |
|
95 |
! |
|
96 |
||
2510 | 97 |
position |
98 |
^ position |
|
99 |
! |
|
100 |
||
2894 | 101 |
position:anInteger |
102 |
position := anInteger. |
|
103 |
||
104 |
"Modified (format): / 02-08-2012 / 09:26:03 / cg" |
|
105 |
! |
|
106 |
||
107 |
position:positionArg line:lineArg |
|
108 |
position := positionArg. |
|
109 |
line := lineArg. |
|
3465 | 110 |
self assert:lineArg >= 0. |
2894 | 111 |
|
112 |
"Created: / 02-08-2012 / 09:26:27 / cg" |
|
2510 | 113 |
! ! |
114 |
||
115 |
!Breakpoint methodsFor:'initialization'! |
|
116 |
||
117 |
initialize |
|
118 |
"Invoked when a new instance is created." |
|
119 |
||
120 |
"/ please change as required (and remove this comment) |
|
121 |
"/ method := nil. |
|
122 |
"/ position := nil. |
|
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
123 |
description := BreakpointDescription new. |
2510 | 124 |
"/ line := nil. |
125 |
||
126 |
"/ super initialize. -- commented since inherited method does nothing |
|
127 |
||
3509
96499f5b060d
Removed code for not-yet-finished new breakpoint support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3491
diff
changeset
|
128 |
"Modified: / 21-08-2014 / 09:35:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2510 | 129 |
! ! |
130 |
||
131 |
!Breakpoint methodsFor:'printing & storing'! |
|
132 |
||
133 |
printOn:aStream |
|
134 |
"append a printed representation if the receiver to the argument, aStream" |
|
135 |
||
3202 | 136 |
aStream nextPutAll: 'BPNT at'. |
3149 | 137 |
position notNil ifTrue:[ |
138 |
aStream |
|
3202 | 139 |
nextPutAll: ' source position:'; |
3149 | 140 |
nextPutAll: position printString. |
3202 | 141 |
]. |
142 |
line notNil ifTrue:[ |
|
143 |
aStream |
|
144 |
nextPutAll: ' line:'; |
|
145 |
nextPutAll: line printString. |
|
146 |
]. |
|
147 |
(position isNil and:[line isNil]) ifTrue:[ |
|
148 |
aStream nextPutAll: ' ???' |
|
3149 | 149 |
] |
150 |
||
151 |
"Modified: / 24-04-2013 / 20:42:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2510 | 152 |
! ! |
153 |
||
154 |
!Breakpoint methodsFor:'support'! |
|
155 |
||
3196 | 156 |
beInvisible |
157 |
"make this breakpoint hidden (in gutter)" |
|
158 |
||
159 |
description beInvisible |
|
160 |
! |
|
161 |
||
2795 | 162 |
beTracepoint |
163 |
"make this breakpoint a tracepoint" |
|
164 |
||
165 |
description beTracepoint |
|
166 |
||
167 |
"Created: / 27-01-2012 / 13:56:11 / cg" |
|
168 |
! |
|
169 |
||
2510 | 170 |
break |
2545 | 171 |
"invoked by the breakPoint's code (see BreakPointNode)" |
2510 | 172 |
|
173 |
<resource: #skipInDebuggersWalkBack> |
|
174 |
||
2795 | 175 |
|sender| |
176 |
||
3223 | 177 |
description isEnabled ifFalse:[^ self]. |
2795 | 178 |
sender := thisContext sender. |
179 |
(description shouldBreakIn: sender) ifTrue:[ |
|
2792 | 180 |
BreakPointInterrupt |
2510 | 181 |
raiseRequestWith: self |
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
182 |
errorString:('Breakpoint encountered at line %1' bindWith:self line) |
3490 | 183 |
"/ in:sender. |
2795 | 184 |
]. |
185 |
(description shouldTraceIn: sender) ifTrue:[ |
|
2797 | 186 |
Transcript |
187 |
show:Timestamp now; |
|
188 |
showCR:(' Trace %1 [%2]' bindWith:sender methodPrintString with:self line) |
|
2795 | 189 |
]. |
2510 | 190 |
|
191 |
"Created: / 15-06-2011 / 12:48:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
192 |
"Modified: / 11-07-2011 / 18:17:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2797 | 193 |
"Modified: / 27-01-2012 / 14:10:22 / cg" |
2510 | 194 |
! |
195 |
||
2968 | 196 |
disable |
197 |
"disable this breakpoint" |
|
198 |
||
3588 | 199 |
"/ if there is currently an ignore on this breakpoint in the debugger, remove it |
200 |
DebugView stopIgnoringHaltsFor:method atLineNr:line. |
|
2968 | 201 |
description disable |
202 |
! |
|
203 |
||
2510 | 204 |
toggle |
2792 | 205 |
"toggle this breakpoint" |
2510 | 206 |
|
3588 | 207 |
"/ if there is currently an ignore on this breakpoint in the debugger, remove it |
208 |
DebugView stopIgnoringHaltsFor:method atLineNr:line. |
|
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
209 |
description toggle |
2510 | 210 |
|
211 |
"Created: / 17-06-2011 / 13:40:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
212 |
"Modified: / 11-07-2011 / 18:18:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2792 | 213 |
"Modified (comment): / 27-01-2012 / 10:41:03 / cg" |
2795 | 214 |
! |
215 |
||
216 |
toggleTracing |
|
217 |
"toggle this breakpoint" |
|
218 |
||
219 |
description toggleTracing |
|
220 |
||
221 |
"Created: / 27-01-2012 / 13:56:05 / cg" |
|
2510 | 222 |
! ! |
223 |
||
224 |
!Breakpoint methodsFor:'testing'! |
|
225 |
||
226 |
isEnabled |
|
227 |
||
228 |
"Bad coding here, state should be full object" |
|
229 |
||
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
230 |
^description isEnabled |
2510 | 231 |
|
232 |
"Created: / 28-06-2011 / 08:27:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3202 | 233 |
! |
234 |
||
235 |
isVisible |
|
236 |
^description isVisible |
|
2510 | 237 |
! ! |
238 |
||
239 |
!Breakpoint class methodsFor:'documentation'! |
|
240 |
||
2554
31516fc84824
#icon moved to stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2551
diff
changeset
|
241 |
version |
3588 | 242 |
^ '$Header: /cvs/stx/stx/libcomp/Breakpoint.st,v 1.26 2015-02-16 12:08:16 cg Exp $' |
2554
31516fc84824
#icon moved to stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2551
diff
changeset
|
243 |
! |
31516fc84824
#icon moved to stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2551
diff
changeset
|
244 |
|
2510 | 245 |
version_CVS |
3588 | 246 |
^ '$Header: /cvs/stx/stx/libcomp/Breakpoint.st,v 1.26 2015-02-16 12:08:16 cg Exp $' |
2510 | 247 |
! |
248 |
||
249 |
version_SVN |
|
3196 | 250 |
^ '$ Id $' |
2510 | 251 |
! ! |
3115
3208c8b4661c
Some more support for new breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2968
diff
changeset
|
252 |