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


Java ReplyPacket.getNextValueAsFieldID方法代码示例

本文整理汇总了Java中org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket.getNextValueAsFieldID方法的典型用法代码示例。如果您正苦于以下问题:Java ReplyPacket.getNextValueAsFieldID方法的具体用法?Java ReplyPacket.getNextValueAsFieldID怎么用?Java ReplyPacket.getNextValueAsFieldID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket的用法示例。


在下文中一共展示了ReplyPacket.getNextValueAsFieldID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFieldID

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * Gets FieldID from ReplyPacket.
 * 
 * @param request
 *            ReplyPacket for request
 * @param field
 *            field name to get ID for
 * @return received FieldID
 */
public long getFieldID(ReplyPacket request, String field) {
    long fieldID = -1;
    String fieldName;
    // Get fieldID from received packet
    int count = request.getNextValueAsInt();
    for (int i = 0; i < count; i++) {
        fieldID = request.getNextValueAsFieldID();
        fieldName = request.getNextValueAsString();
        if (field.equals(fieldName)) {
            request.getNextValueAsString();
            request.getNextValueAsInt();
            break;
        } else {
            request.getNextValueAsString();
            request.getNextValueAsInt();
            fieldID = 0;
            fieldName = null;
        }
    }
    return fieldID;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:31,代码来源:VmMirror.java

示例2: getAllFields

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * Returns information for each field in a reference type including
 * inherited fields
 * 
 * @param classID
 *            The reference type ID
 * @return A list of Field objects representing each field of the class
 */
public final List getAllFields(long classID) {
    ArrayList<Field> fields = new ArrayList<Field>(0);

    long superID = getSuperclassId(classID);
    if (superID != 0) {
        List superClassFields = getAllFields(superID);
        for (int i = 0; i < superClassFields.size(); i++) {
            fields.add((Field) superClassFields.toArray()[i]);
        }
    }

    ReplyPacket reply = getFieldsInClass(classID);
    int fieldsCount = reply.getNextValueAsInt();
    for (int i = 0; i < fieldsCount; i++) {
        Field field = new Field(reply.getNextValueAsFieldID(), classID,
                reply.getNextValueAsString(), reply.getNextValueAsString(),
                reply.getNextValueAsInt());
        fields.add(field);
    }

    return fields;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:31,代码来源:VmMirror.java

示例3: jdwpGetFields

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * Returns for specified class array with information about fields of this class.
 * <BR>Each element of array contains: 
 * <BR>Field ID, Field name, Field signature, Field modifier bit flags; 
 * @param refType - ReferenceTypeID, defining class.
 * @return array with information about fields.
 */
protected FieldInfo[] jdwpGetFields(long refType) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
            JDWPCommands.ReferenceTypeCommandSet.FieldsCommand);
    packet.setNextValueAsReferenceTypeID(refType);
    
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    assertTrue(reply.getErrorCode() == JDWPConstants.Error.NONE);
    
    int declared = reply.getNextValueAsInt();
    FieldInfo[] fields = new FieldInfo[declared];
    for (int i = 0; i < declared; i++) {
        fields[i] =
            new FieldInfo(reply.getNextValueAsFieldID(),
                          reply.getNextValueAsString(),
                          reply.getNextValueAsString(),
                          reply.getNextValueAsInt());
    }
    return fields;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:28,代码来源:JDWPClassTypeTestCase.java

示例4: jdwpGetFieldIDs

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
private FieldInfo[] jdwpGetFieldIDs(long classID) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
            JDWPCommands.ReferenceTypeCommandSet.FieldsCommand);
    packet.setNextValueAsReferenceTypeID(classID);
    
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "ReferenceType::Fields command");
    
    int declared = reply.getNextValueAsInt();
    FieldInfo[] fields = new FieldInfo[declared];
    for (int i = 0; i < declared; i++) {
        fields[i] = new FieldInfo(
                reply.getNextValueAsFieldID(),
                reply.getNextValueAsString(),
                reply.getNextValueAsString(),
                reply.getNextValueAsInt()
                );
    }
    
    return fields;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:23,代码来源:SetValuesTest.java

示例5: testLength001

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * This testcase exercises ArrayReference.Length command.
 * <BR>Starts <A HREF="ArrayReferenceDebuggee.html">ArrayReferenceDebuggee</A>. 
 * <BR>Receives fields with ReferenceType.fields command, 
 * checks length with ArrayReference.Length command.
 */
public void testLength001() throws UnsupportedEncodingException {
    logWriter.println("testLength001 started");
    synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);

    // obtain classID
    long classID = getClassIDBySignature("Lorg/apache/harmony/jpda/tests/jdwp/ArrayReference/ArrayReferenceDebuggee;");

    // obtain fields
    CommandPacket packet = new CommandPacket(
            JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
            JDWPCommands.ReferenceTypeCommandSet.FieldsCommand);
    packet.setNextValueAsReferenceTypeID(classID);
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "ReferenceType::Fields command");
    
    int declared = reply.getNextValueAsInt();
    for (int i = 0; i < declared; i++) {
        long fieldID = reply.getNextValueAsFieldID();
        reply.getNextValueAsString();
        reply.getNextValueAsString();
        reply.getNextValueAsInt();
        
        switch (i) {
            case 0:
                // int[] intArray = new int[10]
                checkArrayLength(classID, fieldID, JDWPConstants.Error.NONE, 10);
                break;
            case 1:
                // String[] strArray = new String[8]
                checkArrayLength(classID, fieldID, JDWPConstants.Error.NONE, 8);
                break;
            case 2:
                // Integer intField = new Integer(-1)
                checkArrayLength(classID, fieldID, JDWPConstants.Error.INVALID_ARRAY, 0);
                break;
        }
    }

    logWriter.println("test PASSED!");
    synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:48,代码来源:LengthTest.java


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