author | Claus Gittinger <cg@exept.de> |
Wed, 05 Sep 2012 13:25:37 +0200 | |
changeset 2921 | 9e0507e1c64f |
parent 2894 | 1520aa38f2f3 |
child 2968 | e69a084842cc |
permissions | -rw-r--r-- |
2510 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
||
14 |
Object subclass:#Breakpoint |
|
2792 | 15 |
instanceVariableNames:'position description line isReached' |
2510 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
18 |
category:'System-Compiler-Debugging' |
|
19 |
! |
|
20 |
||
21 |
!Breakpoint class methodsFor:'documentation'! |
|
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! ! |
|
36 |
||
37 |
!Breakpoint class methodsFor:'instance creation'! |
|
38 |
||
39 |
new |
|
40 |
"return an initialized instance" |
|
41 |
||
42 |
^ self basicNew initialize. |
|
43 |
! ! |
|
44 |
||
45 |
!Breakpoint methodsFor:'accessing'! |
|
46 |
||
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
47 |
description |
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
48 |
^ description |
2510 | 49 |
! |
50 |
||
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
51 |
description:aBreakpointDescription |
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
52 |
description := aBreakpointDescription. |
2510 | 53 |
! |
54 |
||
2541 | 55 |
isReached |
56 |
^ isReached |
|
57 |
! |
|
58 |
||
59 |
isReached:aBoolean |
|
60 |
isReached := aBoolean. |
|
61 |
! |
|
62 |
||
2510 | 63 |
line |
64 |
^ line |
|
65 |
! |
|
66 |
||
67 |
line:anInteger |
|
68 |
line := anInteger. |
|
69 |
! |
|
70 |
||
71 |
position |
|
72 |
^ position |
|
73 |
! |
|
74 |
||
2894 | 75 |
position:anInteger |
76 |
position := anInteger. |
|
77 |
||
78 |
"Modified (format): / 02-08-2012 / 09:26:03 / cg" |
|
79 |
! |
|
80 |
||
81 |
position:positionArg line:lineArg |
|
82 |
position := positionArg. |
|
83 |
line := lineArg. |
|
84 |
||
85 |
"Created: / 02-08-2012 / 09:26:27 / cg" |
|
2510 | 86 |
! ! |
87 |
||
88 |
!Breakpoint methodsFor:'initialization'! |
|
89 |
||
90 |
initialize |
|
91 |
"Invoked when a new instance is created." |
|
92 |
||
93 |
"/ please change as required (and remove this comment) |
|
94 |
"/ method := nil. |
|
95 |
"/ position := nil. |
|
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
96 |
description := BreakpointDescription new. |
2510 | 97 |
"/ line := nil. |
98 |
||
99 |
"/ super initialize. -- commented since inherited method does nothing |
|
100 |
||
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
101 |
"Modified: / 11-07-2011 / 18:19:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2510 | 102 |
! ! |
103 |
||
104 |
!Breakpoint methodsFor:'printing & storing'! |
|
105 |
||
106 |
printOn:aStream |
|
107 |
"append a printed representation if the receiver to the argument, aStream" |
|
108 |
||
109 |
aStream |
|
110 |
nextPutAll: 'BPNT'; |
|
111 |
nextPut: $(; |
|
112 |
nextPutAll: position printString; |
|
113 |
nextPut: $). |
|
114 |
||
115 |
"Modified: / 16-06-2011 / 14:48:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
116 |
! ! |
|
117 |
||
118 |
!Breakpoint methodsFor:'support'! |
|
119 |
||
2795 | 120 |
beTracepoint |
121 |
"make this breakpoint a tracepoint" |
|
122 |
||
123 |
description beTracepoint |
|
124 |
||
125 |
"Created: / 27-01-2012 / 13:56:11 / cg" |
|
126 |
! |
|
127 |
||
2510 | 128 |
break |
2545 | 129 |
"invoked by the breakPoint's code (see BreakPointNode)" |
2510 | 130 |
|
131 |
<resource: #skipInDebuggersWalkBack> |
|
132 |
||
2795 | 133 |
|sender| |
134 |
||
135 |
sender := thisContext sender. |
|
136 |
(description shouldBreakIn: sender) ifTrue:[ |
|
2792 | 137 |
BreakPointInterrupt |
2510 | 138 |
raiseRequestWith: self |
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
139 |
errorString:('Breakpoint encountered at line %1' bindWith:self line) |
2795 | 140 |
in:sender. |
141 |
]. |
|
142 |
(description shouldTraceIn: sender) ifTrue:[ |
|
2797 | 143 |
Transcript |
144 |
show:Timestamp now; |
|
145 |
showCR:(' Trace %1 [%2]' bindWith:sender methodPrintString with:self line) |
|
2795 | 146 |
]. |
2510 | 147 |
|
148 |
"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
|
149 |
"Modified: / 11-07-2011 / 18:17:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2797 | 150 |
"Modified: / 27-01-2012 / 14:10:22 / cg" |
2510 | 151 |
! |
152 |
||
153 |
toggle |
|
2792 | 154 |
"toggle this breakpoint" |
2510 | 155 |
|
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
156 |
description toggle |
2510 | 157 |
|
158 |
"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
|
159 |
"Modified: / 11-07-2011 / 18:18:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2792 | 160 |
"Modified (comment): / 27-01-2012 / 10:41:03 / cg" |
2795 | 161 |
! |
162 |
||
163 |
toggleTracing |
|
164 |
"toggle this breakpoint" |
|
165 |
||
166 |
description toggleTracing |
|
167 |
||
168 |
"Created: / 27-01-2012 / 13:56:05 / cg" |
|
2510 | 169 |
! ! |
170 |
||
171 |
!Breakpoint methodsFor:'testing'! |
|
172 |
||
173 |
isEnabled |
|
174 |
||
175 |
"Bad coding here, state should be full object" |
|
176 |
||
2551
4470029ad63a
Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2545
diff
changeset
|
177 |
^description isEnabled |
2510 | 178 |
|
179 |
"Created: / 28-06-2011 / 08:27:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
180 |
! ! |
|
181 |
||
182 |
!Breakpoint class methodsFor:'documentation'! |
|
183 |
||
2554
31516fc84824
#icon moved to stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2551
diff
changeset
|
184 |
version |
2894 | 185 |
^ '$Header: /cvs/stx/stx/libcomp/Breakpoint.st,v 1.9 2012-08-02 12:47:10 cg Exp $' |
2554
31516fc84824
#icon moved to stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2551
diff
changeset
|
186 |
! |
31516fc84824
#icon moved to stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2551
diff
changeset
|
187 |
|
2510 | 188 |
version_CVS |
2894 | 189 |
^ '$Header: /cvs/stx/stx/libcomp/Breakpoint.st,v 1.9 2012-08-02 12:47:10 cg Exp $' |
2510 | 190 |
! |
191 |
||
192 |
version_SVN |
|
2541 | 193 |
^ '§ Id §' |
2510 | 194 |
! ! |