long sent = System.currentTimeMillis();
fVirtualMachineImpl.packetSendManager().sendPacket(commandPacket);
fPendingJdwpRequest = true;
writeVerboseCommandPacketHeader(commandPacket);
JdwpReplyPacket reply = fVirtualMachineImpl.packetReceiveManager()
.getReply(commandPacket);
long recieved = System.currentTimeMillis();
if (JDIDebugOptions.DEBUG_JDI_REQUEST_TIMES) {
StringBuffer buf = new StringBuffer();
buf.append(JDIDebugOptions.FORMAT.format(new Date(sent)));
buf.append(" JDI Request: "); //$NON-NLS-1$
buf.append(commandPacket.toString());
buf.append("\n\tResponse Time: "); //$NON-NLS-1$
buf.append(recieved - sent);
buf.append("ms"); //$NON-NLS-1$
buf.append(" length: "); //$NON-NLS-1$
buf.append(reply.getLength());
JDIDebugOptions.trace(buf.toString());
}
if (fVerboseWriter != null) {
fVerboseWriter.println();
fVerboseWriter.println("Received reply"); //$NON-NLS-1$
fVerboseWriter.println("length", reply.getLength()); //$NON-NLS-1$
fVerboseWriter.println("id", reply.getId()); //$NON-NLS-1$
fVerboseWriter.println(
"flags", reply.getFlags(), JdwpPacket.getFlagMap()); //$NON-NLS-1$
fVerboseWriter
.println(
"error code", reply.errorCode(), JdwpReplyPacket.errorMap()); //$NON-NLS-1$
}
return reply;
}