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

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


        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

        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

     */
    public void testListenConnector() {

        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);

        CommandPacket packet = new CommandPacket(
                JDWPCommands.VirtualMachineCommandSet.CommandSetID,
                JDWPCommands.VirtualMachineCommandSet.VersionCommand);

        ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
        checkReplyPacket(reply, "VirtualMachine::Version command");
View Full Code Here

     * there are no extra data in the reply packet;
     */
    public void testCapabilities001() {
        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);

        CommandPacket packet = new CommandPacket(
                JDWPCommands.VirtualMachineCommandSet.CommandSetID,
                JDWPCommands.VirtualMachineCommandSet.CapabilitiesCommand);
        logWriter.println("\trequest capabilities");
       
        ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
View Full Code Here

        logWriter.println("==> testedThreadID = " + testedThreadID);
        logWriter.println("==> suspend testedThread...");
        debuggeeWrapper.vmMirror.suspendThread(testedThreadID);

        // getting the thread group ID
        CommandPacket packet = new CommandPacket(
                JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
                JDWPCommands.ThreadReferenceCommandSet.CurrentContendedMonitorCommand);
        packet.setNextValueAsThreadID(testedThreadID);
        logWriter.println("send \"CurrentContendedMonitor\" command");
        ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
        checkReplyPacket(reply, "ThreadReference::CurrentContendedMonitor command");
       
        TaggedObject tobj = reply.getNextValueAsTaggedObject();
       
        logWriter.println("\ttagged-object tag: "
                + JDWPConstants.Tag.getName(tobj.tag) + "(" + tobj.tag + ") "
                + "ID: " + tobj.objectID);
       
        packet = new CommandPacket(
                JDWPCommands.ObjectReferenceCommandSet.CommandSetID,
                JDWPCommands.ObjectReferenceCommandSet.MonitorInfoCommand);
        packet.setNextValueAsObjectID(tobj.objectID);
        ReplyPacket replyObj = debuggeeWrapper.vmMirror.performCommand(packet);
        checkReplyPacket(replyObj, "ObjectReference::MonitorInfo command");
       
        replyObj.getNextValueAsThreadID();
        replyObj.getNextValueAsInt();
        int waiters = replyObj.getNextValueAsInt();
        long waiterID;
        String waiterName;
        for (int i = 0; i < waiters; i++) {
            waiterID = replyObj.getNextValueAsThreadID();
            waiterName = debuggeeWrapper.vmMirror.getThreadName(waiterID);
            logWriter.println("\twaiter: "
                    + " " + waiterName
                    + "(" + waiterID + ")");
            if (waiterID != testedThreadID) {
                logWriter.printError("wrong owner: " + waiterID);
                assertEquals("ObjectReference::MonitorInfo returned wrong owner ID,",
                        testedThreadID, waiterID);
            }
            assertString("ObjectReference::MonitorInfo  returned invalid waiter name,",
                    OwnedMonitorsDebuggee.TESTED_THREAD, waiterName);
        }

        // interrupt
        packet = new CommandPacket(
                JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
                JDWPCommands.ThreadReferenceCommandSet.InterruptCommand);
        packet.setNextValueAsThreadID(testedThreadID);
        logWriter.println("send \"Interrupt\" command");
        reply = debuggeeWrapper.vmMirror.performCommand(packet);
        checkReplyPacket(reply, "ThreadReference::Interrupt command");
       
        short err = reply.getErrorCode();
View Full Code Here

        logWriter.println("==> testedThreadID = " + testedThreadID);
        logWriter.println("==> suspend testedThread...");
        debuggeeWrapper.vmMirror.suspendThread(testedThreadID);

        // getting the thread group ID
        CommandPacket packet = new CommandPacket(
                JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
                JDWPCommands.ThreadReferenceCommandSet.OwnedMonitorsCommand);
        packet.setNextValueAsThreadID(testedThreadID);
        ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
        checkReplyPacket(reply, "ThreadReference::OwnedMonitors command");
       
        int owned = reply.getNextValueAsInt();
        logWriter.println("owned monitors: " + owned);

        String ownerName;
        long ownerThread;

        for (int i =0; i < owned; i++) {
            TaggedObject tobj = reply.getNextValueAsTaggedObject();

            logWriter.println("\t" + i + " tagged-object tag: "
                    + JDWPConstants.Tag.getName(tobj.tag) + "(" + tobj.tag + ") "
                    + "ID: " + tobj.objectID);
           
            packet = new CommandPacket(
                    JDWPCommands.ObjectReferenceCommandSet.CommandSetID,
                    JDWPCommands.ObjectReferenceCommandSet.MonitorInfoCommand);
            packet.setNextValueAsObjectID(tobj.objectID);
            ReplyPacket replyObj = debuggeeWrapper.vmMirror.performCommand(packet);
            checkReplyPacket(replyObj, "ObjectReference::MonitorInfo command");
           
            ownerThread = replyObj.getNextValueAsThreadID();
            logWriter.println("\t\t" + "ownerThread ID:   " + ownerThread);
View Full Code Here

        synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
        logWriter.println("waiting for finishing thread");
        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;
        ReplyPacket replyName;

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

        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

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.