blob: 6d550f25510d1c8077e95bf2d3e08121cf905477 [file] [log] [blame]
Elliott Hughes872d4ec2011-10-21 17:07:15 -07001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16/*
17 * These come out of the JDWP documentation.
18 */
19#ifndef ART_JDWP_JDWPCONSTANTS_H_
20#define ART_JDWP_JDWPCONSTANTS_H_
21
22#include <iosfwd>
23
24namespace art {
25
26namespace JDWP {
27
28/*
29 * Error constants.
30 */
31enum JdwpError {
32 ERR_NONE = 0,
33 ERR_INVALID_THREAD = 10,
34 ERR_INVALID_THREAD_GROUP = 11,
35 ERR_INVALID_PRIORITY = 12,
36 ERR_THREAD_NOT_SUSPENDED = 13,
37 ERR_THREAD_SUSPENDED = 14,
38 ERR_INVALID_OBJECT = 20,
39 ERR_INVALID_CLASS = 21,
40 ERR_CLASS_NOT_PREPARED = 22,
41 ERR_INVALID_METHODID = 23,
42 ERR_INVALID_LOCATION = 24,
43 ERR_INVALID_FIELDID = 25,
44 ERR_INVALID_FRAMEID = 30,
45 ERR_NO_MORE_FRAMES = 31,
46 ERR_OPAQUE_FRAME = 32,
47 ERR_NOT_CURRENT_FRAME = 33,
48 ERR_TYPE_MISMATCH = 34,
49 ERR_INVALID_SLOT = 35,
50 ERR_DUPLICATE = 40,
51 ERR_NOT_FOUND = 41,
52 ERR_INVALID_MONITOR = 50,
53 ERR_NOT_MONITOR_OWNER = 51,
54 ERR_INTERRUPT = 52,
55 ERR_INVALID_CLASS_FORMAT = 60,
56 ERR_CIRCULAR_CLASS_DEFINITION = 61,
57 ERR_FAILS_VERIFICATION = 62,
58 ERR_ADD_METHOD_NOT_IMPLEMENTED = 63,
59 ERR_SCHEMA_CHANGE_NOT_IMPLEMENTED = 64,
60 ERR_INVALID_TYPESTATE = 65,
61 ERR_HIERARCHY_CHANGE_NOT_IMPLEMENTED = 66,
62 ERR_DELETE_METHOD_NOT_IMPLEMENTED = 67,
63 ERR_UNSUPPORTED_VERSION = 68,
64 ERR_NAMES_DONT_MATCH = 69,
65 ERR_CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED = 70,
66 ERR_METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED = 71,
67 ERR_NOT_IMPLEMENTED = 99,
68 ERR_NULL_POINTER = 100,
69 ERR_ABSENT_INFORMATION = 101,
70 ERR_INVALID_EVENT_TYPE = 102,
71 ERR_ILLEGAL_ARGUMENT = 103,
72 ERR_OUT_OF_MEMORY = 110,
73 ERR_ACCESS_DENIED = 111,
74 ERR_VM_DEAD = 112,
75 ERR_INTERNAL = 113,
76 ERR_UNATTACHED_THREAD = 115,
77 ERR_INVALID_TAG = 500,
78 ERR_ALREADY_INVOKING = 502,
79 ERR_INVALID_INDEX = 503,
80 ERR_INVALID_LENGTH = 504,
81 ERR_INVALID_STRING = 506,
82 ERR_INVALID_CLASS_LOADER = 507,
83 ERR_INVALID_ARRAY = 508,
84 ERR_TRANSPORT_LOAD = 509,
85 ERR_TRANSPORT_INIT = 510,
86 ERR_NATIVE_METHOD = 511,
87 ERR_INVALID_COUNT = 512,
88};
89std::ostream& operator<<(std::ostream& os, const JdwpError& value);
90
91
92/*
93 * ClassStatus constants. These are bit flags that can be ORed together.
94 */
95enum JdwpClassStatus {
96 CS_VERIFIED = 0x01,
97 CS_PREPARED = 0x02,
98 CS_INITIALIZED = 0x04,
99 CS_ERROR = 0x08,
100};
101std::ostream& operator<<(std::ostream& os, const JdwpClassStatus& value);
102
103/*
104 * EventKind constants.
105 */
106enum JdwpEventKind {
107 EK_SINGLE_STEP = 1,
108 EK_BREAKPOINT = 2,
109 EK_FRAME_POP = 3,
110 EK_EXCEPTION = 4,
111 EK_USER_DEFINED = 5,
112 EK_THREAD_START = 6,
113 EK_THREAD_END = 7,
114 EK_CLASS_PREPARE = 8,
115 EK_CLASS_UNLOAD = 9,
116 EK_CLASS_LOAD = 10,
117 EK_FIELD_ACCESS = 20,
118 EK_FIELD_MODIFICATION = 21,
119 EK_EXCEPTION_CATCH = 30,
120 EK_METHOD_ENTRY = 40,
121 EK_METHOD_EXIT = 41,
122 EK_VM_INIT = 90,
123 EK_VM_DEATH = 99,
124 EK_VM_DISCONNECTED = 100, /* "Never sent across JDWP */
125 EK_VM_START = EK_VM_INIT,
126 EK_THREAD_DEATH = EK_THREAD_END,
127};
128std::ostream& operator<<(std::ostream& os, const JdwpEventKind& value);
129
130/*
131 * Values for "modKind" in EventRequest.Set.
132 */
133enum JdwpModKind {
134 MK_COUNT = 1,
135 MK_CONDITIONAL = 2,
136 MK_THREAD_ONLY = 3,
137 MK_CLASS_ONLY = 4,
138 MK_CLASS_MATCH = 5,
139 MK_CLASS_EXCLUDE = 6,
140 MK_LOCATION_ONLY = 7,
141 MK_EXCEPTION_ONLY = 8,
142 MK_FIELD_ONLY = 9,
143 MK_STEP = 10,
144 MK_INSTANCE_ONLY = 11,
145};
146std::ostream& operator<<(std::ostream& os, const JdwpModKind& value);
147
148/*
149 * InvokeOptions constants (bit flags).
150 */
151enum JdwpInvokeOptions {
152 INVOKE_SINGLE_THREADED = 0x01,
153 INVOKE_NONVIRTUAL = 0x02,
154};
155std::ostream& operator<<(std::ostream& os, const JdwpInvokeOptions& value);
156
157/*
158 * StepDepth constants.
159 */
160enum JdwpStepDepth {
161 SD_INTO = 0, /* step into method calls */
162 SD_OVER = 1, /* step over method calls */
163 SD_OUT = 2, /* step out of current method */
164};
165std::ostream& operator<<(std::ostream& os, const JdwpStepDepth& value);
166
167/*
168 * StepSize constants.
169 */
170enum JdwpStepSize {
171 SS_MIN = 0, /* step by minimum (e.g. 1 bytecode inst) */
172 SS_LINE = 1, /* if possible, step to next line */
173};
174std::ostream& operator<<(std::ostream& os, const JdwpStepSize& value);
175
176/*
177 * SuspendPolicy constants.
178 */
179enum JdwpSuspendPolicy {
180 SP_NONE = 0, /* suspend no threads */
181 SP_EVENT_THREAD = 1, /* suspend event thread */
182 SP_ALL = 2, /* suspend all threads */
183};
184std::ostream& operator<<(std::ostream& os, const JdwpSuspendPolicy& value);
185
186/*
187 * SuspendStatus constants.
188 */
189enum JdwpSuspendStatus {
190 SUSPEND_STATUS_NOT_SUSPENDED = 0,
191 SUSPEND_STATUS_SUSPENDED = 1,
192};
193std::ostream& operator<<(std::ostream& os, const JdwpSuspendStatus& value);
194
195/*
196 * ThreadStatus constants.
197 */
198enum JdwpThreadStatus {
199 TS_ZOMBIE = 0,
200 TS_RUNNING = 1, // RUNNING
201 TS_SLEEPING = 2, // (in Thread.sleep())
202 TS_MONITOR = 3, // WAITING (monitor wait)
203 TS_WAIT = 4, // (in Object.wait())
204};
205std::ostream& operator<<(std::ostream& os, const JdwpThreadStatus& value);
206
207/*
208 * TypeTag constants.
209 */
210enum JdwpTypeTag {
211 TT_CLASS = 1,
212 TT_INTERFACE = 2,
213 TT_ARRAY = 3,
214};
215std::ostream& operator<<(std::ostream& os, const JdwpTypeTag& value);
216
217/*
218 * Tag constants.
219 */
Elliott Hughesdbb40792011-11-18 17:05:22 -0800220enum JdwpTag {
Elliott Hughes872d4ec2011-10-21 17:07:15 -0700221 JT_ARRAY = '[',
222 JT_BYTE = 'B',
223 JT_CHAR = 'C',
224 JT_OBJECT = 'L',
225 JT_FLOAT = 'F',
226 JT_DOUBLE = 'D',
227 JT_INT = 'I',
228 JT_LONG = 'J',
229 JT_SHORT = 'S',
230 JT_VOID = 'V',
231 JT_BOOLEAN = 'Z',
232 JT_STRING = 's',
233 JT_THREAD = 't',
234 JT_THREAD_GROUP = 'g',
235 JT_CLASS_LOADER = 'l',
236 JT_CLASS_OBJECT = 'c',
237};
Elliott Hughesdbb40792011-11-18 17:05:22 -0800238std::ostream& operator<<(std::ostream& os, const JdwpTag& value);
Elliott Hughes872d4ec2011-10-21 17:07:15 -0700239
240} // namespace JDWP
241
242} // namespace art
243
244#endif // ART_JDWP_JDWPCONSTANTS_H_