KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdi > internal > spy > VerbosePacketStream


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  * Keith Seitz - Bug 165988
11  *******************************************************************************/

12 package org.eclipse.jdi.internal.spy;
13
14
15 import java.io.ByteArrayInputStream JavaDoc;
16 import java.io.DataInputStream JavaDoc;
17 import java.io.IOException JavaDoc;
18 import java.io.OutputStream JavaDoc;
19 import java.io.PrintStream JavaDoc;
20 import java.io.UTFDataFormatException JavaDoc;
21 import com.ibm.icu.text.MessageFormat;
22 import java.util.Arrays JavaDoc;
23
24 /**
25  * The <code>VerbosePacketWriter</code> is responsible for writing
26  * out JdwpPacket data in human readable form.
27  */

28 public class VerbosePacketStream extends PrintStream JavaDoc {
29     /** Tag Constants. */
30 // public static final byte NULL_TAG = 91; // Used for tagged null values.
31
public static final byte ARRAY_TAG = 91; // '[' - an array object (objectID size).
32
public static final byte BYTE_TAG = 66; // 'B' - a byte value (1 byte).
33
public static final byte CHAR_TAG = 67; // 'C' - a character value (2 bytes).
34
public static final byte OBJECT_TAG = 76; // 'L' - an object (objectID size).
35
public static final byte FLOAT_TAG = 70; // 'F' - a float value (4 bytes).
36
public static final byte DOUBLE_TAG = 68; // 'D' - a double value (8 bytes).
37
public static final byte INT_TAG = 73; // 'I' - an int value (4 bytes).
38
public static final byte LONG_TAG = 74; // 'J' - a long value (8 bytes).
39
public static final byte SHORT_TAG = 83; // 'S' - a short value (2 bytes).
40
public static final byte VOID_TAG = 86; // 'V' - a void value (no bytes).
41
public static final byte BOOLEAN_TAG = 90; // 'Z' - a boolean value (1 byte).
42
public static final byte STRING_TAG = 115; // 's' - a String object (objectID size).
43
public static final byte THREAD_TAG = 116; // 't' - a Thread object (objectID size).
44
public static final byte THREAD_GROUP_TAG = 103; // 'g' - a ThreadGroup object (objectID size).
45
public static final byte CLASS_LOADER_TAG = 108; // 'l' - a ClassLoader object (objectID size).
46
public static final byte CLASS_OBJECT_TAG = 99; // 'c' - a class object object (objectID size).
47

48     /** TypeTag Constants. */
49     public static final byte TYPE_TAG_CLASS = 1; // ReferenceType is a class.
50
public static final byte TYPE_TAG_INTERFACE = 2; // ReferenceType is an interface.
51
public static final byte TYPE_TAG_ARRAY = 3; // ReferenceType is an array.
52

53     /** ClassStatus Constants. */
54     public static final int JDWP_CLASS_STATUS_VERIFIED = 1;
55     public static final int JDWP_CLASS_STATUS_PREPARED = 2;
56     public static final int JDWP_CLASS_STATUS_INITIALIZED = 4;
57     public static final int JDWP_CLASS_STATUS_ERROR = 8;
58     
59     /** access_flags Constants */
60     public static final int ACC_PUBLIC= 0x0001;
61     public static final int ACC_PRIVATE= 0x0002;
62     public static final int ACC_PROTECTED= 0x0004;
63     public static final int ACC_STATIC= 0x0008;
64     public static final int ACC_FINAL= 0x0010;
65     public static final int ACC_SUPER= 0x0020;
66     public static final int ACC_VOLATILE= 0x0040;
67     public static final int ACC_TRANSIENT= 0x0080;
68     public static final int ACC_NATIVE= 0x0100;
69     public static final int ACC_INTERFACE= 0x0200;
70     public static final int ACC_ABSTRACT= 0x0400;
71     public static final int ACC_STRICT= 0x0800;
72     public static final int ACC_ENUM= 0x0100;
73     public static final int ACC_VARARGS= 0x0080;
74     public static final int ACC_BRIDGE= 0x0040;
75     public static final int ACC_SYNTHETIC= 0x1000;
76     public static final int ACC_SYNCHRONIZED=0x0020;
77     
78     public static final int ACC_EXT_SYNTHETIC= 0xf0000000;
79     
80     /** Invoke options constants */
81     public static final int INVOKE_SINGLE_THREADED= 0x01;
82     public static final int INVOKE_NONVIRTUAL= 0x02;
83     
84     /** ThreadStatus Constants */
85     public static final int THREAD_STATUS_ZOMBIE= 0;
86     public static final int THREAD_STATUS_RUNNING= 1;
87     public static final int THREAD_STATUS_SLEEPING= 2;
88     public static final int THREAD_STATUS_MONITOR= 3;
89     public static final int THREAD_STATUS_WAIT= 4;
90     
91     /** EventKind Constants */
92     public static final int EVENTKIND_SINGLE_STEP= 1;
93     public static final int EVENTKIND_BREAKPOINT= 2;
94     public static final int EVENTKIND_FRAME_POP= 3;
95     public static final int EVENTKIND_EXCEPTION= 4;
96     public static final int EVENTKIND_USER_DEFINED= 5;
97     public static final int EVENTKIND_THREAD_START= 6;
98     public static final int EVENTKIND_THREAD_END= 7;
99     public static final int EVENTKIND_THREAD_DEATH= EVENTKIND_THREAD_END;
100     public static final int EVENTKIND_CLASS_PREPARE= 8;
101     public static final int EVENTKIND_CLASS_UNLOAD= 9;
102     public static final int EVENTKIND_CLASS_LOAD= 10;
103     public static final int EVENTKIND_FIELD_ACCESS= 20;
104     public static final int EVENTKIND_FIELD_MODIFICATION= 21;
105     public static final int EVENTKIND_EXCEPTION_CATCH= 30;
106     public static final int EVENTKIND_METHOD_ENTRY= 40;
107     public static final int EVENTKIND_METHOD_EXIT= 41;
108     public static final int EVENTKIND_VM_INIT= 90;
109     public static final int EVENTKIND_VM_START= EVENTKIND_VM_INIT;
110     public static final int EVENTKIND_VM_DEATH= 99;
111     public static final int EVENTKIND_VM_DISCONNECTED= 100;
112     
113     /** SuspendStatus Constants */
114     public static final int SUSPEND_STATUS_SUSPENDED= 0x01;
115     
116     /** SuspendPolicy Constants */
117     public static final int SUSPENDPOLICY_NONE= 0;
118     public static final int SUSPENDPOLICY_EVENT_THREAD= 1;
119     public static final int SUSPENDPOLICY_ALL= 2;
120     
121     /** StepDepth Constants */
122     public static final int STEPDEPTH_INTO= 0;
123     public static final int STEPDEPTH_OVER= 1;
124     public static final int STEPDEPTH_OUT= 2;
125
126     /** StepSize Constants */
127     public static final int STEPSIZE_MIN= 0;
128     public static final int STEPSIZE_LINE= 1;
129         
130     private static final byte[] padding;
131     static {
132         padding= new byte[256];
133         Arrays.fill(padding, (byte)' ');
134     }
135     
136     private static final String JavaDoc shift= new String JavaDoc(padding, 0, 32);
137
138     public VerbosePacketStream(OutputStream JavaDoc out) {
139         super(out);
140     }
141         
142     private static final byte[] zeros;
143     static {
144         zeros= new byte[16];
145         Arrays.fill(zeros, (byte)'0');
146     }
147     
148     public synchronized void print(JdwpPacket packet, boolean fromVM) throws IOException JavaDoc {
149         try {
150             printHeader(packet, fromVM);
151             printData(packet);
152             println();
153         } catch (UnableToParseDataException e) {
154             println("\n" + e.getMessage() + ':'); //$NON-NLS-1$
155
printDescription("Remaining data:"); //$NON-NLS-1$
156
byte[] data= e.getRemainingData();
157             if (data == null) {
158                 printHex(packet.data());
159             } else {
160                 printHex(e.getRemainingData());
161             }
162             println();
163         }
164     }
165     
166     protected void printHeader(JdwpPacket packet, boolean fromVM) throws UnableToParseDataException {
167         if (fromVM) {
168             println("From VM"); //$NON-NLS-1$
169
} else {
170             println("From Debugger"); //$NON-NLS-1$
171
}
172         
173         printDescription("Packet ID:"); //$NON-NLS-1$
174
printHex(packet.getId());
175         println();
176                 
177         printDescription("Length:"); //$NON-NLS-1$
178
print(packet.getLength());
179         println();
180         
181         printDescription("Flags:"); //$NON-NLS-1$
182
byte flags= packet.getFlags();
183         printHex(flags);
184         if ((flags & JdwpPacket.FLAG_REPLY_PACKET) != 0) {
185             print(MessageFormat.format(" (REPLY to {0})", new String JavaDoc[] {(String JavaDoc) JdwpCommandPacket.commandMap().get(new Integer JavaDoc(TcpipSpy.getCommand(packet)))})); //$NON-NLS-1$
186
} else {
187             print(" (COMMAND)"); //$NON-NLS-1$
188
}
189         println();
190         
191         printSpecificHeaderFields(packet);
192     }
193
194     protected void printSpecificHeaderFields(JdwpPacket packet) {
195         if (packet instanceof JdwpReplyPacket) {
196             printError((JdwpReplyPacket) packet);
197         } else if (packet instanceof JdwpCommandPacket) {
198             printCommand((JdwpCommandPacket) packet);
199         }
200     }
201
202     protected void printCommand(JdwpCommandPacket commandPacket) {
203         printDescription("Command set:"); //$NON-NLS-1$
204
int commandAndSet= commandPacket.getCommand();
205         byte set= (byte)(commandAndSet >> 8);
206         byte command= (byte)commandAndSet;
207         printHex(set);
208         printParanthetical(set);
209         println();
210         printDescription("Command:"); //$NON-NLS-1$
211
printHex(command);
212         printParanthetical(command);
213         print(" ("); //$NON-NLS-1$
214
print(JdwpCommandPacket.commandMap().get(new Integer JavaDoc(commandAndSet)));
215         println(')');
216     }
217
218     protected void printError(JdwpReplyPacket reply) {
219         int error= reply.errorCode();
220         
221         printDescription("Error:"); //$NON-NLS-1$
222
printHex(error);
223         if (error != 0) {
224             print(" ("); //$NON-NLS-1$
225
print(JdwpReplyPacket.errorMap().get(new Integer JavaDoc(error)));
226             print(')');
227         }
228         println();
229     }
230
231     protected void printData(JdwpPacket packet) throws IOException JavaDoc, UnableToParseDataException {
232         if ((packet.getFlags() & JdwpPacket.FLAG_REPLY_PACKET) != 0) {
233             printReplyData((JdwpReplyPacket) packet);
234         } else {
235             printCommandData((JdwpCommandPacket) packet);
236         }
237     }
238
239     private void printCommandData(JdwpCommandPacket command) throws IOException JavaDoc, UnableToParseDataException {
240         byte[] data= command.data();
241         if (data == null)
242             return;
243         DataInputStream JavaDoc in= new DataInputStream JavaDoc(new ByteArrayInputStream JavaDoc(data));
244         int commandId= command.getCommand();
245         switch (commandId) {
246             /** Commands VirtualMachine. */
247             case JdwpCommandPacket.VM_VERSION:
248                 // no data
249
break;
250             case JdwpCommandPacket.VM_CLASSES_BY_SIGNATURE:
251                 printVmClassesBySignatureCommand(in);
252                 break;
253             case JdwpCommandPacket.VM_ALL_CLASSES:
254                 // no data
255
break;
256             case JdwpCommandPacket.VM_ALL_THREADS:
257                 // no data
258
break;
259             case JdwpCommandPacket.VM_TOP_LEVEL_THREAD_GROUPS:
260                 // no data
261
break;
262             case JdwpCommandPacket.VM_DISPOSE:
263                 // no data
264
break;
265             case JdwpCommandPacket.VM_ID_SIZES:
266                 // no data
267
break;
268             case JdwpCommandPacket.VM_SUSPEND:
269                 // no data
270
break;
271             case JdwpCommandPacket.VM_RESUME:
272                 // no data
273
break;
274             case JdwpCommandPacket.VM_EXIT:
275                 printVmExitCommand(in);
276                 break;
277             case JdwpCommandPacket.VM_CREATE_STRING:
278                 printVmCreateStringCommand(in);
279                 break;
280             case JdwpCommandPacket.VM_CAPABILITIES:
281                 // no data
282
break;
283             case JdwpCommandPacket.VM_CLASS_PATHS:
284                 // no data
285
break;
286             case JdwpCommandPacket.VM_DISPOSE_OBJECTS:
287                 printVmDisposeObjectsCommand(in);
288                 break;
289             case JdwpCommandPacket.VM_HOLD_EVENTS:
290                 // no data
291
break;
292             case JdwpCommandPacket.VM_RELEASE_EVENTS:
293                 // no data
294
break;
295             case JdwpCommandPacket.VM_CAPABILITIES_NEW:
296                 // no data
297
break;
298             case JdwpCommandPacket.VM_REDEFINE_CLASSES:
299                 printVmRedefineClassCommand(in);
300                 break;
301             case JdwpCommandPacket.VM_SET_DEFAULT_STRATUM:
302                 printVmSetDefaultStratumCommand(in);
303                 break;
304             case JdwpCommandPacket.VM_ALL_CLASSES_WITH_GENERIC:
305                 // no data
306
break;
307         
308             /** Commands ReferenceType. */
309             case JdwpCommandPacket.RT_SIGNATURE:
310                 printRtDefaultCommand(in);
311                 break;
312             case JdwpCommandPacket.RT_CLASS_LOADER:
313                 printRtDefaultCommand(in);
314                 break;
315             case JdwpCommandPacket.RT_MODIFIERS:
316                 printRtDefaultCommand(in);
317                 break;
318             case JdwpCommandPacket.RT_FIELDS:
319                 printRtDefaultCommand(in);
320                 break;
321             case JdwpCommandPacket.RT_METHODS:
322                 printRtDefaultCommand(in);
323                 break;
324             case JdwpCommandPacket.RT_GET_VALUES:
325                 printRtGetValuesCommand(in);
326                 break;
327             case JdwpCommandPacket.RT_SOURCE_FILE:
328                 printRtDefaultCommand(in);
329                 break;
330             case JdwpCommandPacket.RT_NESTED_TYPES:
331                 printRtDefaultCommand(in);
332                 break;
333             case JdwpCommandPacket.RT_STATUS:
334                 printRtDefaultCommand(in);
335                 break;
336             case JdwpCommandPacket.RT_INTERFACES:
337                 printRtDefaultCommand(in);
338                 break;
339             case JdwpCommandPacket.RT_CLASS_OBJECT:
340                 printRtDefaultCommand(in);
341                 break;
342             case JdwpCommandPacket.RT_SOURCE_DEBUG_EXTENSION:
343                 printRtDefaultCommand(in);
344                 break;
345             case JdwpCommandPacket.RT_SIGNATURE_WITH_GENERIC:
346                 printRtDefaultCommand(in);
347                 break;
348             case JdwpCommandPacket.RT_FIELDS_WITH_GENERIC:
349                 printRtDefaultCommand(in);
350                 break;
351             case JdwpCommandPacket.RT_METHODS_WITH_GENERIC:
352                 printRtDefaultCommand(in);
353                 break;
354         
355             /** Commands ClassType. */
356             case JdwpCommandPacket.CT_SUPERCLASS:
357                 printCtSuperclassCommand(in);
358                 break;
359             case JdwpCommandPacket.CT_SET_VALUES:
360                 printCtSetValuesCommand(in);
361                 break;
362             case JdwpCommandPacket.CT_INVOKE_METHOD:
363                 printCtInvokeMethodCommand(in);
364                 break;
365             case JdwpCommandPacket.CT_NEW_INSTANCE:
366                 printCtNewInstanceCommand(in);
367                 break;
368         
369             /** Commands ArrayType. */
370             case JdwpCommandPacket.AT_NEW_INSTANCE:
371                 printAtNewInstanceCommand(in);
372                 break;
373         
374             /** Commands Method. */
375             case JdwpCommandPacket.M_LINE_TABLE:
376                 printMDefaultCommand(in);
377                 break;
378             case JdwpCommandPacket.M_VARIABLE_TABLE:
379                 printMDefaultCommand(in);
380                 break;
381             case JdwpCommandPacket.M_BYTECODES:
382                 printMDefaultCommand(in);
383                 break;
384             case JdwpCommandPacket.M_IS_OBSOLETE:
385                 printMDefaultCommand(in);
386                 break;
387             case JdwpCommandPacket.M_VARIABLE_TABLE_WITH_GENERIC:
388                 printMDefaultCommand(in);
389                 break;
390         
391             /** Commands ObjectReference. */
392             case JdwpCommandPacket.OR_REFERENCE_TYPE:
393                 printOrDefaultCommand(in);
394                 break;
395             case JdwpCommandPacket.OR_GET_VALUES:
396                 printOrGetValuesCommand(in);
397                 break;
398             case JdwpCommandPacket.OR_SET_VALUES:
399                 printOrSetValuesCommand(in);
400                 break;
401             case JdwpCommandPacket.OR_MONITOR_INFO:
402                 printOrDefaultCommand(in);
403                 break;
404             case JdwpCommandPacket.OR_INVOKE_METHOD:
405                 printOrInvokeMethodCommand(in);
406                 break;
407             case JdwpCommandPacket.OR_DISABLE_COLLECTION:
408                 printOrDefaultCommand(in);
409                 break;
410             case JdwpCommandPacket.OR_ENABLE_COLLECTION:
411                 printOrDefaultCommand(in);
412                 break;
413             case JdwpCommandPacket.OR_IS_COLLECTED:
414                 printOrDefaultCommand(in);
415                 break;
416         
417             /** Commands StringReference. */
418             case JdwpCommandPacket.SR_VALUE:
419                 printSrValueCommand(in);
420                 break;
421         
422             /** Commands ThreadReference. */
423             case JdwpCommandPacket.TR_NAME:
424                 printTrDefaultCommand(in);
425                 break;
426             case JdwpCommandPacket.TR_SUSPEND:
427                 printTrDefaultCommand(in);
428                 break;
429             case JdwpCommandPacket.TR_RESUME:
430                 printTrDefaultCommand(in);
431                 break;
432             case JdwpCommandPacket.TR_STATUS:
433                 printTrDefaultCommand(in);
434                 break;
435             case JdwpCommandPacket.TR_THREAD_GROUP:
436                 printTrDefaultCommand(in);
437                 break;
438             case JdwpCommandPacket.TR_FRAMES:
439                 printTrFramesCommand(in);
440                 break;
441             case JdwpCommandPacket.TR_FRAME_COUNT:
442                 printTrDefaultCommand(in);
443                 break;
444             case JdwpCommandPacket.TR_OWNED_MONITORS:
445                 printTrDefaultCommand(in);
446                 break;
447             case JdwpCommandPacket.TR_CURRENT_CONTENDED_MONITOR:
448                 printTrDefaultCommand(in);
449                 break;
450             case JdwpCommandPacket.TR_STOP:
451                 printTrStopCommand(in);
452                 break;
453             case JdwpCommandPacket.TR_INTERRUPT:
454                 printTrDefaultCommand(in);
455                 break;
456             case JdwpCommandPacket.TR_SUSPEND_COUNT:
457                 printTrDefaultCommand(in);
458                 break;
459 /* no more in the jdwp spec
460             case JdwpCommandPacket.TR_POP_TOP_FRAME:
461                 break;
462 */

463         
464             /** Commands ThreadGroupReference. */
465             case JdwpCommandPacket.TGR_NAME:
466                 printTgrDefaultCommand(in);
467                 break;
468             case JdwpCommandPacket.TGR_PARENT:
469                 printTgrDefaultCommand(in);
470                 break;
471             case JdwpCommandPacket.TGR_CHILDREN:
472                 printTgrDefaultCommand(in);
473                 break;
474         
475             /** Commands ArrayReference. */
476             case JdwpCommandPacket.AR_LENGTH:
477                 printArLengthCommand(in);
478                 break;
479             case JdwpCommandPacket.AR_GET_VALUES:
480                 printArGetValuesCommand(in);
481                 break;
482             case JdwpCommandPacket.AR_SET_VALUES:
483                 printArSetValuesCommand(in);
484                 break;
485         
486             /** Commands ClassLoaderReference. */
487             case JdwpCommandPacket.CLR_VISIBLE_CLASSES:
488                 printClrVisibleClassesCommand(in);
489                 break;
490         
491             /** Commands EventRequest. */
492             case JdwpCommandPacket.ER_SET:
493                 printErSetCommand(in);
494                 break;
495             case JdwpCommandPacket.ER_CLEAR:
496                 printErClearCommand(in);
497                 break;
498             case JdwpCommandPacket.ER_CLEAR_ALL_BREAKPOINTS:
499                 // no data
500
break;
501         
502             /** Commands StackFrame. */
503             case JdwpCommandPacket.SF_GET_VALUES:
504                 printSfGetValuesCommand(in);
505                 break;
506             case JdwpCommandPacket.SF_SET_VALUES:
507                 printSfSetValuesCommand(in);
508                 break;
509             case JdwpCommandPacket.SF_THIS_OBJECT:
510                 printSfDefaultCommand(in);
511                 break;
512             case JdwpCommandPacket.SF_POP_FRAME:
513                 printSfDefaultCommand(in);
514                 break;
515         
516             /** Commands ClassObjectReference. */
517             case JdwpCommandPacket.COR_REFLECTED_TYPE:
518                 printCorReflectedTypeCommand(in);
519                 break;
520         
521             /** Commands Event. */
522             case JdwpCommandPacket.E_COMPOSITE:
523                 printECompositeCommand(in);
524                 break;
525         
526             /** Commands Hot Code Replacement (OTI specific). */
527             case JdwpCommandPacket.HCR_CLASSES_HAVE_CHANGED:
528             case JdwpCommandPacket.HCR_GET_CLASS_VERSION:
529             case JdwpCommandPacket.HCR_DO_RETURN:
530             case JdwpCommandPacket.HCR_REENTER_ON_EXIT:
531             case JdwpCommandPacket.HCR_CAPABILITIES:
532                 throw new UnableToParseDataException("NOT MANAGED COMMAND", remainderData(in)); //$NON-NLS-1$
533

534             default:
535                 int cset= commandId >> 8;
536                 int cmd= commandId & 0xFF;
537                 println(MessageFormat.format("Unknown command : {0} {1}", new String JavaDoc[] {"" + cset, "" + cmd})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
538
break;
539         }
540     }
541
542
543     private void printReplyData(JdwpReplyPacket reply) throws IOException JavaDoc, UnableToParseDataException {
544         byte[] data= reply.data();
545         if (data == null)
546             return;
547         DataInputStream JavaDoc in= new DataInputStream JavaDoc(new ByteArrayInputStream JavaDoc(data));
548         JdwpCommandPacket command= TcpipSpy.getCommand(reply.getId());
549         int commandId= command.getCommand();
550         switch (commandId) {
551             /** Commands VirtualMachine. */
552             case JdwpCommandPacket.VM_VERSION:
553                 printVmVersionReply(in);
554                 break;
555             case JdwpCommandPacket.VM_CLASSES_BY_SIGNATURE:
556                 printVmClassesBySignatureReply(in);
557                 break;
558             case JdwpCommandPacket.VM_ALL_CLASSES:
559                 printVmAllClassesReply(in);
560                 break;
561             case JdwpCommandPacket.VM_ALL_THREADS:
562                 printVmAllThreadsReply(in);
563                 break;
564             case JdwpCommandPacket.VM_TOP_LEVEL_THREAD_GROUPS:
565                 printVmTopLevelThreadGroupReply(in);
566                 break;
567             case JdwpCommandPacket.VM_DISPOSE:
568                 // no data
569
break;
570             case JdwpCommandPacket.VM_ID_SIZES:
571                 printVmIdSizesReply(in);
572                 break;
573             case JdwpCommandPacket.VM_SUSPEND:
574                 // no data
575
break;
576             case JdwpCommandPacket.VM_RESUME:
577                 // no data
578
break;
579             case JdwpCommandPacket.VM_EXIT:
580                 // no data
581
break;
582             case JdwpCommandPacket.VM_CREATE_STRING:
583                 printVmCreateStringReply(in);
584                 break;
585             case JdwpCommandPacket.VM_CAPABILITIES:
586                 printVmCapabilitiesReply(in);
587                 break;
588             case JdwpCommandPacket.VM_CLASS_PATHS:
589                 printVmClassPathsReply(in);
590                 break;
591             case JdwpCommandPacket.VM_DISPOSE_OBJECTS:
592                 // no data
593
break;
594             case JdwpCommandPacket.VM_HOLD_EVENTS:
595                 // no data
596
break;
597             case JdwpCommandPacket.VM_RELEASE_EVENTS:
598                 // no data
599
break;
600             case JdwpCommandPacket.VM_CAPABILITIES_NEW:
601                 printVmCapabilitiesNewReply(in);
602                 break;
603             case JdwpCommandPacket.VM_REDEFINE_CLASSES:
604                 // no data
605
break;
606             case JdwpCommandPacket.VM_SET_DEFAULT_STRATUM:
607                 // no data
608
break;
609             case JdwpCommandPacket.VM_ALL_CLASSES_WITH_GENERIC:
610                 printVmAllClassesWithGenericReply(in);
611                 break;
612         
613             /** Commands ReferenceType. */
614             case JdwpCommandPacket.RT_SIGNATURE:
615                 printRtSignatureReply(in);
616                 break;
617             case JdwpCommandPacket.RT_CLASS_LOADER:
618                 printRtClassLoaderReply(in);
619                 break;
620             case JdwpCommandPacket.RT_MODIFIERS:
621                 printRtModifiersReply(in);
622                 break;
623             case JdwpCommandPacket.RT_FIELDS:
624                 printRtFieldsReply(in);
625                 break;
626             case JdwpCommandPacket.RT_METHODS:
627                 printRtMethodsReply(in);
628                 break;
629             case JdwpCommandPacket.RT_GET_VALUES:
630                 printRtGetValuesReply(in);
631                 break;
632             case JdwpCommandPacket.RT_SOURCE_FILE:
633                 printRtSourceFileReply(in);
634                 break;
635             case JdwpCommandPacket.RT_NESTED_TYPES:
636                 printRtNestedTypesReply(in);
637                 break;
638             case JdwpCommandPacket.RT_STATUS:
639                 printRtStatusReply(in);
640                 break;
641             case JdwpCommandPacket.RT_INTERFACES:
642                 printRtInterfacesReply(in);
643                 break;
644             case JdwpCommandPacket.RT_CLASS_OBJECT:
645                 printRtClassObjectReply(in);
646                 break;
647             case JdwpCommandPacket.RT_SOURCE_DEBUG_EXTENSION:
648                 printRtSourceDebugExtensionReply(in);
649                 break;
650             case JdwpCommandPacket.RT_SIGNATURE_WITH_GENERIC:
651                 printRtSignatureWithGenericReply(in);
652                 break;
653             case JdwpCommandPacket.RT_FIELDS_WITH_GENERIC:
654                 printRtFieldsWithGenericReply(in);
655                 break;
656             case JdwpCommandPacket.RT_METHODS_WITH_GENERIC:
657                 printRtMethodsWithGenericReply(in);
658                 break;
659         
660             /** Commands ClassType. */
661             case JdwpCommandPacket.CT_SUPERCLASS:
662                 printCtSuperclassReply(in);
663                 break;
664             case JdwpCommandPacket.CT_SET_VALUES:
665                 // no data
666
break;
667             case JdwpCommandPacket.CT_INVOKE_METHOD:
668                 printCtInvokeMethodReply(in);
669                 break;
670             case JdwpCommandPacket.CT_NEW_INSTANCE:
671                 printCtNewInstanceReply(in);
672                 break;
673         
674             /** Commands ArrayType. */
675             case JdwpCommandPacket.AT_NEW_INSTANCE:
676                 printAtNewInstanceReply(in);
677                 break;
678         
679             /** Commands Method. */
680             case JdwpCommandPacket.M_LINE_TABLE:
681                 printMLineTableReply(in);
682                 break;
683             case JdwpCommandPacket.M_VARIABLE_TABLE:
684                 printMVariableTableReply(in);
685                 break;
686             case JdwpCommandPacket.M_BYTECODES:
687                 printMBytecodesReply(in);
688                 break;
689             case JdwpCommandPacket.M_IS_OBSOLETE:
690                 printMIsObsoleteReply(in);
691                 break;
692             case JdwpCommandPacket.M_VARIABLE_TABLE_WITH_GENERIC:
693                 printMVariableTableWithGenericReply(in);
694                 break;
695         
696             /** Commands ObjectReference. */
697             case JdwpCommandPacket.OR_REFERENCE_TYPE:
698                 printOrReferenceTypeReply(in);
699                 break;
700             case JdwpCommandPacket.OR_GET_VALUES:
701                 printOrGetValuesReply(in);
702                 break;
703             case JdwpCommandPacket.OR_SET_VALUES:
704                 // no data
705
break;
706             case JdwpCommandPacket.OR_MONITOR_INFO:
707                 printOrMonitorInfoReply(in);
708                 break;
709             case JdwpCommandPacket.OR_INVOKE_METHOD:
710                 printOrInvokeMethodReply(in);
711                 break;
712             case JdwpCommandPacket.OR_DISABLE_COLLECTION:
713                 // no data
714
break;
715             case JdwpCommandPacket.OR_ENABLE_COLLECTION:
716                 // no data
717
break;
718             case JdwpCommandPacket.OR_IS_COLLECTED:
719                 printOrIsCollectedReply(in);
720                 break;
721         
722             /** Commands StringReference. */
723             case JdwpCommandPacket.SR_VALUE:
724                 printSrValueReply(in);
725                 break;
726         
727             /** Commands ThreadReference. */
728             case JdwpCommandPacket.TR_NAME:
729                 printTrNameReply(in);
730                 break;
731             case JdwpCommandPacket.TR_SUSPEND:
732                 // no data
733
break;
734             case JdwpCommandPacket.TR_RESUME:
735                 // no data
736
break;
737             case JdwpCommandPacket.TR_STATUS:
738                 printTrStatusReply(in);
739                 break;
740             case JdwpCommandPacket.TR_THREAD_GROUP:
741                 printTrThreadGroupReply(in);
742                 break;
743             case JdwpCommandPacket.TR_FRAMES:
744                 printTrFramesReply(in);
745                 break;
746             case JdwpCommandPacket.TR_FRAME_COUNT:
747                 printTrFrameCountReply(in);
748                 break;
749             case JdwpCommandPacket.TR_OWNED_MONITORS:
750                 printTrOwnedMonitorsReply(in);
751                 break;
752             case JdwpCommandPacket.TR_CURRENT_CONTENDED_MONITOR:
753                 printTrCurrentContendedMonitorReply(in);
754                 break;
755             case JdwpCommandPacket.TR_STOP:
756                 // no data
757
break;
758             case JdwpCommandPacket.TR_INTERRUPT:
759                 // no data
760
break;
761             case JdwpCommandPacket.TR_SUSPEND_COUNT:
762                 printTrSuspendCountReply(in);
763                 break;
764 /* no more in the jdwp spec
765             case JdwpCommandPacket.TR_POP_TOP_FRAME:
766                 break;
767 */

768             /** Commands ThreadGroupReference. */
769             case JdwpCommandPacket.TGR_NAME:
770                 printTgrNameReply(in);
771                 break;
772             case JdwpCommandPacket.TGR_PARENT:
773                 printTgrParentReply(in);
774                 break;
775             case JdwpCommandPacket.TGR_CHILDREN:
776                 printTgrChildrenReply(in);
777                 break;
778         
779             /** Commands ArrayReference. */
780             case JdwpCommandPacket.AR_LENGTH:
781                 printArLengthReply(in);
782                 break;
783             case JdwpCommandPacket.AR_GET_VALUES:
784                 printArGetValuesReply(in);
785                 break;
786             case JdwpCommandPacket.AR_SET_VALUES:
787                 // no data
788
break;
789         
790             /** Commands ClassLoaderReference. */
791             case JdwpCommandPacket.CLR_VISIBLE_CLASSES:
792                 printClrVisibleClassesReply(in);
793                 break;
794         
795             /** Commands EventRequest. */
796             case JdwpCommandPacket.ER_SET:
797                 printErSetReply(in);
798                 break;
799             case JdwpCommandPacket.ER_CLEAR:
800                 // no data
801
break;
802             case JdwpCommandPacket.ER_CLEAR_ALL_BREAKPOINTS:
803                 // no data
804
break;
805         
806             /** Commands StackFrame. */
807             case JdwpCommandPacket.SF_GET_VALUES:
808                 printSfGetValuesReply(in);
809                 break;
810             case JdwpCommandPacket.SF_SET_VALUES:
811                 // no data
812
break;
813             case JdwpCommandPacket.SF_THIS_OBJECT:
814                 printSfThisObjectReply(in);
815                 break;
816             case JdwpCommandPacket.SF_POP_FRAME:
817                 // no data
818
break;
819         
820             /** Commands ClassObjectReference. */
821             case JdwpCommandPacket.COR_REFLECTED_TYPE:
822                 printCorReflectedTypeReply(in);
823                 break;
824         
825             /** Commands Event. */
826 /* no reply
827             case JdwpCommandPacket.E_COMPOSITE:
828                 break;*/

829         
830             /** Commands Hot Code Replacement (OTI specific). */
831             case JdwpCommandPacket.HCR_CLASSES_HAVE_CHANGED:
832             case JdwpCommandPacket.HCR_GET_CLASS_VERSION:
833             case JdwpCommandPacket.HCR_DO_RETURN:
834             case JdwpCommandPacket.HCR_REENTER_ON_EXIT:
835             case JdwpCommandPacket.HCR_CAPABILITIES:
836                 throw new UnableToParseDataException("NOT MANAGED COMMAND", remainderData(in)); //$NON-NLS-1$
837

838             default:
839                 int cset= commandId >> 8;
840                 int cmd= commandId & 0xFF;
841                 println(MessageFormat.format("Unknown command : {0} {1}", new String JavaDoc[] {"" + cset, "" + cmd})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
842
break;
843         }
844     }
845     
846     private void printRefTypeTag(byte refTypeTag) {
847         printDescription("Type tag:"); //$NON-NLS-1$
848
printRefTypeTagValue(refTypeTag);
849         println();
850     }
851
852     private void printRefTypeTagValue(byte refTypeTag) {
853         printHex(refTypeTag);
854         print(" ("); //$NON-NLS-1$
855
switch (refTypeTag) {
856             case TYPE_TAG_CLASS:
857                 print("CLASS"); //$NON-NLS-1$
858
break;
859             case TYPE_TAG_INTERFACE:
860                 print("INTERFACE"); //$NON-NLS-1$
861
break;
862             case TYPE_TAG_ARRAY:
863                 print("ARRAY"); //$NON-NLS-1$
864
break;
865             default:
866                 print("unknown"); //$NON-NLS-1$
867
}
868         print(')');
869     }
870     
871     private void printClassStatus(int status) {
872         printDescription("Status:"); //$NON-NLS-1$
873
printHex(status);
874         print(" ("); //$NON-NLS-1$
875
boolean spaceNeeded= false;
876         if ((status & JDWP_CLASS_STATUS_VERIFIED) != 0) {
877             print("VERIFIED"); //$NON-NLS-1$
878
spaceNeeded= true;
879         }
880         if ((status & JDWP_CLASS_STATUS_PREPARED) != 0) {
881             if (spaceNeeded) {
882                 print(' ');
883             } else {
884                 spaceNeeded= true;
885             }
886             print("PREPARED"); //$NON-NLS-1$
887
}
888         if ((status & JDWP_CLASS_STATUS_INITIALIZED) != 0) {
889             if (spaceNeeded) {
890                 print(' ');
891             } else {
892                 spaceNeeded= true;
893             }
894             print("INITIALIZED"); //$NON-NLS-1$
895
}
896         if ((status & JDWP_CLASS_STATUS_ERROR) != 0) {
897             if (spaceNeeded) {
898                 print(' ');
899             }
900             print("unknown"); //$NON-NLS-1$
901
}
902         println(')');
903     }
904     
905     private void printClassModifiers(int modifiers) {
906         printDescription("Modifiers:"); //$NON-NLS-1$
907
printHex(modifiers);
908         print(" ("); //$NON-NLS-1$
909
boolean spaceNeeded= false;
910         if ((modifiers & ACC_PUBLIC) != 0) {
911             print("PUBLIC"); //$NON-NLS-1$
912
spaceNeeded= true;
913         }
914         if ((modifiers & ACC_PRIVATE) != 0) {
915             if (spaceNeeded) {
916                 print(' ');
917             } else {
918                 spaceNeeded= true;
919             }
920             print("PRIVATE"); //$NON-NLS-1$
921
}
922         if ((modifiers & ACC_PROTECTED) != 0) {
923             if (spaceNeeded) {
924                 print(' ');
925             } else {
926                 spaceNeeded= true;
927             }
928             print("PROTECTED"); //$NON-NLS-1$
929
}
930         if ((modifiers & ACC_STATIC) != 0) {
931             if (spaceNeeded) {
932                 print(' ');
933             } else {
934                 spaceNeeded= true;
935             }
936             print("STATIC"); //$NON-NLS-1$
937
}
938         if ((modifiers & ACC_FINAL) != 0) {
939             if (spaceNeeded) {
940                 print(' ');
941             } else {
942                 spaceNeeded= true;
943             }
944             print("FINAL"); //$NON-NLS-1$
945
}
946         if ((modifiers & ACC_SUPER) != 0) {
947             if (spaceNeeded) {
948                 print(' ');
949             } else {
950                 spaceNeeded= true;
951             }
952             print("SUPER"); //$NON-NLS-1$
953
}
954         if ((modifiers & ACC_INTERFACE) != 0) {
955             if (spaceNeeded) {
956                 print(' ');
957             } else {
958                 spaceNeeded= true;
959             }
960             print("INTERFACE"); //$NON-NLS-1$
961
}
962         if ((modifiers & ACC_ABSTRACT) != 0) {
963             if (spaceNeeded) {
964                 print(' ');
965             } else {
966                 spaceNeeded= true;
967             }
968             print("ABSTRACT"); //$NON-NLS-1$
969
}
970         if ((modifiers & (ACC_EXT_SYNTHETIC | ACC_SYNTHETIC)) != 0) {
971             if (spaceNeeded) {
972                 print(' ');
973             } else {
974                 spaceNeeded= true;
975             }
976             print("SYNTHETIC"); //$NON-NLS-1$
977
}
978         println(')');
979     }
980
981     private void printMethodModifiers(int modifiers) {
982         printDescription("Modifiers:"); //$NON-NLS-1$
983
printHex(modifiers);
984         print(" ("); //$NON-NLS-1$
985
boolean spaceNeeded= false;
986         if ((modifiers & ACC_PUBLIC) != 0) {
987             print("PUBLIC"); //$NON-NLS-1$
988
spaceNeeded= true;
989         }
990         if ((modifiers & ACC_PRIVATE) != 0) {
991             if (spaceNeeded) {
992                 print(' ');
993             } else {
994                 spaceNeeded= true;
995             }
996             print("PRIVATE"); //$NON-NLS-1$
997
}
998         if ((modifiers & ACC_PROTECTED) != 0) {
999             if (spaceNeeded) {
1000                print(' ');
1001            } else {
1002                spaceNeeded= true;
1003            }
1004            print("PROTECTED"); //$NON-NLS-1$
1005
}
1006        if ((modifiers & ACC_STATIC) != 0) {
1007            if (spaceNeeded) {
1008                print(' ');
1009            } else {
1010                spaceNeeded= true;
1011            }
1012            print("STATIC"); //$NON-NLS-1$
1013
}
1014        if ((modifiers & ACC_FINAL) != 0) {
1015            if (spaceNeeded) {
1016                print(' ');
1017            } else {
1018                spaceNeeded= true;
1019            }
1020            print("FINAL"); //$NON-NLS-1$
1021
}
1022        if ((modifiers & ACC_SYNCHRONIZED) != 0) {
1023            if (spaceNeeded) {
1024                print(' ');
1025            } else {
1026                spaceNeeded= true;
1027            }
1028            print("SYNCHRONIZED"); //$NON-NLS-1$
1029
}
1030        if ((modifiers & ACC_BRIDGE) != 0) {
1031            if (spaceNeeded) {
1032                print(' ');
1033            } else {
1034                spaceNeeded= true;
1035            }
1036            print("BRIDGE"); //$NON-NLS-1$
1037
}
1038        if ((modifiers & ACC_VARARGS) != 0) {
1039            if (spaceNeeded) {
1040                print(' ');
1041            } else {
1042                spaceNeeded= true;
1043            }
1044            print("VARARGS"); //$NON-NLS-1$
1045
}
1046        if ((modifiers & ACC_NATIVE) != 0) {
1047            if (spaceNeeded) {
1048                print(' ');
1049            } else {
1050                spaceNeeded= true;
1051            }
1052            print("NATIVE"); //$NON-NLS-1$
1053
}
1054        if ((modifiers & ACC_ABSTRACT) != 0) {
1055            if (spaceNeeded) {
1056                print(' ');
1057            } else {
1058                spaceNeeded= true;
1059            }
1060            print("ABSTRACT"); //$NON-NLS-1$
1061
}
1062        if ((modifiers & ACC_STRICT) != 0) {
1063            if (spaceNeeded) {
1064                print(' ');
1065            } else {
1066                spaceNeeded= true;
1067            }
1068            print("STRICT"); //$NON-NLS-1$
1069
}
1070        if ((modifiers & (ACC_EXT_SYNTHETIC | ACC_SYNTHETIC )) != 0) {
1071            if (spaceNeeded) {
1072                print(' ');
1073            } else {
1074                spaceNeeded= true;
1075            }
1076            print("SYNTHETIC"); //$NON-NLS-1$
1077
}
1078        println(')');
1079    }
1080    
1081    private void printFieldModifiers(int modifiers) {
1082        printDescription("Modifiers:"); //$NON-NLS-1$
1083
printHex(modifiers);
1084        print(" ("); //$NON-NLS-1$
1085
boolean spaceNeeded= false;
1086        if ((modifiers & ACC_PUBLIC) != 0) {
1087            print("PUBLIC"); //$NON-NLS-1$
1088
spaceNeeded= true;
1089        }
1090        if ((modifiers & ACC_PRIVATE) != 0) {
1091            if (spaceNeeded) {
1092                print(' ');
1093            } else {
1094                spaceNeeded= true;
1095            }
1096            print("PRIVATE"); //$NON-NLS-1$
1097
}
1098        if ((modifiers & ACC_PROTECTED) != 0) {
1099            if (spaceNeeded) {
1100                print(' ');
1101            } else {
1102                spaceNeeded= true;
1103            }
1104            print("PROTECTED"); //$NON-NLS-1$
1105
}
1106        if ((modifiers & ACC_STATIC) != 0) {
1107            if (spaceNeeded) {
1108                print(' ');
1109            } else {
1110                spaceNeeded= true;
1111            }
1112            print("STATIC"); //$NON-NLS-1$
1113
}
1114        if ((modifiers & ACC_FINAL) != 0) {
1115            if (spaceNeeded) {
1116                print(' ');
1117            } else {
1118                spaceNeeded= true;
1119            }
1120            print("FINAL"); //$NON-NLS-1$
1121
}
1122        if ((modifiers & ACC_VOLATILE) != 0) {
1123            if (spaceNeeded) {
1124                print(' ');
1125            } else {
1126                spaceNeeded= true;
1127            }
1128            print("VOLATILE"); //$NON-NLS-1$
1129
}
1130        if ((modifiers & ACC_TRANSIENT) != 0) {
1131            if (spaceNeeded) {
1132                print(' ');
1133            } else {
1134                spaceNeeded= true;
1135            }
1136            print("TRANSIENT"); //$NON-NLS-1$
1137
}
1138        if ((modifiers & ACC_ENUM) != 0) {
1139            if (spaceNeeded) {
1140                print(' ');
1141            } else {
1142                spaceNeeded= true;
1143            }
1144            print("ENUM"); //$NON-NLS-1$
1145
}
1146        if ((modifiers & (ACC_EXT_SYNTHETIC | ACC_SYNTHETIC)) != 0) {
1147            if (spaceNeeded) {
1148                print(' ');
1149            } else {
1150                spaceNeeded= true;
1151            }
1152            print("SYNTHETIC"); //$NON-NLS-1$
1153
}
1154        println(')');
1155    }
1156    
1157    private void printInvocationOptions(int invocationOptions) {
1158        printDescription("Invocation Options:"); //$NON-NLS-1$
1159
printHex(invocationOptions);
1160        print(" ("); //$NON-NLS-1$
1161
boolean spaceNeeded= false;
1162        if ((invocationOptions & INVOKE_SINGLE_THREADED) != 0) {
1163            print("SINGLE_THREADED"); //$NON-NLS-1$
1164
spaceNeeded= true;
1165        }
1166        if ((invocationOptions & INVOKE_NONVIRTUAL) != 0) {
1167            if (spaceNeeded) {
1168                print(' ');
1169            }
1170            print("NONVIRTUAL"); //$NON-NLS-1$
1171
}
1172        println(')');
1173    }
1174    
1175    private void printThreadStatus(int threadStatus) {
1176        printDescription("Thread status:"); //$NON-NLS-1$
1177
printHex(threadStatus);
1178        print(" ("); //$NON-NLS-1$
1179
switch (threadStatus) {
1180            case THREAD_STATUS_ZOMBIE:
1181                print("ZOMBIE"); //$NON-NLS-1$
1182
break;
1183            case THREAD_STATUS_RUNNING:
1184                print("RUNNING"); //$NON-NLS-1$
1185
break;
1186            case THREAD_STATUS_SLEEPING:
1187                print("SLEEPING"); //$NON-NLS-1$
1188
break;
1189            case THREAD_STATUS_MONITOR:
1190                print("MONITOR"); //$NON-NLS-1$
1191
break;
1192            case THREAD_STATUS_WAIT:
1193                print("WAIT"); //$NON-NLS-1$
1194
break;
1195            default:
1196                print("unknown"); //$NON-NLS-1$
1197
break;
1198        }
1199        println(')');
1200    }
1201    
1202    private void printSuspendStatus(int suspendStatus) {
1203        printDescription("Suspend status:"); //$NON-NLS-1$
1204
printHex(suspendStatus);
1205        print(" ("); //$NON-NLS-1$
1206
if ((suspendStatus & SUSPEND_STATUS_SUSPENDED) != 0) {
1207            print("SUSPENDED"); //$NON-NLS-1$
1208
}
1209        println(')');
1210    }
1211    
1212    private void printEventKind(byte eventKind) {
1213        printDescription("Event kind:"); //$NON-NLS-1$
1214
printHex(eventKind);
1215        print(" ("); //$NON-NLS-1$
1216
switch (eventKind) {
1217            case EVENTKIND_SINGLE_STEP:
1218                print("SINGLE_STEP"); //$NON-NLS-1$
1219
break;
1220            case EVENTKIND_BREAKPOINT:
1221                print("BREAKPOINT"); //$NON-NLS-1$
1222
break;
1223            case EVENTKIND_FRAME_POP:
1224                print("FRAME_POP"); //$NON-NLS-1$
1225
break;
1226            case EVENTKIND_EXCEPTION:
1227                print("EXCEPTION"); //$NON-NLS-1$
1228
break;
1229            case EVENTKIND_USER_DEFINED:
1230                print("USER_DEFINED"); //$NON-NLS-1$
1231
break;
1232            case EVENTKIND_THREAD_START:
1233                print("THREAD_START"); //$NON-NLS-1$
1234
break;
1235            case EVENTKIND_THREAD_END:
1236                print("THREAD_END"); //$NON-NLS-1$
1237
break;
1238            case EVENTKIND_CLASS_PREPARE:
1239                print("CLASS_PREPARE"); //$NON-NLS-1$
1240
break;
1241            case EVENTKIND_CLASS_UNLOAD:
1242                print("CLASS_UNLOAD"); //$NON-NLS-1$
1243
break;
1244            case EVENTKIND_CLASS_LOAD:
1245                print("CLASS_LOAD"); //$NON-NLS-1$
1246
break;
1247            case EVENTKIND_FIELD_ACCESS:
1248                print("FIELD_ACCESS"); //$NON-NLS-1$
1249
break;
1250            case EVENTKIND_FIELD_MODIFICATION:
1251                print("FIELD_MODIFICATION"); //$NON-NLS-1$
1252
break;
1253            case EVENTKIND_EXCEPTION_CATCH:
1254                print("EXCEPTION_CATCH"); //$NON-NLS-1$
1255
break;
1256            case EVENTKIND_METHOD_ENTRY:
1257                print("METHOD_ENTRY"); //$NON-NLS-1$
1258
break;
1259            case EVENTKIND_METHOD_EXIT:
1260                print("METHOD_EXIT"); //$NON-NLS-1$
1261
break;
1262            case EVENTKIND_VM_INIT:
1263                print("VM_INIT"); //$NON-NLS-1$
1264
break;
1265            case EVENTKIND_VM_DEATH:
1266                print("VM_DEATH"); //$NON-NLS-1$
1267
break;
1268            case EVENTKIND_VM_DISCONNECTED:
1269                print("VM_DISCONNECTED"); //$NON-NLS-1$
1270
break;
1271            default:
1272                print("unknown"); //$NON-NLS-1$
1273
break;
1274        }
1275        println(')');
1276    }
1277
1278    private void printSuspendPolicy(byte suspendPolicy) {
1279        printDescription("Suspend policy:"); //$NON-NLS-1$
1280
printHex(suspendPolicy);
1281        print(" ("); //$NON-NLS-1$
1282
switch (suspendPolicy) {
1283            case SUSPENDPOLICY_NONE:
1284                print("NONE"); //$NON-NLS-1$
1285
break;
1286            case SUSPENDPOLICY_EVENT_THREAD:
1287                print("EVENT_THREAD"); //$NON-NLS-1$
1288
break;
1289            case SUSPENDPOLICY_ALL:
1290                print("ALL"); //$NON-NLS-1$
1291
break;
1292            default:
1293                print("unknown"); //$NON-NLS-1$
1294
break;
1295        }
1296        println(')');
1297    }
1298    
1299    private void printStepDepth(int setDepth) {
1300        printDescription("Step depth:"); //$NON-NLS-1$
1301
printHex(setDepth);
1302        print(" ("); //$NON-NLS-1$
1303
switch (setDepth) {
1304            case STEPDEPTH_INTO:
1305                print("INTO"); //$NON-NLS-1$
1306
break;
1307            case STEPDEPTH_OVER:
1308                print("OVER"); //$NON-NLS-1$
1309
break;
1310            case STEPDEPTH_OUT:
1311                print("OUT"); //$NON-NLS-1$
1312
break;
1313            default:
1314                print("unknown"); //$NON-NLS-1$
1315
break;
1316        }
1317        println(')');
1318    }
1319    
1320    private void printStepSize(int setSize) {
1321        printDescription("Step size:"); //$NON-NLS-1$
1322
printHex(setSize);
1323        print(" ("); //$NON-NLS-1$
1324
switch (setSize) {
1325            case STEPSIZE_MIN:
1326                print("MIN"); //$NON-NLS-1$
1327
break;
1328            case STEPSIZE_LINE:
1329                print("LINE"); //$NON-NLS-1$
1330
break;
1331            default:
1332                print("unknown"); //$NON-NLS-1$
1333
break;
1334        }
1335        println(')');
1336    }
1337
1338    private void printVmVersionReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1339        String JavaDoc description= readString(in);
1340        int jdwpMajor= in.readInt();
1341        int jdwpMinor= in.readInt();
1342        String JavaDoc vmVersion= readString(in);
1343        String JavaDoc vmName= readString(in);
1344        
1345        println("VM Description:", description); //$NON-NLS-1$
1346
println("JDWP Major Version:", jdwpMajor); //$NON-NLS-1$
1347
println("JDWP Minor Version:", jdwpMinor); //$NON-NLS-1$
1348
println("VM Version:", vmVersion); //$NON-NLS-1$
1349
println("VM Name:", vmName); //$NON-NLS-1$
1350
}
1351    
1352    private void printVmClassesBySignatureCommand(DataInputStream JavaDoc in) throws IOException JavaDoc {
1353        String JavaDoc signature= readString(in);
1354        println("Class signature:", signature); //$NON-NLS-1$
1355
}
1356
1357    private void printVmClassesBySignatureReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1358        int classesCount= in.readInt();
1359        println("Classes count:", classesCount); //$NON-NLS-1$
1360
for(int i= 0; i < classesCount; i++) {
1361            byte refTypeTag= in.readByte();
1362            long typeId= readReferenceTypeID(in);
1363            int status= in.readInt();
1364            printRefTypeTag(refTypeTag);
1365            printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
1366
printClassStatus(status);
1367        }
1368    }
1369
1370    private void printVmAllClassesReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1371        int classesCount= in.readInt();
1372        println("Classes count:", classesCount); //$NON-NLS-1$
1373
for(int i= 0; i < classesCount; i++) {
1374            byte refTypeTag= in.readByte();
1375            long typeId= readReferenceTypeID(in);
1376            String JavaDoc signature= readString(in);
1377            int status= in.readInt();
1378            printRefTypeTag(refTypeTag);
1379            printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
1380
println("Class signature:", signature); //$NON-NLS-1$
1381
printClassStatus(status);
1382        }
1383    }
1384    
1385    private void printVmAllThreadsReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1386        int threadsCount= in.readInt();
1387        println("Threads count:", threadsCount); //$NON-NLS-1$
1388
for(int i= 0; i < threadsCount; i++) {
1389            long threadId= readObjectID(in);
1390            printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
1391
}
1392    }
1393    
1394    private void printVmTopLevelThreadGroupReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1395        int groupsCount= in.readInt();
1396        println("Threads count:", groupsCount); //$NON-NLS-1$
1397
for(int i= 0; i < groupsCount; i++) {
1398            long threadGroupId= readObjectID(in);
1399            printlnObjectId("Thread id:", threadGroupId); //$NON-NLS-1$
1400
}
1401    }
1402    
1403    private void printVmIdSizesReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1404        int fieldIDSize= in.readInt();
1405        int methodIDSize= in.readInt();
1406        int objectIDSize= in.readInt();
1407        int referenceTypeIDSize= in.readInt();
1408        int frameIDSize= in.readInt();
1409        println("Field ID size:", fieldIDSize); //$NON-NLS-1$
1410
println("Method ID size:", methodIDSize); //$NON-NLS-1$
1411
println("Object ID size:", objectIDSize); //$NON-NLS-1$
1412
println("Reference type ID size:", referenceTypeIDSize); //$NON-NLS-1$
1413
println("Frame ID size:", frameIDSize); //$NON-NLS-1$
1414
TcpipSpy.setFieldIDSize(fieldIDSize);
1415        TcpipSpy.setMethodIDSize(methodIDSize);
1416        TcpipSpy.setObjectIDSize(objectIDSize);
1417        TcpipSpy.setReferenceTypeIDSize(referenceTypeIDSize);
1418        TcpipSpy.setFrameIDSize(frameIDSize);
1419        TcpipSpy.setHasSizes(true);
1420    }
1421
1422    private void printVmExitCommand(DataInputStream JavaDoc in) throws IOException JavaDoc {
1423        int exitCode= in.readInt();
1424        println("Exit code:", exitCode); //$NON-NLS-1$
1425
}
1426    
1427    private void printVmCreateStringCommand(DataInputStream JavaDoc in) throws IOException JavaDoc {
1428        String JavaDoc string= readString(in);
1429        println("String:", string); //$NON-NLS-1$
1430
}
1431    
1432    private void printVmCreateStringReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1433        long stringId= readObjectID(in);
1434        printlnObjectId("String id:", stringId); //$NON-NLS-1$
1435
}
1436    
1437    private void printVmCapabilitiesReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1438        boolean canWatchFieldModification= in.readBoolean();
1439        boolean canWatchFieldAccess= in.readBoolean();
1440        boolean canGetBytecodes= in.readBoolean();
1441        boolean canGetSyntheticAttribute= in.readBoolean();
1442        boolean canGetOwnedMonitorInfo= in.readBoolean();
1443        boolean canGetCurrentContendedMonitor= in.readBoolean();
1444        boolean canGetMonitorInfo= in.readBoolean();
1445        println("Can watch field modification:", canWatchFieldModification); //$NON-NLS-1$
1446
println("can watch field access:", canWatchFieldAccess); //$NON-NLS-1$
1447
println("Can get bytecodes:", canGetBytecodes); //$NON-NLS-1$
1448
println("Can get synthetic attribute:", canGetSyntheticAttribute); //$NON-NLS-1$
1449
println("Can get owned monitor info:", canGetOwnedMonitorInfo); //$NON-NLS-1$
1450
println("Can get currently contended monitor:", canGetCurrentContendedMonitor); //$NON-NLS-1$
1451
println("Can get monitor info:", canGetMonitorInfo); //$NON-NLS-1$
1452
}
1453    
1454    private void printVmClassPathsReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1455        String JavaDoc baseDir= readString(in);
1456        println("Base directory:", baseDir); //$NON-NLS-1$
1457
int classpathCount= in.readInt();
1458        println("Classpaths count:", classpathCount); //$NON-NLS-1$
1459
for (int i= 0; i < classpathCount; i++) {
1460            String JavaDoc path= readString(in);
1461            println("Classpath:", path); //$NON-NLS-1$
1462
}
1463        int bootclasspathCount= in.readInt();
1464        println("Bootclasspaths count:", bootclasspathCount); //$NON-NLS-1$
1465
for (int i= 0; i < bootclasspathCount; i++) {
1466            String JavaDoc path= readString(in);
1467            println("Bootclasspath:", path); //$NON-NLS-1$
1468
}
1469    }
1470    
1471    private void printVmDisposeObjectsCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1472        int requestsCount= in.readInt();
1473        println("Requests Count:", requestsCount); //$NON-NLS-1$
1474
for (int i=0; i < requestsCount; i++) {
1475            long objectId= readObjectID(in);
1476            int refsCounts= in.readInt();
1477            printlnObjectId("Object id:", objectId); //$NON-NLS-1$
1478
println("References count:", refsCounts); //$NON-NLS-1$
1479
}
1480    }
1481    
1482    private void printVmCapabilitiesNewReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1483        printVmCapabilitiesReply(in);
1484        boolean canRedefineClasses= in.readBoolean();
1485        boolean canAddMethod= in.readBoolean();
1486        boolean canUnrestrictedlyRedefineClasses= in.readBoolean();
1487        boolean canPopFrames= in.readBoolean();
1488        boolean canUseInstanceFilters= in.readBoolean();
1489        boolean canGetSourceDebugExtension= in.readBoolean();
1490        boolean canRequestVMDeathEvent= in.readBoolean();
1491        boolean canSetDefaultStratum= in.readBoolean();
1492        boolean reserved16= in.readBoolean();
1493        boolean reserved17= in.readBoolean();
1494        boolean reserved18= in.readBoolean();
1495        boolean reserved19= in.readBoolean();
1496        boolean reserved20= in.readBoolean();
1497        boolean reserved21= in.readBoolean();
1498        boolean reserved22= in.readBoolean();
1499        boolean reserved23= in.readBoolean();
1500        boolean reserved24= in.readBoolean();
1501        boolean reserved25= in.readBoolean();
1502        boolean reserved26= in.readBoolean();
1503        boolean reserved27= in.readBoolean();
1504        boolean reserved28= in.readBoolean();
1505        boolean reserved29= in.readBoolean();
1506        boolean reserved30= in.readBoolean();
1507        boolean reserved31= in.readBoolean();
1508        boolean reserved32= in.readBoolean();
1509        println("Can redefine classes:", canRedefineClasses); //$NON-NLS-1$
1510
println("Can add method:", canAddMethod); //$NON-NLS-1$
1511
println("Can unrestrictedly rd. classes:", canUnrestrictedlyRedefineClasses); //$NON-NLS-1$
1512
println("Can pop frames:", canPopFrames); //$NON-NLS-1$
1513
println("Can use instance filters:", canUseInstanceFilters); //$NON-NLS-1$
1514
println("Can get source debug extension:", canGetSourceDebugExtension); //$NON-NLS-1$
1515
println("Can request VMDeath event:", canRequestVMDeathEvent); //$NON-NLS-1$
1516
println("Can set default stratum:", canSetDefaultStratum); //$NON-NLS-1$
1517
println("Reserved:", reserved16); //$NON-NLS-1$
1518
println("Reserved:", reserved17); //$NON-NLS-1$
1519
println("Reserved:", reserved18); //$NON-NLS-1$
1520
println("Reserved:", reserved19); //$NON-NLS-1$
1521
println("Reserved:", reserved20); //$NON-NLS-1$
1522
println("Reserved:", reserved21); //$NON-NLS-1$
1523
println("Reserved:", reserved22); //$NON-NLS-1$
1524
println("Reserved:", reserved23); //$NON-NLS-1$
1525
println("Reserved:", reserved24); //$NON-NLS-1$
1526
println("Reserved:", reserved25); //$NON-NLS-1$
1527
println("Reserved:", reserved26); //$NON-NLS-1$
1528
println("Reserved:", reserved27); //$NON-NLS-1$
1529
println("Reserved:", reserved28); //$NON-NLS-1$
1530
println("Reserved:", reserved29); //$NON-NLS-1$
1531
println("Reserved:", reserved30); //$NON-NLS-1$
1532
println("Reserved:", reserved31); //$NON-NLS-1$
1533
println("Reserved:", reserved32); //$NON-NLS-1$
1534
}
1535    
1536    private void printVmRedefineClassCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1537        int typesCount= in.readInt();
1538        println("Types count:", typesCount); //$NON-NLS-1$
1539
for (int i= 0; i < typesCount; i++) {
1540            long typeId= readReferenceTypeID(in);
1541            int classfileLength= in.readInt();
1542            printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
1543
println("Classfile length:", classfileLength); //$NON-NLS-1$
1544
while((classfileLength -= in.skipBytes(classfileLength)) != 0) {
1545            }
1546            printDescription("Class bytes:"); //$NON-NLS-1$
1547
println("skipped"); //$NON-NLS-1$
1548
}
1549    }
1550    
1551    private void printVmSetDefaultStratumCommand(DataInputStream JavaDoc in) throws IOException JavaDoc {
1552        String JavaDoc stratumId= readString(in);
1553        println("Stratum id:", stratumId); //$NON-NLS-1$
1554
}
1555    
1556    private void printVmAllClassesWithGenericReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1557        int classesCount= in.readInt();
1558        println("Classes count:", classesCount); //$NON-NLS-1$
1559
for(int i= 0; i < classesCount; i++) {
1560            byte refTypeTag= in.readByte();
1561            long typeId= readReferenceTypeID(in);
1562            String JavaDoc signature= readString(in);
1563            String JavaDoc genericSignature= readString(in);
1564            int status= in.readInt();
1565            printRefTypeTag(refTypeTag);
1566            printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
1567
println("Class signature:", signature); //$NON-NLS-1$
1568
println("Generic class signature:", genericSignature); //$NON-NLS-1$
1569
printClassStatus(status);
1570        }
1571    }
1572    
1573    private void printRtDefaultCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1574        long typeId= readReferenceTypeID(in);
1575        printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
1576
}
1577    
1578    private void printRtSignatureReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1579        String JavaDoc signature= readString(in);
1580        println("Signature:", signature); //$NON-NLS-1$
1581
}
1582    
1583    private void printRtClassLoaderReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1584        long classLoaderId= readObjectID(in);
1585        printlnObjectId("ClassLoader id:", classLoaderId); //$NON-NLS-1$
1586
}
1587
1588    private void printRtModifiersReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1589        int modifiers= in.readInt();
1590        printClassModifiers(modifiers);
1591    }
1592
1593    private void printRtFieldsReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1594        int fieldsCount= in.readInt();
1595        println("Fields count:", fieldsCount); //$NON-NLS-1$
1596
for (int i= 0; i < fieldsCount; i++) {
1597            long fieldId= readFieldID(in);
1598            String JavaDoc name= readString(in);
1599            String JavaDoc signature= readString(in);
1600            int modifiers= in.readInt();
1601            printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
1602
println("Name:", name); //$NON-NLS-1$
1603
println("Signature:", signature); //$NON-NLS-1$
1604
printFieldModifiers(modifiers);
1605        }
1606    }
1607    
1608    private void printRtMethodsReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1609        int methodsCount= in.readInt();
1610        println("Methods count:", methodsCount); //$NON-NLS-1$
1611
for (int i= 0; i < methodsCount; i++) {
1612            long methodId= readMethodID(in);
1613            String JavaDoc name= readString(in);
1614            String JavaDoc signature= readString(in);
1615            int modifiers= in.readInt();
1616            printlnMethodId("Method id:", methodId); //$NON-NLS-1$
1617
println("Name:", name); //$NON-NLS-1$
1618
println("Signature:", signature); //$NON-NLS-1$
1619
printMethodModifiers(modifiers);
1620        }
1621    }
1622    
1623    private void printRtGetValuesCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1624        long typeId= readReferenceTypeID(in);
1625        int fieldsCount= in.readInt();
1626        printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
1627
println("Fields count:", fieldsCount); //$NON-NLS-1$
1628
for (int i= 0; i < fieldsCount; i++) {
1629            long fieldId= readFieldID(in);
1630            printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
1631
}
1632    }
1633
1634    private void printRtGetValuesReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1635        int valuesCount= in.readInt();
1636        println("Values count:", valuesCount); //$NON-NLS-1$
1637
for (int i= 0; i < valuesCount; i++) {
1638            readAndPrintlnTaggedValue("Value:", in); //$NON-NLS-1$
1639
}
1640    }
1641    
1642    private void printRtSourceFileReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1643        String JavaDoc sourceFile= readString(in);
1644        println("Source file:", sourceFile); //$NON-NLS-1$
1645
}
1646    
1647    private void printRtNestedTypesReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1648        int typesCount= in.readInt();
1649        println("Types count:", typesCount); //$NON-NLS-1$
1650
for (int i= 0; i < typesCount; i++) {
1651            byte typeTag= in.readByte();
1652            long typeId= readReferenceTypeID(in);
1653            printRefTypeTag(typeTag);
1654            printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
1655
}
1656    }
1657    
1658    private void printRtStatusReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1659        int status= in.readInt();
1660        printClassStatus(status);
1661    }
1662    
1663    private void printRtInterfacesReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1664        int interfacesCount= in.readInt();
1665        println("Interfaces count:", interfacesCount); //$NON-NLS-1$
1666
for (int i= 0; i < interfacesCount; i ++) {
1667            long interfaceId= readReferenceTypeID(in);
1668            printlnReferenceTypeId("Interface type id:", interfaceId); //$NON-NLS-1$
1669
}
1670    }
1671    
1672    private void printRtClassObjectReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1673        long classObjectId= readObjectID(in);
1674        printlnObjectId("Class object id:", classObjectId); //$NON-NLS-1$
1675
}
1676    
1677    private void printRtSourceDebugExtensionReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1678        String JavaDoc extension= readString(in);
1679        println("Extension:", extension); //$NON-NLS-1$
1680
}
1681    
1682    private void printRtSignatureWithGenericReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1683        String JavaDoc signature= readString(in);
1684        String JavaDoc genericSignature= readString(in);
1685        println("Signature:", signature); //$NON-NLS-1$
1686
println("Generic signature:", genericSignature); //$NON-NLS-1$
1687
}
1688    
1689    private void printRtFieldsWithGenericReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1690        int fieldsCount= in.readInt();
1691        println("Fields count:", fieldsCount); //$NON-NLS-1$
1692
for (int i= 0; i < fieldsCount; i++) {
1693            long fieldId= readFieldID(in);
1694            String JavaDoc name= readString(in);
1695            String JavaDoc signature= readString(in);
1696            String JavaDoc genericSignature= readString(in);
1697            int modifiers= in.readInt();
1698            printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
1699
println("Name:", name); //$NON-NLS-1$
1700
println("Signature:", signature); //$NON-NLS-1$
1701
println("Generic signature:", genericSignature); //$NON-NLS-1$
1702
printFieldModifiers(modifiers);
1703        }
1704    }
1705    
1706    private void printRtMethodsWithGenericReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1707        int methodsCount= in.readInt();
1708        println("Methods count:", methodsCount); //$NON-NLS-1$
1709
for (int i= 0; i < methodsCount; i++) {
1710            long methodId= readMethodID(in);
1711            String JavaDoc name= readString(in);
1712            String JavaDoc genericSignature= readString(in);
1713            int modifiers= in.readInt();
1714            printlnMethodId("Method id:", methodId); //$NON-NLS-1$
1715
println("Name:", name); //$NON-NLS-1$
1716
// println(TcpIpSpyMessages.VerbosePacketStream_Signature__106, signature);
1717
println("Generic signature:", genericSignature); //$NON-NLS-1$
1718
printMethodModifiers(modifiers);
1719        }
1720    }
1721    
1722    private void printCtSuperclassCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1723        long classTypeId= readReferenceTypeID(in);
1724        printlnReferenceTypeId("Class type id:", classTypeId); //$NON-NLS-1$
1725
}
1726    
1727    private void printCtSuperclassReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1728        long superclassTypeId= readReferenceTypeID(in);
1729        printlnReferenceTypeId("Superclass type id:", superclassTypeId); //$NON-NLS-1$
1730
}
1731
1732    private void printCtSetValuesCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1733        long classTypeId= readReferenceTypeID(in);
1734        int fieldsCount= in.readInt();
1735        printlnReferenceTypeId("Class type id:", classTypeId); //$NON-NLS-1$
1736
println("Fields count:", fieldsCount); //$NON-NLS-1$
1737
throw new UnableToParseDataException("List of values: NOT MANAGED", remainderData(in)); //$NON-NLS-1$
1738
}
1739    
1740    private void printCtInvokeMethodCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1741        long classTypeId= readReferenceTypeID(in);
1742        long threadId= readObjectID(in);
1743        long methodId= readMethodID(in);
1744        int argumentsCount= in.readInt();
1745        printlnReferenceTypeId("Class type id:", classTypeId); //$NON-NLS-1$
1746
printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
1747
printlnMethodId("Method id:", methodId); //$NON-NLS-1$
1748
println("Arguments count:", argumentsCount); //$NON-NLS-1$
1749
for (int i= 0; i < argumentsCount; i++) {
1750            readAndPrintlnTaggedValue("Argument:", in); //$NON-NLS-1$
1751
}
1752        int invocationOptions= in.readInt();
1753        printInvocationOptions(invocationOptions);
1754    }
1755    
1756    private void printCtInvokeMethodReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1757        readAndPrintlnTaggedValue("Return value:", in); //$NON-NLS-1$
1758
byte signatureByte= in.readByte();
1759        long exception= readObjectID(in);
1760        printlnTaggedObjectId("Exception object id:", exception, signatureByte); //$NON-NLS-1$
1761
}
1762
1763    private void printCtNewInstanceCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1764        printCtInvokeMethodCommand(in);
1765    }
1766    
1767    private void printCtNewInstanceReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1768        byte objectSignatureByte= in.readByte();
1769        long newObjectId= readObjectID(in);
1770        byte exceptionSignatureByte= in.readByte();
1771        long exception= readObjectID(in);
1772        printlnTaggedObjectId("New object id:", newObjectId, objectSignatureByte); //$NON-NLS-1$
1773
printlnTaggedObjectId("Exception object id:", exception, exceptionSignatureByte); //$NON-NLS-1$
1774
}
1775    
1776    private void printAtNewInstanceCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1777        long arrayTypeId= readReferenceTypeID(in);
1778        int length= in.readInt();
1779        printlnReferenceTypeId("Array type id:", arrayTypeId); //$NON-NLS-1$
1780
println("Length:", length); //$NON-NLS-1$
1781
}
1782    
1783    private void printAtNewInstanceReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1784        byte signatureByte= in.readByte();
1785        long newArrayId= readObjectID(in);
1786        printlnTaggedObjectId("New array id:", newArrayId, signatureByte); //$NON-NLS-1$
1787
}
1788    
1789    private void printMDefaultCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1790        long classTypeId= readReferenceTypeID(in);
1791        long methodId= readMethodID(in);
1792        printlnReferenceTypeId("Class type id:", classTypeId); //$NON-NLS-1$
1793
printlnMethodId("Method id:", methodId); //$NON-NLS-1$
1794
}
1795    
1796    private void printMLineTableReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1797        long start= in.readLong();
1798        long end= in.readLong();
1799        int lines= in.readInt();
1800        println("Lowest valid code index:", start); //$NON-NLS-1$
1801
println("Highest valid code index:", end); //$NON-NLS-1$
1802
println("Number of lines:", lines); //$NON-NLS-1$
1803
for (int i= 0; i < lines; i++) {
1804            long lineCodeIndex= in.readLong();
1805            int lineNumber= in.readInt();
1806            println("Line code Index:", lineCodeIndex); //$NON-NLS-1$
1807
println("Line number:", lineNumber); //$NON-NLS-1$
1808
}
1809    }
1810    
1811    private void printMVariableTableReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1812        int slotsUsedByArgs= in.readInt();
1813        int variablesCount= in.readInt();
1814        println("Nb of slots used by all args:", slotsUsedByArgs); //$NON-NLS-1$
1815
println("Nb of variables:", variablesCount); //$NON-NLS-1$
1816
for (int i= 0; i < variablesCount; i++) {
1817            long codeIndex= in.readLong();
1818            String JavaDoc name= readString(in);
1819            String JavaDoc signature= readString(in);
1820            int length= in.readInt();
1821            int slotId= in.readInt();
1822            println("First code index:", codeIndex); //$NON-NLS-1$
1823
println("Variable name:", name); //$NON-NLS-1$
1824
println("Variable type signature:", signature); //$NON-NLS-1$
1825
println("Code index length:", length); //$NON-NLS-1$
1826
println("Slot id:", slotId); //$NON-NLS-1$
1827
}
1828    }
1829    
1830    private void printMBytecodesReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1831        int bytes= in.readInt();
1832        println("Nb of bytes:", bytes); //$NON-NLS-1$
1833
while((bytes -= in.skipBytes(bytes)) != 0) {
1834        }
1835        printDescription("Method bytes:"); //$NON-NLS-1$
1836
println("skipped"); //$NON-NLS-1$
1837
}
1838    
1839    private void printMIsObsoleteReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1840        boolean isObsolete= in.readBoolean();
1841        println("Is obsolete:", isObsolete); //$NON-NLS-1$
1842
}
1843    
1844    private void printMVariableTableWithGenericReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1845        int slotsUsedByArgs= in.readInt();
1846        int variablesCount= in.readInt();
1847        println("Nb of slots used by all args:", slotsUsedByArgs); //$NON-NLS-1$
1848
println("Nb of variables:", variablesCount); //$NON-NLS-1$
1849
for (int i= 0; i < variablesCount; i++) {
1850            long codeIndex= in.readLong();
1851            String JavaDoc name= readString(in);
1852            String JavaDoc signature= readString(in);
1853            String JavaDoc genericSignature= readString(in);
1854            int length= in.readInt();
1855            int slotId= in.readInt();
1856            println("First code index:", codeIndex); //$NON-NLS-1$
1857
println("Variable name:", name); //$NON-NLS-1$
1858
println("Variable type signature:", signature); //$NON-NLS-1$
1859
println("Var. type generic signature:", genericSignature); //$NON-NLS-1$
1860
println("Code index length:", length); //$NON-NLS-1$
1861
println("Slot id:", slotId); //$NON-NLS-1$
1862
}
1863    }
1864    
1865    private void printOrDefaultCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1866        long objectId= readObjectID(in);
1867        println("Object id:", objectId); //$NON-NLS-1$
1868
}
1869    
1870    private void printOrReferenceTypeReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1871        byte refTypeTag= in.readByte();
1872        long typeId= readReferenceTypeID(in);
1873        printRefTypeTag(refTypeTag);
1874        printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
1875
}
1876    
1877    private void printOrGetValuesCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1878        long objectId= readObjectID(in);
1879        int fieldsCount= in.readInt();
1880        println("Object id:", objectId); //$NON-NLS-1$
1881
println("Fields count:", fieldsCount); //$NON-NLS-1$
1882
for (int i= 0; i < fieldsCount; i++) {
1883            long fieldId= readFieldID(in);
1884            println("Field id:", fieldId); //$NON-NLS-1$
1885
}
1886    }
1887    
1888    private void printOrGetValuesReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1889        int valuesCount= in.readInt();
1890        println("Values count:", valuesCount); //$NON-NLS-1$
1891
for (int i= 0; i < valuesCount; i++) {
1892            readAndPrintlnTaggedValue("Value:", in); //$NON-NLS-1$
1893
}
1894    }
1895    
1896    private void printOrSetValuesCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1897        long objectId= readObjectID(in);
1898        int fieldsCount= in.readInt();
1899        println("Object id:", objectId); //$NON-NLS-1$
1900
println("Fields count:", fieldsCount); //$NON-NLS-1$
1901
throw new UnableToParseDataException("List of values: NOT MANAGED", remainderData(in)); //$NON-NLS-1$
1902
}
1903    
1904    private void printOrMonitorInfoReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1905        long ownerThreadId= readObjectID(in);
1906        int entryCount= in.readInt();
1907        int waiters= in.readInt();
1908        printlnObjectId("Owner thread id:", ownerThreadId); //$NON-NLS-1$
1909
println("Entry count:", entryCount); //$NON-NLS-1$
1910
println("Nb of waiters:", waiters); //$NON-NLS-1$
1911
long waiterThreadId;
1912        for (int i= 0; i < waiters; i++) {
1913            waiterThreadId= readObjectID(in);
1914            printlnObjectId("Waiting thread id:", waiterThreadId); //$NON-NLS-1$
1915
}
1916    }
1917    
1918    private void printOrInvokeMethodCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1919        long objectId= readObjectID(in);
1920        long threadId= readObjectID(in);
1921        long classTypeId= readReferenceTypeID(in);
1922        long methodId= readMethodID(in);
1923        int argsCount= in.readInt();
1924        printlnObjectId("Object id:", objectId); //$NON-NLS-1$
1925
printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
1926
printlnReferenceTypeId("Class type id:", classTypeId); //$NON-NLS-1$
1927
printlnMethodId("Method id:", methodId); //$NON-NLS-1$
1928
println("Arguments count:", argsCount); //$NON-NLS-1$
1929
for (int i= 0; i < argsCount; i++) {
1930            readAndPrintlnTaggedValue("Argument:", in); //$NON-NLS-1$
1931
}
1932        int invocationOption= in.readInt();
1933        printInvocationOptions(invocationOption);
1934    }
1935    
1936    private void printOrInvokeMethodReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1937        readAndPrintlnTaggedValue("Return value:", in); //$NON-NLS-1$
1938
byte signatureByte= in.readByte();
1939        long exception= readObjectID(in);
1940        printlnTaggedObjectId("Exception object id:", exception, signatureByte); //$NON-NLS-1$
1941
}
1942    
1943    private void printOrIsCollectedReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1944        boolean isCollected= in.readBoolean();
1945        println("Is collected:", isCollected); //$NON-NLS-1$
1946
}
1947    
1948    private void printSrValueCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1949        long stringObjectId= readObjectID(in);
1950        printlnObjectId("String object id:", stringObjectId); //$NON-NLS-1$
1951
}
1952        
1953    private void printSrValueReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1954        String JavaDoc value= readString(in);
1955        println("Value:", value); //$NON-NLS-1$
1956
}
1957    
1958    private void printTrDefaultCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1959        long threadId= readObjectID(in);
1960        printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
1961
}
1962    
1963    private void printTrNameReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1964        String JavaDoc threadName= readString(in);
1965        println("Name:", threadName); //$NON-NLS-1$
1966
}
1967    
1968    private void printTrStatusReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
1969        int threadStatus= in.readInt();
1970        int suspendStatus= in.readInt();
1971        printThreadStatus(threadStatus);
1972        printSuspendStatus(suspendStatus);
1973    }
1974    
1975    private void printTrThreadGroupReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1976        long threadGroupId= readObjectID(in);
1977        printlnObjectId("Thread group id:", threadGroupId); //$NON-NLS-1$
1978
}
1979    
1980    private void printTrFramesCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1981        long threadId= readObjectID(in);
1982        int startFrame= in.readInt();
1983        int length= in.readInt();
1984        printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
1985
println("First frame:", startFrame); //$NON-NLS-1$
1986
println("Number of frame:", length); //$NON-NLS-1$
1987
}
1988    
1989    private void printTrFramesReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
1990        int framesCount= in.readInt();
1991        println("Frames count:", framesCount); //$NON-NLS-1$
1992
for (int i= 0; i < framesCount; i++) {
1993            long frameId= readFrameID(in);
1994            printlnFrameId("Frame id:", frameId); //$NON-NLS-1$
1995
readAndPrintLocation(in);
1996        }
1997    }
1998    
1999    private void printTrFrameCountReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
2000        int framesCount= in.readInt();
2001        println("Frames count:", framesCount); //$NON-NLS-1$
2002
}
2003    
2004    private void printTrOwnedMonitorsReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2005        int monitorsCount= in.readInt();
2006        println("Monitors count:", monitorsCount); //$NON-NLS-1$
2007
for (int i= 0; i < monitorsCount; i++) {
2008            byte signatureByte= in.readByte();
2009            long monitorObjectId= readObjectID(in);
2010            printlnTaggedObjectId("Monitor object id:", monitorObjectId, signatureByte); //$NON-NLS-1$
2011
}
2012    }
2013    
2014    private void printTrCurrentContendedMonitorReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2015        byte signatureByte= in.readByte();
2016        long monitorObjectId= readObjectID(in);
2017        printlnTaggedObjectId("Monitor object id:", monitorObjectId, signatureByte); //$NON-NLS-1$
2018
}
2019    
2020    private void printTrStopCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2021        long threadId= readObjectID(in);
2022        long exceptionObjectId= readObjectID(in);
2023        printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
2024
printlnObjectId("Exception object id:", exceptionObjectId); //$NON-NLS-1$
2025
}
2026    
2027    private void printTrSuspendCountReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
2028        int suspendCount= in.readInt();
2029        println("Suspend count:", suspendCount); //$NON-NLS-1$
2030
}
2031    
2032    private void printTgrDefaultCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2033        long threadGroupId= readObjectID(in);
2034        printlnObjectId("Thread group id:", threadGroupId); //$NON-NLS-1$
2035
}
2036    
2037    private void printTgrNameReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
2038        String JavaDoc name= readString(in);
2039        println("Name:", name); //$NON-NLS-1$
2040
}
2041    
2042    private void printTgrParentReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2043        long parentThreadGroupId= readObjectID(in);
2044        printlnObjectId("Parent thread group id:", parentThreadGroupId); //$NON-NLS-1$
2045
}
2046    
2047    private void printTgrChildrenReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2048        int childThreadsCount= in.readInt();
2049        println("Child threads count:", childThreadsCount); //$NON-NLS-1$
2050
for (int i= 0; i < childThreadsCount; i++) {
2051            long childThreadId= readObjectID(in);
2052            printlnObjectId("Child thread id:", childThreadId); //$NON-NLS-1$
2053
}
2054        int childGroupThreadsCount= in.readInt();
2055        println("Child group threads count:", childGroupThreadsCount); //$NON-NLS-1$
2056
for (int i= 0; i < childGroupThreadsCount; i++) {
2057            long childGroupThreadId= readObjectID(in);
2058            printlnObjectId("Child group thread id:", childGroupThreadId); //$NON-NLS-1$
2059
}
2060    }
2061    
2062    private void printArLengthCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2063        long arrayObjectId= readObjectID(in);
2064        printlnObjectId("Array object id:", arrayObjectId); //$NON-NLS-1$
2065
}
2066    
2067    private void printArLengthReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
2068        int length= in.readInt();
2069        println("Length:", length); //$NON-NLS-1$
2070
}
2071    
2072    private void printArGetValuesCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2073        long arrayObjectId= readObjectID(in);
2074        int firstIndex= in.readInt();
2075        int length= in.readInt();
2076        printlnObjectId("Array object id:", arrayObjectId); //$NON-NLS-1$
2077
println("First index:", firstIndex); //$NON-NLS-1$
2078
println("Length:", length); //$NON-NLS-1$
2079
}
2080    
2081    private void printArGetValuesReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2082        readAndPrintArrayRegion(in);
2083    }
2084    
2085    private void printArSetValuesCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2086        long arrayObjectId= readObjectID(in);
2087        int firstIndex= in.readInt();
2088        int length= in.readInt();
2089        printlnObjectId("Array object id:", arrayObjectId); //$NON-NLS-1$
2090
println("First index:", firstIndex); //$NON-NLS-1$
2091
println("Length:", length); //$NON-NLS-1$
2092
throw new UnableToParseDataException("List of values: NOT MANAGED", remainderData(in)); //$NON-NLS-1$
2093
}
2094    
2095    private void printClrVisibleClassesCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2096        long classLoaderObjectId= readObjectID(in);
2097        printlnObjectId("Class loader object id:", classLoaderObjectId); //$NON-NLS-1$
2098
}
2099
2100    private void printClrVisibleClassesReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2101        int classesCount= in.readInt();
2102        println("Classes count:", classesCount); //$NON-NLS-1$
2103
for (int i= 0; i < classesCount; i++) {
2104            byte refTypeTag= in.readByte();
2105            long typeId= readReferenceTypeID(in);
2106            printRefTypeTag(refTypeTag);
2107            printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
2108
}
2109    }
2110    
2111    private void printErSetCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2112        byte eventKind= in.readByte();
2113        byte suspendPolicy= in.readByte();
2114        int modifiersCount= in.readInt();
2115        printEventKind(eventKind);
2116        printSuspendPolicy(suspendPolicy);
2117        println("Modifiers count:", modifiersCount); //$NON-NLS-1$
2118
for (int i= 0; i < modifiersCount; i++) {
2119            byte modKind= in.readByte();
2120            printDescription("Modifier kind:"); //$NON-NLS-1$
2121
printHex(modKind);
2122            switch (modKind) {
2123                case 1: // count
2124
println(" (Count)"); //$NON-NLS-1$
2125
int count= in.readInt();
2126                    println("Count:", count); //$NON-NLS-1$
2127
break;
2128                case 2: // conditional
2129
println(" (Conditional)"); //$NON-NLS-1$
2130
int exprId= in.readInt();
2131                    println("Expression id:", exprId); //$NON-NLS-1$
2132
break;
2133                case 3: // thread only
2134
println(" (ThreadOnly)"); //$NON-NLS-1$
2135
long threadId= readObjectID(in);
2136                    printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
2137
break;
2138                case 4: // class only
2139
println(" (ClassOnly)"); //$NON-NLS-1$
2140
long classId= readReferenceTypeID(in);
2141                    printlnReferenceTypeId("Class type id:", classId); //$NON-NLS-1$
2142
break;
2143                case 5: // class match
2144
println(" (ClassMatch)"); //$NON-NLS-1$
2145
String JavaDoc classPatern= readString(in);
2146                    println("Class pattern:", classPatern); //$NON-NLS-1$
2147
break;
2148                case 6: // class exclude
2149
println(" (ClassExclude)"); //$NON-NLS-1$
2150
classPatern= readString(in);
2151                    println("Class pattern:", classPatern); //$NON-NLS-1$
2152
break;
2153                case 7: // location only
2154
println(" (LocationOnly)"); //$NON-NLS-1$
2155
readAndPrintLocation(in);
2156                    break;
2157                case 8: // exception only
2158
println(" (ExceptionOnly)"); //$NON-NLS-1$
2159
long typeId= readReferenceTypeID(in);
2160                    boolean caught= in.readBoolean();
2161                    boolean uncaught= in.readBoolean();
2162                    printlnReferenceTypeId("Exception type id:", typeId); //$NON-NLS-1$
2163
println("Caught:", caught); //$NON-NLS-1$
2164
println("Uncaught:", uncaught); //$NON-NLS-1$
2165
break;
2166                case 9: // field only
2167
println(" (FieldOnly)"); //$NON-NLS-1$
2168
long declaringTypeId= readReferenceTypeID(in);
2169                    long fieldId= readFieldID(in);
2170                    printlnReferenceTypeId("Declaring type id:", declaringTypeId); //$NON-NLS-1$
2171
printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
2172
break;
2173                case 10: // step
2174
println(" (Step)"); //$NON-NLS-1$
2175
threadId= readObjectID(in);
2176                    int stepSize= in.readInt();
2177                    int stepDepth= in.readInt();
2178                    printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
2179
printStepSize(stepSize);
2180                    printStepDepth(stepDepth);
2181                    break;
2182                case 11: // instance only
2183
println(" (InstanceOnly)"); //$NON-NLS-1$
2184
long objectId= readObjectID(in);
2185                    printlnObjectId("Object id:", objectId); //$NON-NLS-1$
2186
break;
2187            }
2188        }
2189    }
2190    
2191    private void printErSetReply(DataInputStream JavaDoc in) throws IOException JavaDoc {
2192        int requestId= in.readInt();
2193        println("Request id:", requestId); //$NON-NLS-1$
2194
}
2195    
2196    private void printErClearCommand(DataInputStream JavaDoc in) throws IOException JavaDoc {
2197        byte eventKind= in.readByte();
2198        int requestId= in.readInt();
2199        printEventKind(eventKind);
2200        println("Request id:", requestId); //$NON-NLS-1$
2201
}
2202    
2203    private void printSfDefaultCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2204        long threadId= readObjectID(in);
2205        long frameId= readFrameID(in);
2206        printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
2207
printlnFrameId("Frame id:", frameId); //$NON-NLS-1$
2208
}
2209    
2210    private void printSfGetValuesCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2211        long threadId= readObjectID(in);
2212        long frameId= readFrameID(in);
2213        int slotsCount= in.readInt();
2214        printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
2215
printlnFrameId("Frame id:", frameId); //$NON-NLS-1$
2216
println("Slots count:", slotsCount); //$NON-NLS-1$
2217
for (int i= 0; i < slotsCount; i++) {
2218            int slotIndex= in.readInt();
2219            byte signatureTag= in.readByte();
2220            println("Slot index:", slotIndex); //$NON-NLS-1$
2221
printDescription("Signature tag:"); //$NON-NLS-1$
2222
printSignatureByte(signatureTag, true);
2223            println();
2224        }
2225    }
2226    
2227    private void printSfGetValuesReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2228        int valuesCount= in.readInt();
2229        println("Values count:", valuesCount); //$NON-NLS-1$
2230
for (int i= 0; i < valuesCount; i++) {
2231            readAndPrintlnTaggedValue("Value:", in); //$NON-NLS-1$
2232
}
2233    }
2234    
2235    private void printSfSetValuesCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2236        long threadId= readObjectID(in);
2237        long frameId= readFrameID(in);
2238        int slotsCount= in.readInt();
2239        printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
2240
printlnFrameId("Frame id:", frameId); //$NON-NLS-1$
2241
println("Slots count:", slotsCount); //$NON-NLS-1$
2242
for (int i= 0; i < slotsCount; i++) {
2243            int slotIndex= in.readInt();
2244            println("Slot index:", slotIndex); //$NON-NLS-1$
2245
readAndPrintlnTaggedValue("Values:", in); //$NON-NLS-1$
2246
}
2247    }
2248    
2249    private void printSfThisObjectReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2250        byte signatureByte= in.readByte();
2251        long objectId= readObjectID(in);
2252        printlnTaggedObjectId("'this' object id:", objectId, signatureByte); //$NON-NLS-1$
2253
}
2254    
2255    private void printCorReflectedTypeCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2256        long classObjectId= readObjectID(in);
2257        printlnObjectId("Class object id:", classObjectId); //$NON-NLS-1$
2258
}
2259    
2260    private void printCorReflectedTypeReply(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2261        byte refTypeTag= in.readByte();
2262        long typeId= readReferenceTypeID(in);
2263        printRefTypeTag(refTypeTag);
2264        printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
2265
}
2266
2267    private void printECompositeCommand(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2268        byte suspendPolicy= in.readByte();
2269        int eventsCount= in.readInt();
2270        printSuspendPolicy(suspendPolicy);
2271        println("Events count:", eventsCount); //$NON-NLS-1$
2272
for (int i= 0; i < eventsCount; i++) {
2273            byte eventKind= in.readByte();
2274            int requestId= in.readInt();
2275            printEventKind(eventKind);
2276            println("Request id:", requestId); //$NON-NLS-1$
2277
switch (eventKind) {
2278                case EVENTKIND_VM_START:
2279                    long threadId= readObjectID(in);
2280                    printlnObjectId("Initial thread object id:", threadId); //$NON-NLS-1$
2281
break;
2282                case EVENTKIND_SINGLE_STEP:
2283                case EVENTKIND_BREAKPOINT:
2284                case EVENTKIND_METHOD_ENTRY:
2285                case EVENTKIND_METHOD_EXIT:
2286                    threadId= readObjectID(in);
2287                    printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
2288
readAndPrintLocation(in);
2289                    break;
2290                case EVENTKIND_EXCEPTION:
2291                    threadId= readObjectID(in);
2292                    readAndPrintLocation(in);
2293                    byte signatureByte= in.readByte();
2294                    long objectId= readObjectID(in);
2295                    printlnTaggedObjectId("Exception object id:", objectId, signatureByte); //$NON-NLS-1$
2296
readAndPrintLocation(in);
2297                    break;
2298                case EVENTKIND_THREAD_START:
2299                case EVENTKIND_THREAD_DEATH:
2300                    threadId= readObjectID(in);
2301                    printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
2302
break;
2303                case EVENTKIND_CLASS_PREPARE:
2304                    threadId= readObjectID(in);
2305                    byte refTypeTag= in.readByte();
2306                    long typeId= readReferenceTypeID(in);
2307                    String JavaDoc typeSignature= readString(in);
2308                    int status= in.readInt();
2309                    printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
2310
printRefTypeTag(refTypeTag);
2311                    printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
2312
println("Type signature:", typeSignature); //$NON-NLS-1$
2313
println("Status:", status); //$NON-NLS-1$
2314
break;
2315                case EVENTKIND_CLASS_UNLOAD:
2316                    typeSignature= readString(in);
2317                    println("Type signature:", typeSignature); //$NON-NLS-1$
2318
break;
2319                case EVENTKIND_FIELD_ACCESS:
2320                    threadId= readObjectID(in);
2321                    printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
2322
readAndPrintLocation(in);
2323                    refTypeTag= in.readByte();
2324                    typeId= readReferenceTypeID(in);
2325                    long fieldId= readFieldID(in);
2326                    signatureByte= in.readByte();
2327                    objectId= readObjectID(in);
2328                    printRefTypeTag(refTypeTag);
2329                    printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
2330
printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
2331
printlnTaggedObjectId("Object id:", objectId, signatureByte); //$NON-NLS-1$
2332
break;
2333                case EVENTKIND_FIELD_MODIFICATION:
2334                    threadId= readObjectID(in);
2335                    printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
2336
readAndPrintLocation(in);
2337                    refTypeTag= in.readByte();
2338                    typeId= readReferenceTypeID(in);
2339                    fieldId= readFieldID(in);
2340                    signatureByte= in.readByte();
2341                    objectId= readObjectID(in);
2342                    printRefTypeTag(refTypeTag);
2343                    printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
2344
printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
2345
printlnTaggedObjectId("Object id:", objectId, signatureByte); //$NON-NLS-1$
2346
readAndPrintlnTaggedValue("Value:", in); //$NON-NLS-1$
2347
break;
2348                case EVENTKIND_VM_DEATH:
2349                    break;
2350            }
2351        }
2352    }
2353
2354    /**
2355     * Reads String from Jdwp stream.
2356     * Read a UTF where length has 4 bytes, and not just 2.
2357     * This code was based on the OTI Retysin source for readUTF.
2358     */

2359    private static String JavaDoc readString(DataInputStream JavaDoc in) throws IOException JavaDoc {
2360        int utfSize = in.readInt();
2361        byte utfBytes[] = new byte[utfSize];
2362        in.readFully(utfBytes);
2363        /* Guess at buffer size */
2364        StringBuffer JavaDoc strBuffer = new StringBuffer JavaDoc(utfSize / 3 * 2);
2365        for (int i = 0; i < utfSize;) {
2366            int a = utfBytes[i] & 0xFF;
2367            if ((a >> 4) < 12) {
2368                strBuffer.append((char) a);
2369                i++;
2370            } else {
2371                int b = utfBytes[i + 1] & 0xFF;
2372                if ((a >> 4) < 14) {
2373                    if ((b & 0xBF) == 0) {
2374                        throw new UTFDataFormatException JavaDoc("Second byte input does not match UTF Specification"); //$NON-NLS-1$
2375
}
2376                    strBuffer.append((char) (((a & 0x1F) << 6) | (b & 0x3F)));
2377                    i += 2;
2378                } else {
2379                    int c = utfBytes[i + 2] & 0xFF;
2380                    if ((a & 0xEF) > 0) {
2381                        if (((b & 0xBF) == 0) || ((c & 0xBF) == 0)) {
2382                            throw new UTFDataFormatException JavaDoc("Second or third byte input does not mach UTF Specification_"); //$NON-NLS-1$
2383
}
2384                        strBuffer.append((char) (((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F)));
2385                        i += 3;
2386                    } else {
2387                        throw new UTFDataFormatException JavaDoc("Input does not match UTF Specification"); //$NON-NLS-1$
2388
}
2389                }
2390            }
2391        }
2392        return strBuffer.toString();
2393    }
2394    
2395    private byte[] remainderData(DataInputStream JavaDoc in) throws IOException JavaDoc {
2396        byte[] buffer= new byte[100];
2397        byte[] res = new byte[0], newRes;
2398        int resLength= 0, length;
2399        while ((length= in.read(buffer)) != -1) {
2400            newRes= new byte[resLength + length];
2401            System.arraycopy(res, 0, newRes, 0, resLength);
2402            System.arraycopy(buffer, 0, newRes, resLength, length);
2403            res= newRes;
2404            resLength += length;
2405        }
2406        return res;
2407    }
2408    
2409    private long readObjectID(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2410        if (!TcpipSpy.hasSizes()) {
2411            throw new UnableToParseDataException("Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
2412
}
2413        return readID(in, TcpipSpy.getObjectIDSize());
2414    }
2415
2416    private long readReferenceTypeID(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2417        if (!TcpipSpy.hasSizes()) {
2418            throw new UnableToParseDataException("Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
2419
}
2420        return readID(in, TcpipSpy.getReferenceTypeIDSize());
2421    }
2422
2423    private long readFieldID(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2424        if (!TcpipSpy.hasSizes()) {
2425            throw new UnableToParseDataException("Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
2426
}
2427        return readID(in, TcpipSpy.getFieldIDSize());
2428    }
2429
2430    private long readMethodID(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2431        if (!TcpipSpy.hasSizes()) {
2432            throw new UnableToParseDataException("Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
2433
}
2434        return readID(in, TcpipSpy.getMethodIDSize());
2435    }
2436
2437    private long readFrameID(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2438        if (!TcpipSpy.hasSizes()) {
2439            throw new UnableToParseDataException("Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
2440
}
2441        return readID(in, TcpipSpy.getFrameIDSize());
2442    }
2443
2444    private long readID(DataInputStream JavaDoc in, int size) throws IOException JavaDoc {
2445        long id = 0;
2446        for (int i = 0; i < size; i++) {
2447            int b = in.readUnsignedByte(); // Note that the byte must be treated as unsigned.
2448
id = id << 8 | b;
2449        }
2450        return id;
2451    }
2452    
2453    private void readAndPrintlnTaggedValue(String JavaDoc description, DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2454        byte tag= in.readByte();
2455        readAndPrintlnUntaggedValue(description, in, tag, true);
2456    }
2457    
2458    private void readAndPrintlnUntaggedValue(String JavaDoc description, DataInputStream JavaDoc in, byte tag, boolean printTagValue) throws IOException JavaDoc, UnableToParseDataException {
2459        printDescription(description);
2460        int size;
2461        boolean isId= false;
2462        switch (tag) {
2463            case VOID_TAG:
2464                printSignatureByte(tag, printTagValue);
2465                println();
2466                return;
2467            case BOOLEAN_TAG:
2468                if (printTagValue) {
2469                    printSignatureByte(tag, true);
2470                    print(' ');
2471                    println(in.readBoolean());
2472                } else {
2473                    println(in.readBoolean());
2474                    print(' ');
2475                    printSignatureByte(tag, false);
2476                }
2477                return;
2478            case BYTE_TAG:
2479                size= 1;
2480                break;
2481            case CHAR_TAG:
2482            case SHORT_TAG:
2483                size= 2;
2484                break;
2485            case INT_TAG:
2486            case FLOAT_TAG:
2487                size= 4;
2488                break;
2489            case DOUBLE_TAG:
2490            case LONG_TAG:
2491                size= 8;
2492                break;
2493            case ARRAY_TAG:
2494            case OBJECT_TAG:
2495            case STRING_TAG:
2496            case THREAD_TAG:
2497            case THREAD_GROUP_TAG:
2498            case CLASS_LOADER_TAG:
2499            case CLASS_OBJECT_TAG:
2500                if (!TcpipSpy.hasSizes()) {
2501                    throw new UnableToParseDataException("Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
2502
}
2503                size= TcpipSpy.getObjectIDSize();
2504                isId= true;
2505                break;
2506            default:
2507                size= 0;
2508                break;
2509        }
2510        
2511        long value= readID(in, size);
2512        if (printTagValue) {
2513            printSignatureByte(tag, true);
2514            print(' ');
2515        }
2516        printHex(value, size);
2517        if (isId) {
2518            printParanthetical(value);
2519        } else {
2520            switch (tag) {
2521            case BYTE_TAG:
2522                printParanthetical((byte) value);
2523                break;
2524            case CHAR_TAG:
2525                printParanthetical((char) value);
2526                break;
2527            case SHORT_TAG:
2528                printParanthetical((short) value);
2529                break;
2530            case INT_TAG:
2531                printParanthetical((int) value);
2532                break;
2533            case FLOAT_TAG:
2534                printParanthetical(Float.intBitsToFloat((int) value));
2535                break;
2536            case DOUBLE_TAG:
2537                printParanthetical(Double.longBitsToDouble(value));
2538                break;
2539            case LONG_TAG:
2540                printParanthetical(value);
2541                break;
2542            }
2543        }
2544        if (!printTagValue) {
2545            print(' ');
2546            printSignatureByte(tag, false);
2547        }
2548        println();
2549    }
2550    
2551    private void printSignatureByte(byte signatureByte, boolean printValue) {
2552        String JavaDoc type;
2553        switch (signatureByte) {
2554            case VOID_TAG:
2555                type= "void"; //$NON-NLS-1$
2556
break;
2557            case BOOLEAN_TAG:
2558                type= "boolean"; //$NON-NLS-1$
2559
break;
2560            case BYTE_TAG:
2561                type= "byte"; //$NON-NLS-1$
2562
break;
2563            case CHAR_TAG:
2564                type= "char"; //$NON-NLS-1$
2565
break;
2566            case SHORT_TAG:
2567                type= "short"; //$NON-NLS-1$
2568
break;
2569            case INT_TAG:
2570                type= "int"; //$NON-NLS-1$
2571
break;
2572            case FLOAT_TAG:
2573                type= "float"; //$NON-NLS-1$
2574
break;
2575            case DOUBLE_TAG:
2576                type= "double"; //$NON-NLS-1$
2577
break;
2578            case LONG_TAG:
2579                type= "long"; //$NON-NLS-1$
2580
break;
2581            case ARRAY_TAG:
2582                type= "array id"; //$NON-NLS-1$
2583
break;
2584            case OBJECT_TAG:
2585                type= "object id"; //$NON-NLS-1$
2586
break;
2587            case STRING_TAG:
2588                type= "string id"; //$NON-NLS-1$
2589
break;
2590            case THREAD_TAG:
2591                type= "thread id"; //$NON-NLS-1$
2592
break;
2593            case THREAD_GROUP_TAG:
2594                type= "thread group id"; //$NON-NLS-1$
2595
break;
2596            case CLASS_LOADER_TAG:
2597                type= "class loader id"; //$NON-NLS-1$
2598
break;
2599            case CLASS_OBJECT_TAG:
2600                type= "class object id"; //$NON-NLS-1$
2601
break;
2602            default:
2603                type= "unknown"; //$NON-NLS-1$
2604
break;
2605        }
2606        if (printValue) {
2607            printHex(signatureByte);
2608            print(" ("); //$NON-NLS-1$
2609
print(signatureByte);
2610            print(" - "); //$NON-NLS-1$
2611
} else {
2612            print(" ("); //$NON-NLS-1$
2613
}
2614        print(type + ')');
2615    }
2616    
2617    private void readAndPrintLocation(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2618        byte typeTag= in.readByte();
2619        long classId= readReferenceTypeID(in);
2620        long methodId= readMethodID(in);
2621        long index= in.readLong();
2622        printlnReferenceTypeIdWithTypeTag("Location: class id:", classId, typeTag); //$NON-NLS-1$
2623
printlnMethodId(" method id:", methodId); //$NON-NLS-1$
2624
println(" index:", index); //$NON-NLS-1$
2625
}
2626    
2627    private void readAndPrintArrayRegion(DataInputStream JavaDoc in) throws IOException JavaDoc, UnableToParseDataException {
2628        byte signatureByte= in.readByte();
2629        int valuesCount= in.readInt();
2630        printDescription("Signature byte:"); //$NON-NLS-1$
2631
printSignatureByte(signatureByte, true);
2632        println();
2633        println("Values count:", valuesCount); //$NON-NLS-1$
2634
switch (signatureByte) {
2635            case ARRAY_TAG:
2636            case OBJECT_TAG:
2637            case STRING_TAG:
2638            case THREAD_TAG:
2639            case THREAD_GROUP_TAG:
2640            case CLASS_LOADER_TAG:
2641            case CLASS_OBJECT_TAG:
2642                for (int i= 0; i < valuesCount; i ++) {
2643                    readAndPrintlnTaggedValue("Value", in); //$NON-NLS-1$
2644
}
2645                break;
2646            default:
2647                for (int i= 0; i < valuesCount; i ++) {
2648                    readAndPrintlnUntaggedValue("Value", in, signatureByte, false); //$NON-NLS-1$
2649
}
2650                break;
2651        }
2652    }
2653    
2654    protected void println(String JavaDoc description, int value) {
2655        printDescription(description);
2656        printHex(value);
2657        printParanthetical(value);
2658        println();
2659    }
2660    
2661    protected void println(String JavaDoc description, long value) {
2662        printDescription(description);
2663        printHex(value);
2664        printParanthetical(value);
2665        println();
2666    }
2667    
2668    protected void println(String JavaDoc description, String JavaDoc value) {
2669        printDescription(description);
2670        print('\"');
2671        StringBuffer JavaDoc val= new StringBuffer JavaDoc();
2672        int pos= 0, lastPos= 0;
2673        while ((pos= value.indexOf('\n', lastPos)) != -1) {
2674            pos++;
2675            val.append(value.substring(lastPos, pos));
2676            val.append(shift);
2677            lastPos= pos;
2678        }
2679        val.append(value.substring(lastPos, value.length()));
2680        print(val);
2681        println('"');
2682    }
2683    
2684    protected void println(String JavaDoc description, boolean value) {
2685        printDescription(description);
2686        println(value);
2687    }
2688    
2689    protected void printlnReferenceTypeId(String JavaDoc description, long value) {
2690        println(description, value, TcpipSpy.getReferenceTypeIDSize());
2691    }
2692    
2693    protected void printlnReferenceTypeIdWithTypeTag(String JavaDoc description, long value, byte typeTag) {
2694        printDescription(description);
2695        printRefTypeTagValue(typeTag);
2696        print(" - "); //$NON-NLS-1$
2697
printHex(value, TcpipSpy.getReferenceTypeIDSize());
2698        printParanthetical(value);
2699        println();
2700    }
2701    
2702    protected void printlnObjectId(String JavaDoc description, long value) {
2703        printDescription(description);
2704        printHex(value, TcpipSpy.getObjectIDSize());
2705        if (value == 0) {
2706            println(" (NULL)"); //$NON-NLS-1$
2707
} else {
2708            printParanthetical(value);
2709            println();
2710        }
2711    }
2712    
2713    protected void printlnTaggedObjectId(String JavaDoc description, long value, byte signatureByte) {
2714        printDescription(description);
2715        printSignatureByte(signatureByte, true);
2716        print(' ');
2717        printHex(value, TcpipSpy.getReferenceTypeIDSize());
2718        if (value == 0) {
2719            println(" (NULL)"); //$NON-NLS-1$
2720
} else {
2721            printParanthetical(value);
2722            println();
2723        }
2724    }
2725    
2726    
2727    protected void printlnFieldId(String JavaDoc description, long value) {
2728        println(description, value, TcpipSpy.getFieldIDSize());
2729    }
2730    
2731    protected void printlnMethodId(String JavaDoc description, long value) {
2732        println(description, value, TcpipSpy.getMethodIDSize());
2733    }
2734    
2735    protected void printlnFrameId(String JavaDoc description, long value) {
2736        println(description, value, TcpipSpy.getFrameIDSize());
2737    }
2738    
2739    protected void println(String JavaDoc description, long value, int size) {
2740        printDescription(description);
2741        printHex(value, size);
2742        printParanthetical(value);
2743        println();
2744    }
2745    
2746    protected void printDescription(String JavaDoc description) {
2747        // current max length = 36 (+2 pad)
2748
int width = 38 - description.length();
2749        print(description);
2750        write(padding, 0, width);
2751    }
2752    
2753    protected void printHexString(String JavaDoc hex, int width) {
2754        width-= hex.length();
2755        print("0x"); //$NON-NLS-1$
2756
write(zeros, 0, width);
2757        print(hex);
2758    }
2759    
2760    protected void printHex(long l, int byteNumber) {
2761        printHexString(Long.toHexString(l).toUpperCase(), byteNumber * 2);
2762    }
2763    
2764    protected void printHex(byte b) {
2765        printHexString(Integer.toHexString(b & 0xFF).toUpperCase(), 2);
2766    }
2767
2768    protected void printHex(int i) {
2769        printHexString(Integer.toHexString(i).toUpperCase(), 8);
2770    }
2771    
2772    protected void printHex(long l) {
2773        printHexString(Long.toHexString(l).toUpperCase(), 16);
2774    }
2775    
2776    protected void printHex(byte[] b) {
2777        if (b == null) {
2778            println("NULL"); //$NON-NLS-1$
2779
return;
2780        }
2781        int i, length;
2782        for (i= 0, length= b.length; i < length; i ++) {
2783            String JavaDoc hexa= Integer.toHexString(b[i]).toUpperCase();
2784            if (hexa.length() == 1) {
2785                print('0');
2786            }
2787            print(hexa);
2788            if ((i % 32) == 0 && i != 0) {
2789                println();
2790                print(shift);
2791            } else {
2792                print(' ');
2793            }
2794        }
2795        println();
2796    }
2797    
2798    protected void printParanthetical(byte i) {
2799        print(" ("); //$NON-NLS-1$
2800
print(i);
2801        print(')');
2802    }
2803
2804    protected void printParanthetical(char i) {
2805        print(" ("); //$NON-NLS-1$
2806
print(i);
2807        print(')');
2808    }
2809
2810    protected void printParanthetical(short i) {
2811        print(" ("); //$NON-NLS-1$
2812
print(i);
2813        print(')');
2814    }
2815
2816    protected void printParanthetical(int i) {
2817        print(" ("); //$NON-NLS-1$
2818
print(i);
2819        print(')');
2820    }
2821    
2822    protected void printParanthetical(long l) {
2823        print(" ("); //$NON-NLS-1$
2824
print(l);
2825        print(')');
2826    }
2827    
2828    protected void printParanthetical(float f) {
2829        print(" ("); //$NON-NLS-1$
2830
print(f);
2831        print(')');
2832    }
2833    
2834    protected void printParanthetical(double d) {
2835        print(" ("); //$NON-NLS-1$
2836
print(d);
2837        print(')');
2838    }
2839    
2840    protected void printParanthetical(String JavaDoc s) {
2841        print(" ("); //$NON-NLS-1$
2842
print(s);
2843        print(')');
2844    }
2845    
2846}
2847
Popular Tags