summaryrefslogtreecommitdiffstats
path: root/runtime/jdwp/jdwp_constants.h
blob: 9fc896d8eb3d6ab16d476b727cb1463152f16ab9 (plain)
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * 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.
 */
/*
 * These come out of the JDWP documentation.
 */
#ifndef ART_RUNTIME_JDWP_JDWP_CONSTANTS_H_
#define ART_RUNTIME_JDWP_JDWP_CONSTANTS_H_

#include <iosfwd>

namespace art {

namespace JDWP {

/*
 * Error constants.
 */
enum JdwpError {
  ERR_NONE                                        = 0,
  ERR_INVALID_THREAD                              = 10,
  ERR_INVALID_THREAD_GROUP                        = 11,
  ERR_INVALID_PRIORITY                            = 12,
  ERR_THREAD_NOT_SUSPENDED                        = 13,
  ERR_THREAD_SUSPENDED                            = 14,
  ERR_THREAD_NOT_ALIVE                            = 15,
  ERR_INVALID_OBJECT                              = 20,
  ERR_INVALID_CLASS                               = 21,
  ERR_CLASS_NOT_PREPARED                          = 22,
  ERR_INVALID_METHODID                            = 23,
  ERR_INVALID_LOCATION                            = 24,
  ERR_INVALID_FIELDID                             = 25,
  ERR_INVALID_FRAMEID                             = 30,
  ERR_NO_MORE_FRAMES                              = 31,
  ERR_OPAQUE_FRAME                                = 32,
  ERR_NOT_CURRENT_FRAME                           = 33,
  ERR_TYPE_MISMATCH                               = 34,
  ERR_INVALID_SLOT                                = 35,
  ERR_DUPLICATE                                   = 40,
  ERR_NOT_FOUND                                   = 41,
  ERR_INVALID_MONITOR                             = 50,
  ERR_NOT_MONITOR_OWNER                           = 51,
  ERR_INTERRUPT                                   = 52,
  ERR_INVALID_CLASS_FORMAT                        = 60,
  ERR_CIRCULAR_CLASS_DEFINITION                   = 61,
  ERR_FAILS_VERIFICATION                          = 62,
  ERR_ADD_METHOD_NOT_IMPLEMENTED                  = 63,
  ERR_SCHEMA_CHANGE_NOT_IMPLEMENTED               = 64,
  ERR_INVALID_TYPESTATE                           = 65,
  ERR_HIERARCHY_CHANGE_NOT_IMPLEMENTED            = 66,
  ERR_DELETE_METHOD_NOT_IMPLEMENTED               = 67,
  ERR_UNSUPPORTED_VERSION                         = 68,
  ERR_NAMES_DONT_MATCH                            = 69,
  ERR_CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED      = 70,
  ERR_METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED     = 71,
  ERR_NOT_IMPLEMENTED                             = 99,
  ERR_NULL_POINTER                                = 100,
  ERR_ABSENT_INFORMATION                          = 101,
  ERR_INVALID_EVENT_TYPE                          = 102,
  ERR_ILLEGAL_ARGUMENT                            = 103,
  ERR_OUT_OF_MEMORY                               = 110,
  ERR_ACCESS_DENIED                               = 111,
  ERR_VM_DEAD                                     = 112,
  ERR_INTERNAL                                    = 113,
  ERR_UNATTACHED_THREAD                           = 115,
  ERR_INVALID_TAG                                 = 500,
  ERR_ALREADY_INVOKING                            = 502,
  ERR_INVALID_INDEX                               = 503,
  ERR_INVALID_LENGTH                              = 504,
  ERR_INVALID_STRING                              = 506,
  ERR_INVALID_CLASS_LOADER                        = 507,
  ERR_INVALID_ARRAY                               = 508,
  ERR_TRANSPORT_LOAD                              = 509,
  ERR_TRANSPORT_INIT                              = 510,
  ERR_NATIVE_METHOD                               = 511,
  ERR_INVALID_COUNT                               = 512,
};
std::ostream& operator<<(std::ostream& os, const JdwpError& value);


/*
 * ClassStatus constants.  These are bit flags that can be ORed together.
 */
enum JdwpClassStatus {
  CS_VERIFIED             = 0x01,
  CS_PREPARED             = 0x02,
  CS_INITIALIZED          = 0x04,
  CS_ERROR                = 0x08,
};
std::ostream& operator<<(std::ostream& os, const JdwpClassStatus& value);

/*
 * EventKind constants.
 */
enum JdwpEventKind {
  EK_SINGLE_STEP          = 1,
  EK_BREAKPOINT           = 2,
  EK_FRAME_POP            = 3,
  EK_EXCEPTION            = 4,
  EK_USER_DEFINED         = 5,
  EK_THREAD_START         = 6,
  EK_THREAD_DEATH         = 7,  // Formerly known as THREAD_END.
  EK_CLASS_PREPARE        = 8,
  EK_CLASS_UNLOAD         = 9,
  EK_CLASS_LOAD           = 10,
  EK_FIELD_ACCESS         = 20,
  EK_FIELD_MODIFICATION   = 21,
  EK_EXCEPTION_CATCH      = 30,
  EK_METHOD_ENTRY         = 40,
  EK_METHOD_EXIT          = 41,
  EK_METHOD_EXIT_WITH_RETURN_VALUE = 42,
  EK_MONITOR_CONTENDED_ENTER       = 43,
  EK_MONITOR_CONTENDED_ENTERED     = 44,
  EK_MONITOR_WAIT         = 45,
  EK_MONITOR_WAITED       = 46,
  EK_VM_START             = 90,  // Formerly known as VM_INIT.
  EK_VM_DEATH             = 99,
  EK_VM_DISCONNECTED      = 100,  // "Never sent across JDWP".
};
std::ostream& operator<<(std::ostream& os, const JdwpEventKind& value);

/*
 * Values for "modKind" in EventRequest.Set.
 */
enum JdwpModKind {
  MK_COUNT                = 1,
  MK_CONDITIONAL          = 2,
  MK_THREAD_ONLY          = 3,
  MK_CLASS_ONLY           = 4,
  MK_CLASS_MATCH          = 5,
  MK_CLASS_EXCLUDE        = 6,
  MK_LOCATION_ONLY        = 7,
  MK_EXCEPTION_ONLY       = 8,
  MK_FIELD_ONLY           = 9,
  MK_STEP                 = 10,
  MK_INSTANCE_ONLY        = 11,
  MK_SOURCE_NAME_MATCH    = 12,  // Since Java 6.
};
std::ostream& operator<<(std::ostream& os, const JdwpModKind& value);

/*
 * InvokeOptions constants (bit flags).
 */
enum JdwpInvokeOptions {
  INVOKE_SINGLE_THREADED  = 0x01,
  INVOKE_NONVIRTUAL       = 0x02,
};
std::ostream& operator<<(std::ostream& os, const JdwpInvokeOptions& value);

/*
 * StepDepth constants.
 */
enum JdwpStepDepth {
  SD_INTO                 = 0,    // Step into method calls.
  SD_OVER                 = 1,    // Step over method calls.
  SD_OUT                  = 2,    // Step out of current method.
};
std::ostream& operator<<(std::ostream& os, const JdwpStepDepth& value);

/*
 * StepSize constants.
 */
enum JdwpStepSize {
  SS_MIN                  = 0,    // Step by minimum (for example, one bytecode).
  SS_LINE                 = 1,    // If possible, step to next line.
};
std::ostream& operator<<(std::ostream& os, const JdwpStepSize& value);

/*
 * SuspendPolicy constants.
 */
enum JdwpSuspendPolicy {
  SP_NONE                 = 0,    // Suspend no threads.
  SP_EVENT_THREAD         = 1,    // Suspend event thread.
  SP_ALL                  = 2,    // Suspend all threads.
};
std::ostream& operator<<(std::ostream& os, const JdwpSuspendPolicy& value);

/*
 * SuspendStatus constants.
 */
enum JdwpSuspendStatus {
  SUSPEND_STATUS_NOT_SUSPENDED = 0,
  SUSPEND_STATUS_SUSPENDED     = 1,
};
std::ostream& operator<<(std::ostream& os, const JdwpSuspendStatus& value);

/*
 * ThreadStatus constants.
 */
enum JdwpThreadStatus {
  TS_ZOMBIE               = 0,
  TS_RUNNING              = 1,        // RUNNING
  TS_SLEEPING             = 2,        // (in Thread.sleep())
  TS_MONITOR              = 3,        // WAITING (monitor wait)
  TS_WAIT                 = 4,        // (in Object.wait())
};
std::ostream& operator<<(std::ostream& os, const JdwpThreadStatus& value);

/*
 * TypeTag constants.
 */
enum JdwpTypeTag {
  TT_CLASS                = 1,
  TT_INTERFACE            = 2,
  TT_ARRAY                = 3,
};
std::ostream& operator<<(std::ostream& os, const JdwpTypeTag& value);

/*
 * Tag constants.
 */
enum JdwpTag {
  JT_ARRAY                 = '[',
  JT_BYTE                  = 'B',
  JT_CHAR                  = 'C',
  JT_OBJECT                = 'L',
  JT_FLOAT                 = 'F',
  JT_DOUBLE                = 'D',
  JT_INT                   = 'I',
  JT_LONG                  = 'J',
  JT_SHORT                 = 'S',
  JT_VOID                  = 'V',
  JT_BOOLEAN               = 'Z',
  JT_STRING                = 's',
  JT_THREAD                = 't',
  JT_THREAD_GROUP          = 'g',
  JT_CLASS_LOADER          = 'l',
  JT_CLASS_OBJECT          = 'c',
};
std::ostream& operator<<(std::ostream& os, const JdwpTag& value);

}  // namespace JDWP

}  // namespace art

#endif  // ART_RUNTIME_JDWP_JDWP_CONSTANTS_H_