Package org.apache.harmony.jpda.tests.framework.jdwp

Examples of org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket


     * @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();
    }
View Full Code Here


     * @param objectID
     *            The array object ID.
     * @return The retrieved values.
     */
    public Value[] getArrayValues(long objectID) {
        CommandPacket command = new CommandPacket(
                JDWPCommands.ArrayReferenceCommandSet.CommandSetID,
                JDWPCommands.ArrayReferenceCommandSet.LengthCommand);
        command.setNextValueAsArrayID(objectID);
        ReplyPacket reply = checkReply(performCommand(command));
        int length = reply.getNextValueAsInt();

        if (length == 0) {
            return null;
        }

        command = new CommandPacket(
                JDWPCommands.ArrayReferenceCommandSet.CommandSetID,
                JDWPCommands.ArrayReferenceCommandSet.GetValuesCommand);
        command.setNextValueAsArrayID(objectID);
        command.setNextValueAsInt(0);
        command.setNextValueAsInt(length);
        reply = checkReply(performCommand(command));
        ArrayRegion arrayRegion = reply.getNextValueAsArrayRegion();

        Value[] values = new Value[length];
        for (int i = 0; i < length; i++) {
View Full Code Here

        if (vars.length != values.length) {
            throw new TestErrorException(
                    "Number of variables doesn't correspond to number of their values");
        }

        CommandPacket command = new CommandPacket(
                JDWPCommands.StackFrameCommandSet.CommandSetID,
                JDWPCommands.StackFrameCommandSet.SetValuesCommand);
        command.setNextValueAsThreadID(frame.getThreadID());
        command.setNextValueAsFrameID(frame.getID());
        command.setNextValueAsInt(vars.length);
        for (int i = 0; i < vars.length; i++) {
            command.setNextValueAsInt(vars[i].getSlot());
            command.setNextValueAsValue(values[i]);
        }

        checkReply(performCommand(command));
    }
View Full Code Here

        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));
    }
View Full Code Here

     * @param values
     *            An array of Value objects representing each value to set.
     */
    public final void setArrayValues(long arrayID, int firstIndex,
            Value[] values) {
        CommandPacket command = new CommandPacket(
                JDWPCommands.ArrayReferenceCommandSet.CommandSetID,
                JDWPCommands.ArrayReferenceCommandSet.SetValuesCommand);
        command.setNextValueAsArrayID(arrayID);
        command.setNextValueAsInt(firstIndex);
        command.setNextValueAsInt(values.length);
        for (int i = 0; i < values.length; i++) {
            command.setNextValueAsUntaggedValue(values[i]);
        }

        checkReply(performCommand(command));
    }
View Full Code Here

        if (fieldIDs.length != values.length) {
            throw new TestErrorException(
                    "Number of fields doesn't correspond to number of their values");
        }

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

        checkReply(performCommand(command));
    }
View Full Code Here

     * @param value
     *            The value of the string.
     * @return The string id.
     */
    public final long createString(String value) {
        CommandPacket command = new CommandPacket(
                JDWPCommands.VirtualMachineCommandSet.CommandSetID,
                JDWPCommands.VirtualMachineCommandSet.CreateStringCommand);
        command.setNextValueAsString(value);
        ReplyPacket reply = checkReply(performCommand(command));
        return reply.getNextValueAsStringID();
    }
View Full Code Here

     *
     * @param frame
     *            The instance of Frame.
     */
    public final void popFrame(Frame frame) {
        CommandPacket command = new CommandPacket(
                JDWPCommands.StackFrameCommandSet.CommandSetID,
                JDWPCommands.StackFrameCommandSet.PopFramesCommand);
        command.setNextValueAsThreadID(frame.getThreadID());
        command.setNextValueAsFrameID(frame.getID());
        checkReply(performCommand(command));
    }
View Full Code Here

     */
    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));
    }
View Full Code Here

     * @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));
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.