blob: 922dbcde1976b4d044cbb78bca227521e70bcd40 [file] [log] [blame]
The Android Open Source Projectf6c38712009-03-03 19:28:47 -08001/*
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 _DALVIK_JDWP_JDWPCONSTANTS
20#define _DALVIK_JDWP_JDWPCONSTANTS
21
22/*
23 * Error constants.
24 */
25enum JdwpError {
26 ERR_NONE = 0,
27 ERR_INVALID_THREAD = 10,
28 ERR_INVALID_THREAD_GROUP = 11,
29 ERR_INVALID_PRIORITY = 12,
30 ERR_THREAD_NOT_SUSPENDED = 13,
31 ERR_THREAD_SUSPENDED = 14,
32 ERR_INVALID_OBJECT = 20,
33 ERR_INVALID_CLASS = 21,
34 ERR_CLASS_NOT_PREPARED = 22,
35 ERR_INVALID_METHODID = 23,
36 ERR_INVALID_LOCATION = 24,
37 ERR_INVALID_FIELDID = 25,
38 ERR_INVALID_FRAMEID = 30,
39 ERR_NO_MORE_FRAMES = 31,
40 ERR_OPAQUE_FRAME = 32,
41 ERR_NOT_CURRENT_FRAME = 33,
42 ERR_TYPE_MISMATCH = 34,
43 ERR_INVALID_SLOT = 35,
44 ERR_DUPLICATE = 40,
45 ERR_NOT_FOUND = 41,
46 ERR_INVALID_MONITOR = 50,
47 ERR_NOT_MONITOR_OWNER = 51,
48 ERR_INTERRUPT = 52,
49 ERR_INVALID_CLASS_FORMAT = 60,
50 ERR_CIRCULAR_CLASS_DEFINITION = 61,
51 ERR_FAILS_VERIFICATION = 62,
52 ERR_ADD_METHOD_NOT_IMPLEMENTED = 63,
53 ERR_SCHEMA_CHANGE_NOT_IMPLEMENTED = 64,
54 ERR_INVALID_TYPESTATE = 65,
55 ERR_HIERARCHY_CHANGE_NOT_IMPLEMENTED = 66,
56 ERR_DELETE_METHOD_NOT_IMPLEMENTED = 67,
57 ERR_UNSUPPORTED_VERSION = 68,
58 ERR_NAMES_DONT_MATCH = 69,
59 ERR_CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED = 70,
60 ERR_METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED = 71,
61 ERR_NOT_IMPLEMENTED = 99,
62 ERR_NULL_POINTER = 100,
63 ERR_ABSENT_INFORMATION = 101,
64 ERR_INVALID_EVENT_TYPE = 102,
65 ERR_ILLEGAL_ARGUMENT = 103,
66 ERR_OUT_OF_MEMORY = 110,
67 ERR_ACCESS_DENIED = 111,
68 ERR_VM_DEAD = 112,
69 ERR_INTERNAL = 113,
70 ERR_UNATTACHED_THREAD = 115,
71 ERR_INVALID_TAG = 500,
72 ERR_ALREADY_INVOKING = 502,
73 ERR_INVALID_INDEX = 503,
74 ERR_INVALID_LENGTH = 504,
75 ERR_INVALID_STRING = 506,
76 ERR_INVALID_CLASS_LOADER = 507,
77 ERR_INVALID_ARRAY = 508,
78 ERR_TRANSPORT_LOAD = 509,
79 ERR_TRANSPORT_INIT = 510,
80 ERR_NATIVE_METHOD = 511,
81 ERR_INVALID_COUNT = 512,
82};
83typedef enum JdwpError JdwpError;
84const char* dvmJdwpErrorStr(enum JdwpError error);
85
86
87/*
88 * ClassStatus constants. These are bit flags that can be ORed together.
89 */
90enum JdwpClassStatus {
91 CS_VERIFIED = 0x01,
92 CS_PREPARED = 0x02,
93 CS_INITIALIZED = 0x04,
94 CS_ERROR = 0x08,
95};
96
97/*
98 * EventKind constants.
99 */
100enum JdwpEventKind {
101 EK_SINGLE_STEP = 1,
102 EK_BREAKPOINT = 2,
103 EK_FRAME_POP = 3,
104 EK_EXCEPTION = 4,
105 EK_USER_DEFINED = 5,
106 EK_THREAD_START = 6,
107 EK_THREAD_END = 7,
108 EK_CLASS_PREPARE = 8,
109 EK_CLASS_UNLOAD = 9,
110 EK_CLASS_LOAD = 10,
111 EK_FIELD_ACCESS = 20,
112 EK_FIELD_MODIFICATION = 21,
113 EK_EXCEPTION_CATCH = 30,
114 EK_METHOD_ENTRY = 40,
115 EK_METHOD_EXIT = 41,
116 EK_VM_INIT = 90,
117 EK_VM_DEATH = 99,
118 EK_VM_DISCONNECTED = 100, /* "Never sent across JDWP */
119 EK_VM_START = EK_VM_INIT,
120 EK_THREAD_DEATH = EK_THREAD_END,
121};
122const char* dvmJdwpEventKindStr(enum JdwpEventKind kind);
123
124/*
125 * Values for "modKind" in EventRequest.Set.
126 */
127enum JdwpModKind {
128 MK_COUNT = 1,
129 MK_CONDITIONAL = 2,
130 MK_THREAD_ONLY = 3,
131 MK_CLASS_ONLY = 4,
132 MK_CLASS_MATCH = 5,
133 MK_CLASS_EXCLUDE = 6,
134 MK_LOCATION_ONLY = 7,
135 MK_EXCEPTION_ONLY = 8,
136 MK_FIELD_ONLY = 9,
137 MK_STEP = 10,
138 MK_INSTANCE_ONLY = 11,
139};
140
141/*
142 * InvokeOptions constants (bit flags).
143 */
144enum JdwpInvokeOptions {
145 INVOKE_SINGLE_THREADED = 0x01,
146 INVOKE_NONVIRTUAL = 0x02,
147};
148
149/*
150 * StepDepth constants.
151 */
152enum JdwpStepDepth {
153 SD_INTO = 0, /* step into method calls */
154 SD_OVER = 1, /* step over method calls */
155 SD_OUT = 2, /* step out of current method */
156};
157const char* dvmJdwpStepDepthStr(enum JdwpStepDepth depth);
158
159/*
160 * StepSize constants.
161 */
162enum JdwpStepSize {
163 SS_MIN = 0, /* step by minimum (e.g. 1 bytecode inst) */
164 SS_LINE = 1, /* if possible, step to next line */
165};
166const char* dvmJdwpStepSizeStr(enum JdwpStepSize size);
167
168/*
169 * SuspendPolicy constants.
170 */
171enum JdwpSuspendPolicy {
172 SP_NONE = 0, /* suspend no threads */
173 SP_EVENT_THREAD = 1, /* suspend event thread */
174 SP_ALL = 2, /* suspend all threads */
175};
176const char* dvmJdwpSuspendPolicyStr(enum JdwpSuspendPolicy policy);
177
178/*
179 * SuspendStatus constants.
180 */
181enum JdwpSuspendStatus {
182 SUSPEND_STATUS_SUSPENDED = 1,
183};
184const char* dvmJdwpSuspendStatusStr(enum JdwpSuspendStatus status);
185
186/*
187 * ThreadStatus constants.
188 */
189enum JdwpThreadStatus {
190 TS_ZOMBIE = 0,
191 TS_RUNNING = 1, // RUNNING
192 TS_SLEEPING = 2, // (in Thread.sleep())
193 TS_MONITOR = 3, // WAITING (monitor wait)
194 TS_WAIT = 4, // (in Object.wait())
195};
196const char* dvmJdwpThreadStatusStr(enum JdwpThreadStatus status);
197
198/*
199 * TypeTag constants.
200 */
201enum JdwpTypeTag {
202 TT_CLASS = 1,
203 TT_INTERFACE = 2,
204 TT_ARRAY = 3,
205};
206
207/*
208 * Tag constants.
209 */
210enum JdwpType {
211 JT_ARRAY = '[',
212 JT_BYTE = 'B',
213 JT_CHAR = 'C',
214 JT_OBJECT = 'L',
215 JT_FLOAT = 'F',
216 JT_DOUBLE = 'D',
217 JT_INT = 'I',
218 JT_LONG = 'J',
219 JT_SHORT = 'S',
220 JT_VOID = 'V',
221 JT_BOOLEAN = 'Z',
222 JT_STRING = 's',
223 JT_THREAD = 't',
224 JT_THREAD_GROUP = 'g',
225 JT_CLASS_LOADER = 'l',
226 JT_CLASS_OBJECT = 'c',
227};
228
229#endif /*_DALVIK_JDWP_JDWPCONSTANTS*/