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


Java CommandPacket.setNextValueAsObjectID方法代码示例

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


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

示例1: getMethods

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
 * Gets method reference by signature.
 * 
 * @param classReferenceTypeID
 *            class referenceTypeID.
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket getMethods(long classReferenceTypeID) {
    // Create new command packet
    CommandPacket commandPacket = new CommandPacket();

    // Set command. "5" - is ID of Methods command in ReferenceType Command
    // Set
    commandPacket
            .setCommand(JDWPCommands.ReferenceTypeCommandSet.MethodsCommand);

    // Set command set. "2" - is ID of ReferenceType Command Set
    commandPacket
            .setCommandSet(JDWPCommands.ReferenceTypeCommandSet.CommandSetID);

    // Set outgoing data
    // Set referenceTypeID
    commandPacket.setNextValueAsObjectID(classReferenceTypeID);

    // Send packet
    return checkReply(performCommand(commandPacket));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:28,代码来源:VmMirror.java

示例2: setInstanceFieldsValues

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
 * Sets the value of one or more instance fields
 * 
 * @param objectID
 *            The object ID.
 * @param fieldIDs
 *            An array of fields IDs
 * @param values
 *            An array of Value objects representing each value to set
 */
public final void setInstanceFieldsValues(long objectID, long[] fieldIDs,
        Value[] values) {
    if (fieldIDs.length != values.length) {
        throw new TestErrorException(
                "Number of fields doesn't correspond to number of their values");
    }

    CommandPacket command = new CommandPacket(
            JDWPCommands.ObjectReferenceCommandSet.CommandSetID,
            JDWPCommands.ObjectReferenceCommandSet.SetValuesCommand);
    command.setNextValueAsObjectID(objectID);
    command.setNextValueAsInt(fieldIDs.length);
    for (int i = 0; i < fieldIDs.length; i++) {
        command.setNextValueAsFieldID(fieldIDs[i]);
        command.setNextValueAsUntaggedValue(values[i]);
    }

    checkReply(performCommand(command));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:30,代码来源:VmMirror.java

示例3: invokeInstanceMethod

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
 * Invokes a member method of the given object.
 * 
 * @param objectID
 *            The object ID.
 * @param threadID
 *            The thread ID.
 * @param methodName
 *            The name of method for the invocation.
 * @param args
 *            The arguments for the invocation.
 * @param options
 *            The invocation options.
 * @return ReplyPacket for corresponding command
 */
public final ReplyPacket invokeInstanceMethod(long objectID, long threadID,
        String methodName, Value[] args, int options) {
    long classID = getReferenceType(objectID);
    long methodID = getMethodID(classID, methodName);
    CommandPacket command = new CommandPacket(
            JDWPCommands.ObjectReferenceCommandSet.CommandSetID,
            JDWPCommands.ObjectReferenceCommandSet.InvokeMethodCommand);
    command.setNextValueAsObjectID(objectID);
    command.setNextValueAsThreadID(threadID);
    command.setNextValueAsClassID(classID);
    command.setNextValueAsMethodID(methodID);
    command.setNextValueAsInt(args.length);
    for (int i = 0; i < args.length; i++) {
        command.setNextValueAsValue(args[i]);
    }
    command.setNextValueAsInt(options);

    return checkReply(performCommand(command));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:35,代码来源:VmMirror.java

示例4: getReferenceType

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
 * Returns the runtime type of the object
 * 
 * @param objectID
 *            The object ID
 * @return The runtime reference type.
 */
public final long getReferenceType(long objectID) {
    CommandPacket command = new CommandPacket(
            JDWPCommands.ObjectReferenceCommandSet.CommandSetID,
            JDWPCommands.ObjectReferenceCommandSet.ReferenceTypeCommand);
    command.setNextValueAsObjectID(objectID);
    ReplyPacket reply = checkReply(performCommand(command));
    reply.getNextValueAsByte();
    return reply.getNextValueAsLong();
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:VmMirror.java

示例5: getStringValue

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
 * Returns the characters contained in the string
 * 
 * @param objectID
 *            The String object ID.
 * @return A string value.
 */
public final String getStringValue(long objectID) {
    CommandPacket command = new CommandPacket(
            JDWPCommands.StringReferenceCommandSet.CommandSetID,
            JDWPCommands.StringReferenceCommandSet.ValueCommand);
    command.setNextValueAsObjectID(objectID);
    ReplyPacket reply = checkReply(performCommand(command));
    return reply.getNextValueAsString();
}
 
开发者ID:shannah,项目名称:cn1,代码行数:16,代码来源:VmMirror.java

示例6: getStringValue

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
 * Returns corresponding string from string ID.
 * 
 * @param stringID -
 *            string ID
 * @return string value
 */
protected String getStringValue(long stringID) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.StringReferenceCommandSet.CommandSetID,
            JDWPCommands.StringReferenceCommandSet.ValueCommand);
    packet.setNextValueAsObjectID(stringID);
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "StringReference::Value command");
    String returnedTestString = reply.getNextValueAsString();
    return returnedTestString;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:18,代码来源:JDWPTestCase.java

示例7: testReferringObjects_IllegalArgument

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
 * This testcase exercises ObjectReference.ReferringObjects command. <BR>
 * Compose a ReferringObjects command with negative maxReferrers
 * The vm should throw a ILLEGAL_ARGUMENT exception.
 */
public void testReferringObjects_IllegalArgument() {
    String thisTestName = "testReferringObjects_IllegalArgument";
    
    if (!isCapability()) {
        logWriter.println("##WARNING: this VM dosn't possess capability: canGetInstanceInfo");
        return;
    }
    
    int maxReferrers = -1;
    
    logWriter.println("==> " + thisTestName + " for " + thisCommandName + ": START...");
    synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);

    // Compose Instances command to get referree objectID
    CommandPacket InstancesCommand = new CommandPacket(
            JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
            JDWPCommands.ReferenceTypeCommandSet.InstancesCommand);
    
    long referreeObjTypeID = getClassIDBySignature(referreeObjSignature);
    InstancesCommand.setNextValueAsReferenceTypeID(referreeObjTypeID);
    InstancesCommand.setNextValueAsInt(1);
    
    ReplyPacket checkedReply = debuggeeWrapper.vmMirror.performCommand(InstancesCommand);
    InstancesCommand = null;
    
    // Get the number of instances that returned. 
    int objNum = checkedReply.getNextValueAsInt();
    // Get the tagged-objectID
    byte tag = checkedReply.getNextValueAsByte();
    long objectID = checkedReply.getNextValueAsObjectID();
    
    // Compose ReferringObjects commnad
    CommandPacket ReferringObjectsCommand = new CommandPacket(
            JDWPCommands.ObjectReferenceCommandSet.CommandSetID,
            JDWPCommands.ObjectReferenceCommandSet.ReferringObjectsCommand);
    
    ReferringObjectsCommand.setNextValueAsObjectID(objectID);
    ReferringObjectsCommand.setNextValueAsInt(maxReferrers);
    
    // Perform ReferringObjects command and attain reply package
    checkedReply = debuggeeWrapper.vmMirror
            .performCommand(ReferringObjectsCommand);
    ReferringObjectsCommand = null;

    short errorCode = checkedReply.getErrorCode();
    if (errorCode != JDWPConstants.Error.NONE) {
        if (errorCode == JDWPConstants.Error.NOT_IMPLEMENTED) {
            logWriter.println("=> CHECK PASSED: Expected error (NOT_IMPLEMENTED) is returned");
            return;
        }
        else if(errorCode == JDWPConstants.Error.ILLEGAL_ARGUMENT) {
            logWriter.println("=> CHECK PASSED: Expected error (ILLEGAL_ARGUMENT) is returned");
            return;
        }
    }
    printErrorAndFail(thisCommandName + " should throw ILLEGAL_ARGUMENT exception when maxReferrers is negative.");
}
 
开发者ID:shannah,项目名称:cn1,代码行数:63,代码来源:ReferringObjectsTest.java


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