当前位置: 首页>>代码示例>>Java>>正文


Java ReplyPacket.getNextValueAsValue方法代码示例

本文整理汇总了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;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:32,代码来源:VmMirror.java

示例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;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:34,代码来源:VmMirror.java

示例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;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:34,代码来源:VmMirror.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:21,代码来源:SetValuesTest.java

示例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!");
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:51,代码来源:GetValuesTest.java


注:本文中的org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket.getNextValueAsValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。