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
|
2541
|
15 |
instanceVariableNames:'method position condition state 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 |
|
|
47 |
condition
|
|
48 |
^ condition
|
|
49 |
!
|
|
50 |
|
|
51 |
condition:something
|
|
52 |
condition := something.
|
|
53 |
!
|
|
54 |
|
|
55 |
description
|
|
56 |
|
|
57 |
^ method printString
|
|
58 |
|
|
59 |
"Created: / 15-06-2011 / 12:49:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
60 |
!
|
|
61 |
|
2541
|
62 |
isReached
|
|
63 |
^ isReached
|
|
64 |
!
|
|
65 |
|
|
66 |
isReached:aBoolean
|
|
67 |
isReached := aBoolean.
|
|
68 |
!
|
|
69 |
|
2510
|
70 |
line
|
|
71 |
^ line
|
|
72 |
!
|
|
73 |
|
|
74 |
line:anInteger
|
|
75 |
line := anInteger.
|
|
76 |
!
|
|
77 |
|
|
78 |
position
|
|
79 |
^ position
|
|
80 |
!
|
|
81 |
|
|
82 |
position:something
|
|
83 |
position := something.
|
|
84 |
! !
|
|
85 |
|
|
86 |
!Breakpoint methodsFor:'initialization'!
|
|
87 |
|
|
88 |
initialize
|
|
89 |
"Invoked when a new instance is created."
|
|
90 |
|
|
91 |
"/ please change as required (and remove this comment)
|
|
92 |
"/ method := nil.
|
|
93 |
"/ position := nil.
|
|
94 |
"/ condition := nil.
|
|
95 |
state := #enabled
|
|
96 |
"/ line := nil.
|
|
97 |
|
|
98 |
"/ super initialize. -- commented since inherited method does nothing
|
|
99 |
|
|
100 |
"Modified: / 17-06-2011 / 13:41:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
101 |
! !
|
|
102 |
|
|
103 |
!Breakpoint methodsFor:'printing & storing'!
|
|
104 |
|
|
105 |
printOn:aStream
|
|
106 |
"append a printed representation if the receiver to the argument, aStream"
|
|
107 |
|
|
108 |
aStream
|
|
109 |
nextPutAll: 'BPNT';
|
|
110 |
nextPut: $(;
|
|
111 |
nextPutAll: position printString;
|
|
112 |
nextPut: $).
|
|
113 |
|
|
114 |
"Modified: / 16-06-2011 / 14:48:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
115 |
! !
|
|
116 |
|
|
117 |
!Breakpoint methodsFor:'support'!
|
|
118 |
|
|
119 |
break
|
2545
|
120 |
"invoked by the breakPoint's code (see BreakPointNode)"
|
2510
|
121 |
|
|
122 |
<resource: #skipInDebuggersWalkBack>
|
|
123 |
|
|
124 |
state ~~ #enabled ifTrue:[^self].
|
|
125 |
|
|
126 |
(condition isNil or:[condition value: thisContext sender]) ifTrue:[
|
|
127 |
HaltSignal
|
|
128 |
raiseRequestWith: self
|
|
129 |
errorString:('Breakpoint encountered: %1' bindWith:self description)
|
2545
|
130 |
in:thisContext sender.
|
2510
|
131 |
]
|
|
132 |
|
|
133 |
"Created: / 15-06-2011 / 12:48:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
134 |
"Modified: / 17-06-2011 / 13:42:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2545
|
135 |
"Modified: / 06-07-2011 / 10:11:55 / cg"
|
2510
|
136 |
!
|
|
137 |
|
|
138 |
toggle
|
2545
|
139 |
state == #deleted ifTrue:[^self].
|
2510
|
140 |
|
2545
|
141 |
state := (state == #enabled)
|
|
142 |
ifTrue:[#disabled]
|
|
143 |
ifFalse:[#enabled].
|
2510
|
144 |
|
|
145 |
"Created: / 17-06-2011 / 13:40:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2545
|
146 |
"Modified (format): / 06-07-2011 / 12:33:10 / cg"
|
2510
|
147 |
! !
|
|
148 |
|
|
149 |
!Breakpoint methodsFor:'testing'!
|
|
150 |
|
|
151 |
isEnabled
|
|
152 |
|
|
153 |
"Bad coding here, state should be full object"
|
|
154 |
|
|
155 |
^state == #enabled
|
|
156 |
|
|
157 |
"Created: / 28-06-2011 / 08:27:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
158 |
! !
|
|
159 |
|
|
160 |
!Breakpoint class methodsFor:'documentation'!
|
|
161 |
|
|
162 |
version_CVS
|
2545
|
163 |
^ '$Header: /cvs/stx/stx/libcomp/Breakpoint.st,v 1.3 2011-07-06 12:41:07 cg Exp $'
|
2510
|
164 |
!
|
|
165 |
|
|
166 |
version_SVN
|
2541
|
167 |
^ '§ Id §'
|
2510
|
168 |
! !
|