-
Notifications
You must be signed in to change notification settings - Fork 328
/
event.go
179 lines (149 loc) · 5.42 KB
/
event.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
// Copyright (C) 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package jdwp
// events is a collection of events.
type events struct {
Policy SuspendPolicy
Events []Event
}
// Event is the interface implemented by all events raised by the VM.
type Event interface {
request() EventRequestID
Kind() EventKind
}
// EventVMStart represents an event raised when the virtual machine is started.
type EventVMStart struct {
Request EventRequestID
Thread ThreadID
}
// EventVMDeath represents an event raised when the virtual machine is stopped.
type EventVMDeath struct {
Request EventRequestID
}
// EventSingleStep represents an event raised when a single-step has been completed.
type EventSingleStep struct {
Request EventRequestID
Thread ThreadID
Location Location
}
// EventBreakpoint represents an event raised when a breakpoint has been hit.
type EventBreakpoint struct {
Request EventRequestID
Thread ThreadID
Location Location
}
// EventMethodEntry represents an event raised when a method has been entered.
type EventMethodEntry struct {
Request EventRequestID
Thread ThreadID
Location Location
}
// EventMethodExit represents an event raised when a method has been exited.
type EventMethodExit struct {
Request EventRequestID
Thread ThreadID
Location Location
}
// EventException represents an event raised when an exception is thrown.
type EventException struct {
Request EventRequestID
Thread ThreadID
Location Location
Exception TaggedObjectID
CatchLocation Location
}
// EventThreadStart represents an event raised when a new thread is started.
type EventThreadStart struct {
Request EventRequestID
Thread ThreadID
}
// EventThreadDeath represents an event raised when a thread is stopped.
type EventThreadDeath struct {
Request EventRequestID
Thread ThreadID
}
// EventClassPrepare represents an event raised when a class enters the prepared state.
type EventClassPrepare struct {
Request EventRequestID
Thread ThreadID
ClassKind TypeTag
ClassType ReferenceTypeID
Signature string
Status ClassStatus
}
// EventClassUnload represents an event raised when a class is unloaded.
type EventClassUnload struct {
Request EventRequestID
Signature string
}
// EventFieldAccess represents an event raised when a field is accessed.
type EventFieldAccess struct {
Request EventRequestID
Thread ThreadID
Location Location
FieldKind TypeTag
FieldType ReferenceTypeID
Field FieldID
Object TaggedObjectID
}
// EventFieldModification represents an event raised when a field is modified.
type EventFieldModification struct {
Request EventRequestID
Thread ThreadID
Location Location
FieldKind TypeTag
FieldType ReferenceTypeID
Field FieldID
Object TaggedObjectID
NewValue Value
}
func (e EventVMStart) request() EventRequestID { return e.Request }
func (e EventVMDeath) request() EventRequestID { return e.Request }
func (e EventSingleStep) request() EventRequestID { return e.Request }
func (e EventBreakpoint) request() EventRequestID { return e.Request }
func (e EventMethodEntry) request() EventRequestID { return e.Request }
func (e EventMethodExit) request() EventRequestID { return e.Request }
func (e EventException) request() EventRequestID { return e.Request }
func (e EventThreadStart) request() EventRequestID { return e.Request }
func (e EventThreadDeath) request() EventRequestID { return e.Request }
func (e EventClassPrepare) request() EventRequestID { return e.Request }
func (e EventClassUnload) request() EventRequestID { return e.Request }
func (e EventFieldAccess) request() EventRequestID { return e.Request }
func (e EventFieldModification) request() EventRequestID { return e.Request }
// Kind returns VMStart
func (EventVMStart) Kind() EventKind { return VMStart }
// Kind returns VMDeath
func (EventVMDeath) Kind() EventKind { return VMDeath }
// Kind returns SingleStep
func (EventSingleStep) Kind() EventKind { return SingleStep }
// Kind returns Breakpoint
func (EventBreakpoint) Kind() EventKind { return Breakpoint }
// Kind returns MethodEntry
func (EventMethodEntry) Kind() EventKind { return MethodEntry }
// Kind returns MethodExit
func (EventMethodExit) Kind() EventKind { return MethodExit }
// Kind returns Exception
func (EventException) Kind() EventKind { return Exception }
// Kind returns ThreadStart
func (EventThreadStart) Kind() EventKind { return ThreadStart }
// Kind returns ThreadDeath
func (EventThreadDeath) Kind() EventKind { return ThreadDeath }
// Kind returns ClassPrepare
func (EventClassPrepare) Kind() EventKind { return ClassPrepare }
// Kind returns ClassUnload
func (EventClassUnload) Kind() EventKind { return ClassUnload }
// Kind returns FieldAccess
func (EventFieldAccess) Kind() EventKind { return FieldAccess }
// Kind returns FieldModification
func (EventFieldModification) Kind() EventKind { return FieldModification }