ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
checkReplyPacket(reply, "ArrayReference::GetValues command", error);
if (reply.getErrorCode() == JDWPConstants.Error.NONE) {
// do not check values for non-array fields
ArrayRegion region = reply.getNextValueAsArrayRegion();
//System.err.println("length="+region.length);
byte arrayTag = region.getTag();
logWriter.println("==> arrayTag = " + arrayTag
+ "(" + JDWPConstants.Tag.getName(arrayTag) + ")");
logWriter.println("==> arrayLength = "+region.getLength());
Value value_0 = region.getValue(0);
byte elementTag = value_0.getTag();
logWriter.println("==> elementTag = " + elementTag
+ "(" + JDWPConstants.Tag.getName(elementTag) + ")");
assertEquals("ArrayReference::GetValues returned invalid array tag,",
expectedArrayTag, arrayTag,
JDWPConstants.Tag.getName(expectedArrayTag),
JDWPConstants.Tag.getName(arrayTag));
assertEquals("ArrayReference::GetValues returned invalid array length,",
length, region.getLength());
assertEquals("ArrayReference::GetValues returned invalid element tag",
expectedElementTag, elementTag,
JDWPConstants.Tag.getName(expectedElementTag),
JDWPConstants.Tag.getName(elementTag));
if (checkValues) {
for (int i = 0; i < region.getLength(); i++) {
Value value = region.getValue(i);
if (value.getTag() == JDWPConstants.Tag.INT_TAG) {
assertEquals("ArrayReference::GetValues returned invalid value on index:<" + i + ">,",
value.getIntValue(), i + firstIndex);
}
else if (value.getTag() == JDWPConstants.Tag.STRING_TAG) {