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

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


     */
    public void testAllThreads002() {
        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);

        logWriter.println("send AllThreads cmd");
        CommandPacket packet = new CommandPacket(
                JDWPCommands.VirtualMachineCommandSet.CommandSetID,
                JDWPCommands.VirtualMachineCommandSet.AllThreadsCommand);
       
        ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
        checkReplyPacket(reply, "VirtualMachine::AllThreads command");

        long threadID;
        int threadStatus, suspendStatus;
        String threadName;
        int count = 0;
        ReplyPacket replyName;

        int threads = reply.getNextValueAsInt();
        logWriter.println("Number of threads = " + threads);
        assertTrue("Number of threads must be > 0", threads > 0);

        boolean threadStatusFailed = false;
        for (int i = 0; i < threads; i++) {

            threadID = reply.getNextValueAsThreadID();
            threadName = debuggeeWrapper.vmMirror.getThreadName(threadID);

            packet = new CommandPacket(
                    JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
                    JDWPCommands.ThreadReferenceCommandSet.StatusCommand);
            packet.setNextValueAsReferenceTypeID(threadID);
                       
            replyName = debuggeeWrapper.vmMirror.performCommand(packet);
            checkReplyPacket(replyName, "ThreadReference::Status command");

            threadStatus = replyName.getNextValueAsInt();
View Full Code Here


     */
    public void testAllThreads001() {
        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);

        logWriter.println("send AllThreads cmd");
        CommandPacket packet = new CommandPacket(
                JDWPCommands.VirtualMachineCommandSet.CommandSetID,
                JDWPCommands.VirtualMachineCommandSet.AllThreadsCommand);
       
        ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
        checkReplyPacket(reply, "VirtualMachine::AllThreads command");
View Full Code Here

        synchronizer.receiveMessageWithoutException
        ("ThreadReference.Status006Test: testStatus007(#2)");

        logWriter.println
        ("=> Send ThreadReference.Status command for checked Thread and check reply...");
        CommandPacket checkedCommand = new CommandPacket(
                JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
                JDWPCommands.ThreadReferenceCommandSet.StatusCommand);
        checkedCommand.setNextValueAsThreadID(checkedThreadID);
       
        ReplyPacket checkedReply = debuggeeWrapper.vmMirror.performCommand(checkedCommand);
        checkReplyPacket(checkedReply, "ThreadReference.Status command");
       
        int threadStatus = checkedReply.getNextValueAsInt();
View Full Code Here

        int methodEntryRequestID = reply.getNextValueAsInt();
        logWriter.println("=> METHOD_ENTRY requestID = " + methodEntryRequestID);

        logWriter.println("=> Set request for SINGLE_STEP event in class "
                + debuggeeSignature);
        CommandPacket setRequestCommand = new CommandPacket(
                JDWPCommands.EventRequestCommandSet.CommandSetID,
                JDWPCommands.EventRequestCommandSet.SetCommand);
        setRequestCommand
                .setNextValueAsByte(JDWPConstants.EventKind.SINGLE_STEP);
        setRequestCommand.setNextValueAsByte(JDWPConstants.SuspendPolicy.ALL);
        setRequestCommand.setNextValueAsInt(2);
        setRequestCommand.setNextValueAsByte(EventMod.ModKind.Step);
        setRequestCommand.setNextValueAsThreadID(threadID);
        setRequestCommand.setNextValueAsInt(JDWPConstants.StepSize.MIN);
        setRequestCommand.setNextValueAsInt(JDWPConstants.StepDepth.INTO);
        setRequestCommand.setNextValueAsByte(EventMod.ModKind.ClassOnly);
        setRequestCommand.setNextValueAsReferenceTypeID(debuggeeClassID);

        ReplyPacket setRequestReply = debuggeeWrapper.vmMirror
                .performCommand(setRequestCommand);
        checkReplyPacket(setRequestReply, "EventRequest::Set command");
        int stepRequestID = setRequestReply.getNextValueAsInt();
View Full Code Here

        int methodExitRequestID = reply.getNextValueAsInt();
        logWriter.println("=> METHOD_EXIT requestID = " + methodExitRequestID);

        logWriter.println("=> Set request for SINGLE_STEP event in class "
                + debuggeeSignature);
        CommandPacket setRequestCommand = new CommandPacket(
                JDWPCommands.EventRequestCommandSet.CommandSetID,
                JDWPCommands.EventRequestCommandSet.SetCommand);
        setRequestCommand
                .setNextValueAsByte(JDWPConstants.EventKind.SINGLE_STEP);
        setRequestCommand.setNextValueAsByte(JDWPConstants.SuspendPolicy.ALL);
        setRequestCommand.setNextValueAsInt(2);
        setRequestCommand.setNextValueAsByte(EventMod.ModKind.Step);
        setRequestCommand.setNextValueAsThreadID(threadID);
        setRequestCommand.setNextValueAsInt(JDWPConstants.StepSize.MIN);
        setRequestCommand.setNextValueAsInt(JDWPConstants.StepDepth.INTO);
        setRequestCommand.setNextValueAsByte(EventMod.ModKind.ClassOnly);
        setRequestCommand.setNextValueAsReferenceTypeID(debuggeeClassID);

        ReplyPacket setRequestReply = debuggeeWrapper.vmMirror
                .performCommand(setRequestCommand);
        checkReplyPacket(setRequestReply, "EventRequest::Set command");
        int stepRequestID = setRequestReply.getNextValueAsInt();
View Full Code Here

        int methodEntryRequestID = reply.getNextValueAsInt();
        logWriter.println("=> METHOD_ENTRY requestID = " + methodEntryRequestID);

        logWriter.println("=> Set request for SINGLE_STEP event in class "
                + debuggeeSignature);
        CommandPacket setRequestCommand = new CommandPacket(
                JDWPCommands.EventRequestCommandSet.CommandSetID,
                JDWPCommands.EventRequestCommandSet.SetCommand);
        setRequestCommand
                .setNextValueAsByte(JDWPConstants.EventKind.SINGLE_STEP);
        setRequestCommand.setNextValueAsByte(JDWPConstants.SuspendPolicy.ALL);
        setRequestCommand.setNextValueAsInt(2);
        setRequestCommand.setNextValueAsByte(EventMod.ModKind.Step);
        setRequestCommand.setNextValueAsThreadID(threadID);
        setRequestCommand.setNextValueAsInt(JDWPConstants.StepSize.MIN);
        setRequestCommand.setNextValueAsInt(JDWPConstants.StepDepth.INTO);
        setRequestCommand.setNextValueAsByte(EventMod.ModKind.ClassOnly);
        setRequestCommand.setNextValueAsReferenceTypeID(debuggeeClassID);

        ReplyPacket setRequestReply = debuggeeWrapper.vmMirror
                .performCommand(setRequestCommand);
        checkReplyPacket(setRequestReply, "EventRequest::Set command");
        int stepRequestID = setRequestReply.getNextValueAsInt();
View Full Code Here

        int methodExitRequestID = reply.getNextValueAsInt();
        logWriter.println("=> METHOD_EXIT requestID = " + methodExitRequestID);

        logWriter.println("=> Set request for SINGLE_STEP event in class "
                + debuggeeSignature);
        CommandPacket setRequestCommand = new CommandPacket(
                JDWPCommands.EventRequestCommandSet.CommandSetID,
                JDWPCommands.EventRequestCommandSet.SetCommand);
        setRequestCommand
                .setNextValueAsByte(JDWPConstants.EventKind.SINGLE_STEP);
        setRequestCommand.setNextValueAsByte(JDWPConstants.SuspendPolicy.ALL);
        setRequestCommand.setNextValueAsInt(2);
        setRequestCommand.setNextValueAsByte(EventMod.ModKind.Step);
        setRequestCommand.setNextValueAsThreadID(threadID);
        setRequestCommand.setNextValueAsInt(JDWPConstants.StepSize.MIN);
        setRequestCommand.setNextValueAsInt(JDWPConstants.StepDepth.INTO);
        setRequestCommand.setNextValueAsByte(EventMod.ModKind.ClassOnly);
        setRequestCommand.setNextValueAsReferenceTypeID(debuggeeClassID);

        ReplyPacket setRequestReply = debuggeeWrapper.vmMirror
                .performCommand(setRequestCommand);
        checkReplyPacket(setRequestReply, "EventRequest::Set command");
        int stepRequestID = setRequestReply.getNextValueAsInt();
View Full Code Here

            ("## printMethodLineTable(): Can NOT get methodID for classID = "
                    + classID + "; Method name = " + methodName);
            return;
        }
       
        CommandPacket packet = new CommandPacket(
                JDWPCommands.MethodCommandSet.CommandSetID,
                JDWPCommands.MethodCommandSet.LineTableCommand);
        packet.setNextValueAsClassID(classID);
        packet.setNextValueAsMethodID(methodID);
        ReplyPacket lineTableReply = debuggeeWrapper.vmMirror.performCommand(packet);
        if ( ! checkReplyPacketWithoutFail(lineTableReply,  "printMethodLineTable(): Method.LineTable command") ) {
            return;
        }
        if ( className == null ) {
View Full Code Here

            ("## getMethodStartCodeIndex(): Can NOT get methodID for classID = "
                    + classID + "; Method name = " + methodName);
            return -1;
        }
       
        CommandPacket packet = new CommandPacket(
                JDWPCommands.MethodCommandSet.CommandSetID,
                JDWPCommands.MethodCommandSet.LineTableCommand);
        packet.setNextValueAsClassID(classID);
        packet.setNextValueAsMethodID(methodID);
        ReplyPacket lineTableReply = debuggeeWrapper.vmMirror.performCommand(packet);
        if ( ! checkReplyPacketWithoutFail
                (lineTableReply,  "getMethodStartCodeIndex(): Method.LineTable command") ) {
            return -1;
        }
View Full Code Here

            ("## getMethodEndCodeIndex(): Can NOT get methodID for classID = "
                    + classID + "; Method name = " + methodName);
            return -1;
        }
       
        CommandPacket packet = new CommandPacket(
                JDWPCommands.MethodCommandSet.CommandSetID,
                JDWPCommands.MethodCommandSet.LineTableCommand);
        packet.setNextValueAsClassID(classID);
        packet.setNextValueAsMethodID(methodID);
        ReplyPacket lineTableReply = debuggeeWrapper.vmMirror.performCommand(packet);
        if ( ! checkReplyPacketWithoutFail
                (lineTableReply,  "getMethodEndCodeIndex(): Method.LineTable command") ) {
            return -1;
        }
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.