本文整理汇总了Java中org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket.getNextValueAsValue方法的典型用法代码示例。如果您正苦于以下问题:Java ReplyPacket.getNextValueAsValue方法的具体用法?Java ReplyPacket.getNextValueAsValue怎么用?Java ReplyPacket.getNextValueAsValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket
的用法示例。
在下文中一共展示了ReplyPacket.getNextValueAsValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFrameValues
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* Returns values of local variables in a given frame
*
* @param frame
* Frame whose variables to get
* @return An array of Value objects
*/
public final Value[] getFrameValues(Frame frame) {
CommandPacket command = new CommandPacket(
JDWPCommands.StackFrameCommandSet.CommandSetID,
JDWPCommands.StackFrameCommandSet.GetValuesCommand);
command.setNextValueAsThreadID(frame.getThreadID());
command.setNextValueAsFrameID(frame.getID());
int slots = frame.getVars().size();
command.setNextValueAsInt(slots);
Iterator it = frame.getVars().iterator();
while (it.hasNext()) {
Frame.Variable var = (Frame.Variable) it.next();
command.setNextValueAsInt(var.getSlot());
command.setNextValueAsByte(var.getTag());
}
ReplyPacket reply = checkReply(performCommand(command));
reply.getNextValueAsInt(); // number of values , is not used
Value[] values = new Value[slots];
for (int i = 0; i < slots; i++) {
values[i] = reply.getNextValueAsValue();
}
return values;
}
示例2: getObjectReferenceValues
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* Returns the value of one or more instance fields.
*
* @param objectID
* The object ID
* @param fieldIDs
* IDs of fields to get
* @return An array of Value objects representing each field's value
*/
public final Value[] getObjectReferenceValues(long objectID, long[] fieldIDs) {
int fieldsCount = fieldIDs.length;
if (fieldsCount == 0) {
return null;
}
CommandPacket command = new CommandPacket(
JDWPCommands.ObjectReferenceCommandSet.CommandSetID,
JDWPCommands.ObjectReferenceCommandSet.GetValuesCommand);
command.setNextValueAsReferenceTypeID(objectID);
command.setNextValueAsInt(fieldsCount);
for (int i = 0; i < fieldsCount; i++) {
command.setNextValueAsFieldID(fieldIDs[i]);
}
ReplyPacket reply = checkReply(performCommand(command));
reply.getNextValueAsInt(); // fields returned, is not used
Value[] values = new Value[fieldsCount];
for (int i = 0; i < fieldsCount; i++) {
values[i] = reply.getNextValueAsValue();
}
return values;
}
示例3: getReferenceTypeValues
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* Returns the value of one or more static fields of the reference type
*
* @param refTypeID
* The reference type ID.
* @param fieldIDs
* IDs of fields to get
* @return An array of Value objects representing each field's value
*/
public final Value[] getReferenceTypeValues(long refTypeID, long[] fieldIDs) {
int fieldsCount = fieldIDs.length;
if (fieldsCount == 0) {
return null;
}
CommandPacket command = new CommandPacket(
JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
JDWPCommands.ReferenceTypeCommandSet.GetValuesCommand);
command.setNextValueAsReferenceTypeID(refTypeID);
command.setNextValueAsInt(fieldsCount);
for (int i = 0; i < fieldsCount; i++) {
command.setNextValueAsFieldID(fieldIDs[i]);
}
ReplyPacket reply = checkReply(performCommand(command));
reply.getNextValueAsInt(); // fields returned, is not used
Value[] values = new Value[fieldsCount];
for (int i = 0; i < fieldsCount; i++) {
values[i] = reply.getNextValueAsValue();
}
return values;
}
示例4: checkArrayValues
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
private void checkArrayValues(ArrayRegion valuesRegion, long classID,
long fieldID) {
CommandPacket packet = new CommandPacket(
JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
JDWPCommands.ReferenceTypeCommandSet.GetValuesCommand);
packet.setNextValueAsReferenceTypeID(classID);
packet.setNextValueAsInt(1);
packet.setNextValueAsFieldID(fieldID);
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
checkReplyPacket(reply, "ReferenceType::GetValues command");
assertEquals("GetValuesCommand returned invalid number of values,", 1, reply.getNextValueAsInt());
Value value = reply.getNextValueAsValue();
//System.err.println("value="+value);
long arrayID = value.getLongValue();
int length = valuesRegion.getLength();
checkArrayRegion(valuesRegion, arrayID, 0, length);
}
示例5: checkArrayValues
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
private void checkArrayValues(long classID, long fieldID, int error, int length,
int checksNumber, byte expectedArrayTag, byte expectedElementTag, boolean checkValues)
throws UnsupportedEncodingException {
CommandPacket packet = new CommandPacket(
JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
JDWPCommands.ReferenceTypeCommandSet.GetValuesCommand);
// set referenceTypeID
packet.setNextValueAsReferenceTypeID(classID);
// repeat 1 time
packet.setNextValueAsInt(1);
// set fieldID
packet.setNextValueAsFieldID(fieldID);
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
checkReplyPacket(reply, "ReferenceType::GetValues command");
assertEquals("ReferenceType::GetValues command returned invalid int value,", reply.getNextValueAsInt(), 1);
Value value = reply.getNextValueAsValue();
long arrayID = value.getLongValue();
logWriter.println("==> testGetValues001: checked arrayID = " + arrayID);
logWriter.println("==> testGetValues001: checkArrayRegion: arrayID = " + arrayID
+ "; Expected error = " + error + "(" + JDWPConstants.Error.getName(error) + ")"
+ "; firstIndex = 0; length = " + length);
checkArrayRegion
(arrayID, error, 0, length, expectedArrayTag, expectedElementTag, checkValues);
logWriter.println("==> PASSED!");
if ( checksNumber > 1 ) {
logWriter.println("==> testGetValues001: checkArrayRegion: arrayID = " + arrayID
+ "; Expected error = " + error+ "(" + JDWPConstants.Error.getName(error) + ")"
+ "; firstIndex = 1; length = " + (length-1));
checkArrayRegion
(arrayID, error, 1, length-1, expectedArrayTag, expectedElementTag, checkValues);
logWriter.println("==> PASSED!");
logWriter.println("==> testGetValues001: checkArrayRegion: arrayID = " + arrayID
+ "; Expected error = " + error+ "(" + JDWPConstants.Error.getName(error) + ")"
+ "; firstIndex = 0; length = " + (length-1));
checkArrayRegion
(arrayID, error, 0, length-1, expectedArrayTag, expectedElementTag, checkValues);
logWriter.println("==> PASSED!");
logWriter.println("==> testGetValues001: checkArrayRegion: arrayID = " + arrayID
+ "; Expected error = " + error+ "(" + JDWPConstants.Error.getName(error) + ")"
+ "; firstIndex = " + (length-1) + " length = 1");
checkArrayRegion
(arrayID, error, length-1, 1, expectedArrayTag, expectedElementTag, checkValues);
logWriter.println("==> PASSED!");
}
}