1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  */
18 
19 /**
20  * @author Aleksey V. Yantsen
21  */
22 
23 /**
24  * Created on 12.03.2004
25  */
26 package org.apache.harmony.jpda.tests.framework.jdwp;
27 
28 /**
29  * This class defines constants for JDWP commands and command sets.
30  */
31 public class JDWPCommands {
32 
33     /**
34      * JDWP VirtualMachine Command Set constants.
35      */
36     public class VirtualMachineCommandSet {
37 
38         public static final byte CommandSetID = 1;
39 
40         public static final byte VersionCommand = 1;
41 
42         public static final byte ClassesBySignatureCommand = 2;
43 
44         public static final byte AllClassesCommand = 3;
45 
46         public static final byte AllThreadsCommand = 4;
47 
48         public static final byte TopLevelThreadGroupsCommand = 5;
49 
50         public static final byte DisposeCommand = 6;
51 
52         public static final byte IDSizesCommand = 7;
53 
54         public static final byte SuspendCommand = 8;
55 
56         public static final byte ResumeCommand = 9;
57 
58         public static final byte ExitCommand = 10;
59 
60         public static final byte CreateStringCommand = 11;
61 
62         public static final byte CapabilitiesCommand = 12;
63 
64         public static final byte ClassPathsCommand = 13;
65 
66         public static final byte DisposeObjectsCommand = 14;
67 
68         public static final byte HoldEventsCommand = 15;
69 
70         public static final byte ReleaseEventsCommand = 16;
71 
72         public static final byte CapabilitiesNewCommand = 17;
73 
74         public static final byte RedefineClassesCommand = 18;
75 
76         public static final byte SetDefaultStratumCommand = 19;
77 
78         public static final byte AllClassesWithGenericCommand = 20;
79 
80         //New commands for Java 6
81         public static final byte InstanceCountsCommand = 21;
82     }
83 
84     /**
85      * JDWP ReferenceType Command Set constants.
86      */
87     public class ReferenceTypeCommandSet {
88 
89         public static final byte CommandSetID = 2;
90 
91         public static final byte SignatureCommand = 1;
92 
93         public static final byte ClassLoaderCommand = 2;
94 
95         public static final byte ModifiersCommand = 3;
96 
97         public static final byte FieldsCommand = 4;
98 
99         public static final byte MethodsCommand = 5;
100 
101         public static final byte GetValuesCommand = 6;
102 
103         public static final byte SourceFileCommand = 7;
104 
105         public static final byte NestedTypesCommand = 8;
106 
107         public static final byte StatusCommand = 9;
108 
109         public static final byte InterfacesCommand = 10;
110 
111         public static final byte ClassObjectCommand = 11;
112 
113         public static final byte SourceDebugExtensionCommand = 12;
114 
115         public static final byte SignatureWithGenericCommand = 13;
116 
117         public static final byte FieldsWithGenericCommand = 14;
118 
119         public static final byte MethodsWithGenericCommand = 15;
120 
121         //New commands for Java 6
122         public static final byte InstancesCommand = 16;
123 
124         public static final byte ClassFileVersionCommand = 17;
125 
126         public static final byte ConstantPoolCommand = 18;
127     }
128 
129     /**
130      * JDWP ClassType Command Set constants.
131      */
132     public class ClassTypeCommandSet {
133 
134         public static final byte CommandSetID = 3;
135 
136         public static final byte SuperclassCommand = 1;
137 
138         public static final byte SetValuesCommand = 2;
139 
140         public static final byte InvokeMethodCommand = 3;
141 
142         public static final byte NewInstanceCommand = 4;
143     }
144 
145     /**
146      * JDWP ArrayType Command Set constants.
147      */
148     public class ArrayTypeCommandSet {
149 
150         public static final byte CommandSetID = 4;
151 
152         public static final byte NewInstanceCommand = 1;
153     }
154 
155     /**
156      * JDWP InterfaceType Command Set constants.
157      */
158     public class InterfaceTypeCommandSet {
159         public static final byte CommandSetID = 5;
160 
161         public static final byte InvokeMethodCommand = 1;
162     }
163 
164     /**
165      * JDWP Method Command Set constants.
166      */
167     public class MethodCommandSet {
168 
169         public static final byte CommandSetID = 6;
170 
171         public static final byte LineTableCommand = 1;
172 
173         public static final byte VariableTableCommand = 2;
174 
175         public static final byte BytecodesCommand = 3;
176 
177         public static final byte IsObsoleteCommand = 4;
178 
179         public static final byte VariableTableWithGenericCommand = 5;
180     }
181 
182     /**
183      * JDWP Field Command Set constants.
184      */
185     public class FieldCommandSet {
186 
187         public static final byte CommandSetID = 8;
188     }
189 
190     /**
191      * JDWP ObjectReference Command Set constants.
192      */
193     public class ObjectReferenceCommandSet {
194 
195         public static final byte CommandSetID = 9;
196 
197         public static final byte ReferenceTypeCommand = 1;
198 
199         public static final byte GetValuesCommand = 2;
200 
201         public static final byte SetValuesCommand = 3;
202 
203         public static final byte MonitorInfoCommand = 5;
204 
205         public static final byte InvokeMethodCommand = 6;
206 
207         public static final byte DisableCollectionCommand = 7;
208 
209         public static final byte EnableCollectionCommand = 8;
210 
211         public static final byte IsCollectedCommand = 9;
212 
213         //New commands for Java 6
214         public static final byte ReferringObjectsCommand = 10;
215     }
216 
217     /**
218      * JDWP String Command Set constants.
219      */
220     public class StringReferenceCommandSet {
221 
222         public static final byte CommandSetID = 10;
223 
224         public static final byte ValueCommand = 1;
225     }
226 
227     /**
228      * JDWP ThreadReference Command Set constants.
229      */
230     public class ThreadReferenceCommandSet {
231 
232         public static final byte CommandSetID = 11;
233 
234         public static final byte NameCommand = 1;
235 
236         public static final byte SuspendCommand = 2;
237 
238         public static final byte ResumeCommand = 3;
239 
240         public static final byte StatusCommand = 4;
241 
242         public static final byte ThreadGroupCommand = 5;
243 
244         public static final byte FramesCommand = 6;
245 
246         public static final byte FrameCountCommand = 7;
247 
248         public static final byte OwnedMonitorsCommand = 8;
249 
250         public static final byte CurrentContendedMonitorCommand = 9;
251 
252         public static final byte StopCommand = 10;
253 
254         public static final byte InterruptCommand = 11;
255 
256         public static final byte SuspendCountCommand = 12;
257 
258         //New command for Java 6
259         public static final byte OwnedMonitorsStackDepthInfoCommand = 13;
260 
261         public static final byte ForceEarlyReturnCommand = 14;
262     }
263 
264     /**
265      * JDWP ThreadGroupReference Command Set constants.
266      */
267     public class ThreadGroupReferenceCommandSet {
268 
269         public static final byte CommandSetID = 12;
270 
271         public static final byte NameCommand = 1;
272 
273         public static final byte ParentCommand = 2;
274 
275         public static final byte ChildrenCommand = 3;
276     }
277 
278     /**
279      * JDWP ArrayReference Command Set constants.
280      */
281     public class ArrayReferenceCommandSet {
282 
283         public static final byte CommandSetID = 13;
284 
285         public static final byte LengthCommand = 1;
286 
287         public static final byte GetValuesCommand = 2;
288 
289         public static final byte SetValuesCommand = 3;
290     }
291 
292     /**
293      * JDWP ClassLoaderReference Command Set constants.
294      */
295     public class ClassLoaderReferenceCommandSet {
296 
297         public static final byte CommandSetID = 14;
298 
299         public static final byte VisibleClassesCommand = 1;
300     }
301 
302     /**
303      * JDWP EventRequest Command Set constants.
304      */
305     public class EventRequestCommandSet {
306 
307         public static final byte CommandSetID = 15;
308 
309         public static final byte SetCommand = 1;
310 
311         public static final byte ClearCommand = 2;
312 
313         public static final byte ClearAllBreakpointsCommand = 3;
314     }
315 
316     /**
317      * JDWP StackFrame Command Set constants.
318      */
319     public class StackFrameCommandSet {
320 
321         public static final byte CommandSetID = 16;
322 
323         public static final byte GetValuesCommand = 1;
324 
325         public static final byte SetValuesCommand = 2;
326 
327         public static final byte ThisObjectCommand = 3;
328 
329         public static final byte PopFramesCommand = 4;
330     }
331 
332     /**
333      * JDWP ClassObjectReference Command Set constants.
334      */
335     public class ClassObjectReferenceCommandSet {
336 
337         public static final byte CommandSetID = 17;
338 
339         public static final byte ReflectedTypeCommand = 1;
340     }
341 
342     /**
343      * JDWP Event Command Set constants.
344      */
345     public class EventCommandSet {
346 
347         public static final byte CommandSetID = 64;
348 
349         public static final byte CompositeCommand = 100;
350     }
351 
352 }
353