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


Java CommandPacket.setNextValueAsInt方法代码示例

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


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

示例1: perform

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
@Override
public void perform(JUnit3Wrapper testBase) {
  Optional<Variable> localVar =
      getVariableAt(testBase.getMirror(), testBase.debuggeeState.getLocation(), localName);
  Assert.assertTrue("No local '" + localName + "'", localVar.isPresent());

  CommandPacket setValues = new CommandPacket(StackFrameCommandSet.CommandSetID,
      StackFrameCommandSet.SetValuesCommand);
  setValues.setNextValueAsThreadID(testBase.getDebuggeeState().getThreadId());
  setValues.setNextValueAsFrameID(testBase.getDebuggeeState().getFrameId());
  setValues.setNextValueAsInt(1);
  setValues.setNextValueAsInt(localVar.get().getSlot());
  setValues.setNextValueAsValue(newValue);
  ReplyPacket replyPacket = testBase.getMirror().performCommand(setValues);
  testBase.checkReplyPacket(replyPacket, "StackFrame.SetValues");
}
 
开发者ID:inferjay,项目名称:r8,代码行数:17,代码来源:DebugTestBase.java

示例2: clearEvent

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
 * Clear an event request for specified request ID.
 * 
 * @param eventKind
 *            event type to clear
 * @param requestID
 *            request ID to clear
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket clearEvent(byte eventKind, int requestID) {
    // Create new command packet
    CommandPacket commandPacket = new CommandPacket();

    // Set command. "2" - is ID of Clear command in EventRequest Command Set
    commandPacket
            .setCommand(JDWPCommands.EventRequestCommandSet.ClearCommand);

    // Set command set. "15" - is ID of EventRequest Command Set
    commandPacket
            .setCommandSet(JDWPCommands.EventRequestCommandSet.CommandSetID);

    // Set outgoing data
    // Set event type to clear
    commandPacket.setNextValueAsByte(eventKind);

    // Set ID of request to clear
    commandPacket.setNextValueAsInt(requestID);

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

示例3: getFrameValues

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的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

示例4: getObjectReferenceValues

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的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

示例5: getReferenceTypeValues

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的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

示例6: getObjectID

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
private long getObjectID() {
    // Compose Instances command to get tested thread objectID
    CommandPacket InstancesCommand = new CommandPacket(
            JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
            JDWPCommands.ReferenceTypeCommandSet.InstancesCommand);

    long testThreadTypeID = getClassIDBySignature(testObjSignature);
    InstancesCommand.setNextValueAsReferenceTypeID(testThreadTypeID);
    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();
    return objectID;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:22,代码来源:ForceEarlyReturn006Test.java

示例7: 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

示例8: invokeStaticMethod

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
 * Invokes a static method of the given class.
 * 
 * @param classID
 *            The class type 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 invokeStaticMethod(long classID, long threadID,
        String methodName, Value[] args, int options) {
    long methodID = getMethodID(classID, methodName);
    CommandPacket command = new CommandPacket(
            JDWPCommands.ClassTypeCommandSet.CommandSetID,
            JDWPCommands.ClassTypeCommandSet.InvokeMethodCommand);
    command.setNextValueAsClassID(classID);
    command.setNextValueAsThreadID(threadID);
    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,代码行数:33,代码来源:VmMirror.java

示例9: jdwpGetFrames

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
protected FrameInfo[] jdwpGetFrames(long threadID, int startFrame, int length) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
            JDWPCommands.ThreadReferenceCommandSet.FramesCommand);
    packet.setNextValueAsThreadID(threadID);
    packet.setNextValueAsInt(startFrame);
    packet.setNextValueAsInt(length);
    
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "ThreadReference::FramesCommand command");
           
    int frames = reply.getNextValueAsInt();
    FrameInfo[] frameInfos = new FrameInfo[frames];
    for (int i = 0; i < frames; i++) {
        long frameID = reply.getNextValueAsLong();
        Location location = reply.getNextValueAsLocation();
        frameInfos[i] = new FrameInfo(frameID, location);
    }
    return frameInfos;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:21,代码来源:JDWPStackFrameTestCase.java

示例10: getFramesCount

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
private int getFramesCount(long threadID) {

        logWriter.println("getting frames of the thread");

        short err;
        
        // getting frames of the thread
        CommandPacket packet = new CommandPacket(
                JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
                JDWPCommands.ThreadReferenceCommandSet.FramesCommand);
        packet.setNextValueAsThreadID(threadID);
        packet.setNextValueAsInt(0);
        packet.setNextValueAsInt(-1);
        ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
        err = reply.getErrorCode(); 
        if ( err != JDWPConstants.Error.NONE) {
            logWriter.println("\tthreadID=" + threadID
                    + " - " + JDWPConstants.Error.getName(err));
            return 0;
        }
        int framesCount = reply.getNextValueAsInt();
        return framesCount;
    }
 
开发者ID:shannah,项目名称:cn1,代码行数:24,代码来源:FrameCountTest.java

示例11: setEventRequest

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
protected int setEventRequest() {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.EventRequestCommandSet.CommandSetID,
            JDWPCommands.EventRequestCommandSet.SetCommand);
    packet.setNextValueAsByte(JDWPConstants.EventKind.METHOD_ENTRY);
    packet.setNextValueAsByte(JDWPConstants.SuspendPolicy.ALL);
    packet.setNextValueAsInt(1);
    packet.setNextValueAsByte((byte) 5);
    packet.setNextValueAsString("*.InvokeMethodDebuggee");

    logWriter.println("\nSend EventRequest::Set command...");
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "EventRequest::Set command");
    
    int requestID = reply.getNextValueAsInt();
    logWriter.println(" EventRequest.Set: requestID=" + requestID);
    assertTrue(reply.isAllDataRead());
    return requestID;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:20,代码来源:InvokeMethodTest.java

示例12: checkArrayValues

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的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

示例13: jdwpGetFrames

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
protected FrameInfo[] jdwpGetFrames(long threadID, int startFrame, int length) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
            JDWPCommands.ThreadReferenceCommandSet.FramesCommand);
    packet.setNextValueAsThreadID(threadID);
    packet.setNextValueAsInt(startFrame);
    packet.setNextValueAsInt(length);
    
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    if (!checkReplyPacketWithoutFail(reply, "ThreadReference::FramesCommand command")) {
        throw new TestErrorException("Error during performing ThreadReference::Frames command");
    }
           
    int frames = reply.getNextValueAsInt();
    FrameInfo[] frameInfos = new FrameInfo[frames];
    for (int i = 0; i < frames; i++) {
        long frameID = reply.getNextValueAsLong();
        Location location = reply.getNextValueAsLocation();
        frameInfos[i] = new FrameInfo(frameID, location);
    }
    return frameInfos;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:23,代码来源:LaunchedDebugger.java

示例14: exit

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
 * Exits debuggee VM process.
 * 
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket exit(int exitCode) {
    // Create new command packet
    CommandPacket commandPacket = new CommandPacket();
    commandPacket
            .setCommand(JDWPCommands.VirtualMachineCommandSet.ExitCommand);
    commandPacket
            .setCommandSet(JDWPCommands.VirtualMachineCommandSet.CommandSetID);
    commandPacket.setNextValueAsInt(exitCode);

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

示例15: clearEvent

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
protected void clearEvent(int requestID) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.EventRequestCommandSet.CommandSetID,
            JDWPCommands.EventRequestCommandSet.ClearCommand);
    packet.setNextValueAsByte(JDWPConstants.EventKind.METHOD_ENTRY);
    packet.setNextValueAsInt(requestID);
    logWriter.println("\nSend EventRequest::Clear command...");
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "EventRequest::Clear command");
    assertAllDataRead(reply);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:12,代码来源:InvokeMethodTest.java


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