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

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


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


     * @param classSignature
     *            class signature.
     * @return ReplyPacket for corresponding command
     */
    public ReplyPacket getClassBySignature(String classSignature) {
        CommandPacket commandPacket = new CommandPacket(
                JDWPCommands.VirtualMachineCommandSet.CommandSetID,
                JDWPCommands.VirtualMachineCommandSet.ClassesBySignatureCommand);
        commandPacket.setNextValueAsString(classSignature);
        return checkReply(performCommand(commandPacket));
    }
View Full Code Here

     * @param referenceTypeID
     *            class referenceTypeID.
     * @return ReplyPacket for corresponding command
     */
    public ReplyPacket getFieldsInClass(long referenceTypeID) {
        CommandPacket commandPacket = new CommandPacket(
                JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
                JDWPCommands.ReferenceTypeCommandSet.FieldsCommand);
        commandPacket.setNextValueAsReferenceTypeID(referenceTypeID);
        return checkReply(performCommand(commandPacket));
    }
View Full Code Here

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

     * @param threadID
     *            The thread object ID.
     * @return The count of frames on this thread's stack
     */
    public final int getFrameCount(long threadID) {
        CommandPacket command = new CommandPacket(
                JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
                JDWPCommands.ThreadReferenceCommandSet.FrameCountCommand);
        command.setNextValueAsThreadID(threadID);
        ReplyPacket reply = checkReply(performCommand(command));
        return reply.getNextValueAsInt();
    }
View Full Code Here

     *            The count of frames to retrieve (-1 means all remaining).
     * @return ReplyPacket for corresponding command
     */
    public final ReplyPacket getThreadFrames(long threadID, int startIndex,
            int length) {
        CommandPacket command = new CommandPacket(
                JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
                JDWPCommands.ThreadReferenceCommandSet.FramesCommand);
        command.setNextValueAsThreadID(threadID);
        command.setNextValueAsInt(startIndex); // start frame's index
        command.setNextValueAsInt(length); // get all remaining frames;
        return checkReply(performCommand(command));
    }
View Full Code Here

     *            The method ID
     * @return A list containing all variables (arguments and locals) declared
     *         within the method.
     */
    public final List getVariableTable(long classID, long methodID) {
        CommandPacket command = new CommandPacket(
                JDWPCommands.MethodCommandSet.CommandSetID,
                JDWPCommands.MethodCommandSet.VariableTableCommand);
        command.setNextValueAsReferenceTypeID(classID);
        command.setNextValueAsMethodID(methodID);
        // ReplyPacket reply =
        // debuggeeWrapper.vmMirror.checkReply(debuggeeWrapper.vmMirror.performCommand(command));
        ReplyPacket reply = performCommand(command);
        if (reply.getErrorCode() == JDWPConstants.Error.ABSENT_INFORMATION
                || reply.getErrorCode() == JDWPConstants.Error.NATIVE_METHOD) {
View Full Code Here

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

     *            The class ID whose superclass ID is to get
     * @return The superclass ID (null if the class ID for java.lang.Object is
     *         specified).
     */
    public final long getSuperclassId(long classID) {
        CommandPacket command = new CommandPacket(
                JDWPCommands.ClassTypeCommandSet.CommandSetID,
                JDWPCommands.ClassTypeCommandSet.SuperclassCommand);
        command.setNextValueAsClassID(classID);
        ReplyPacket reply = checkReply(performCommand(command));
        return reply.getNextValueAsClassID();
    }
View Full Code Here

     * @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();
    }
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.