2552
|
1 |
"{ Package: 'stx:libcomp' }"
|
|
2 |
|
|
3 |
Object subclass:#BreakpointDescription
|
|
4 |
instanceVariableNames:'state condition'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'System-Compiler-Debugging'
|
|
8 |
!
|
|
9 |
|
|
10 |
!BreakpointDescription class methodsFor:'documentation'!
|
|
11 |
|
|
12 |
documentation
|
|
13 |
"
|
|
14 |
I describe a breakpoint: its state (enabled/disabled),
|
|
15 |
condition, etc.
|
|
16 |
|
|
17 |
I may be shared by multiple instances of Breakpoint,
|
|
18 |
since there may be multiple version of same method
|
|
19 |
with breakpoints on different position but representing
|
|
20 |
the same logical breakpoint (the one use entered).
|
|
21 |
|
|
22 |
[author:]
|
|
23 |
Jan Vrany <jan.vrany@fit.cvut.cz>
|
|
24 |
|
|
25 |
[instance variables:]
|
|
26 |
|
|
27 |
[class variables:]
|
|
28 |
|
|
29 |
[see also:]
|
|
30 |
|
|
31 |
"
|
|
32 |
! !
|
|
33 |
|
|
34 |
!BreakpointDescription class methodsFor:'instance creation'!
|
|
35 |
|
|
36 |
new
|
|
37 |
"return an initialized instance"
|
|
38 |
|
|
39 |
^ self basicNew initialize.
|
|
40 |
! !
|
|
41 |
|
|
42 |
!BreakpointDescription methodsFor:'accessing'!
|
|
43 |
|
|
44 |
condition
|
|
45 |
^ condition
|
|
46 |
!
|
|
47 |
|
|
48 |
condition:something
|
|
49 |
condition := something.
|
|
50 |
! !
|
|
51 |
|
|
52 |
!BreakpointDescription methodsFor:'initialization'!
|
|
53 |
|
|
54 |
initialize
|
|
55 |
"Invoked when a new instance is created."
|
|
56 |
|
|
57 |
"/ please change as required (and remove this comment)
|
|
58 |
"/ method := nil.
|
|
59 |
"/ position := nil.
|
|
60 |
"/ condition := nil.
|
|
61 |
state := #enabled
|
|
62 |
"/ line := nil.
|
|
63 |
|
|
64 |
"/ super initialize. -- commented since inherited method does nothing
|
|
65 |
|
|
66 |
"Modified: / 17-06-2011 / 13:41:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
67 |
! !
|
|
68 |
|
|
69 |
!BreakpointDescription methodsFor:'support'!
|
|
70 |
|
|
71 |
shouldBreakIn: aContext
|
|
72 |
state ~~ #enabled ifTrue:[^false].
|
|
73 |
|
2793
|
74 |
^ condition isNil or:[condition value: thisContext sender]
|
2552
|
75 |
|
|
76 |
"Created: / 11-07-2011 / 18:16:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2793
|
77 |
"Modified (format): / 27-01-2012 / 13:42:28 / cg"
|
|
78 |
!
|
|
79 |
|
|
80 |
shouldTraceIn: aContext
|
|
81 |
state ~~ #tracing ifTrue:[^false].
|
|
82 |
|
|
83 |
^ condition isNil or:[condition value: thisContext sender]
|
|
84 |
|
|
85 |
"Created: / 27-01-2012 / 13:41:58 / cg"
|
2552
|
86 |
!
|
|
87 |
|
|
88 |
toggle
|
|
89 |
state == #deleted ifTrue:[^self].
|
|
90 |
|
2793
|
91 |
(state == #enabled) ifTrue:[
|
|
92 |
"/ state := #tracing.
|
|
93 |
state := #disabled.
|
|
94 |
] ifFalse:[
|
|
95 |
(state == #tracing) ifTrue:[
|
|
96 |
state := #disabled
|
|
97 |
] ifFalse:[
|
|
98 |
(state == #disabled) ifTrue:[
|
|
99 |
state := #enabled
|
|
100 |
]
|
|
101 |
]
|
|
102 |
].
|
2552
|
103 |
|
|
104 |
"Created: / 17-06-2011 / 13:40:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2793
|
105 |
"Modified: / 27-01-2012 / 13:47:46 / cg"
|
2552
|
106 |
! !
|
|
107 |
|
|
108 |
!BreakpointDescription methodsFor:'testing'!
|
|
109 |
|
|
110 |
isEnabled
|
|
111 |
|
|
112 |
"Bad coding here, state should be full object"
|
|
113 |
|
|
114 |
^state == #enabled
|
|
115 |
|
|
116 |
"Created: / 28-06-2011 / 08:27:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
117 |
! !
|
|
118 |
|
|
119 |
!BreakpointDescription class methodsFor:'documentation'!
|
|
120 |
|
|
121 |
version
|
2793
|
122 |
^ '$Header: /cvs/stx/stx/libcomp/BreakpointDescription.st,v 1.3 2012-01-27 12:47:58 cg Exp $'
|
2552
|
123 |
!
|
|
124 |
|
|
125 |
version_CVS
|
2793
|
126 |
^ '$Header: /cvs/stx/stx/libcomp/BreakpointDescription.st,v 1.3 2012-01-27 12:47:58 cg Exp $'
|
2552
|
127 |
! !
|