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

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


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


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

     *
     * @return received reply packet
     */
    public ReplyPacket getAllThreadID() {
        // Create new command packet
        CommandPacket commandPacket = new CommandPacket(
                JDWPCommands.VirtualMachineCommandSet.CommandSetID,
                JDWPCommands.VirtualMachineCommandSet.AllThreadsCommand);

        return checkReply(performCommand(commandPacket));
    }
View Full Code Here

     *            class ID
     * @return received class signature
     */
    public String getClassSignature(long classID) {
        // Create new command packet
        CommandPacket commandPacket = new CommandPacket(
                JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
                JDWPCommands.ReferenceTypeCommandSet.SignatureCommand);
        commandPacket.setNextValueAsReferenceTypeID(classID);
        ReplyPacket replyPacket = checkReply(performCommand(commandPacket));
        return replyPacket.getNextValueAsString();
    }
View Full Code Here

     *            thread ID
     * @return thread name
     */
    public String getThreadName(long threadID) {
        // Create new command packet
        CommandPacket commandPacket = new CommandPacket(
                JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
                JDWPCommands.ThreadReferenceCommandSet.NameCommand);
        commandPacket.setNextValueAsThreadID(threadID);
        ReplyPacket replyPacket = checkReply(performCommand(commandPacket));
        return replyPacket.getNextValueAsString();
    }
View Full Code Here

     * @param threadID
     *            thread ID
     * @return thread status
     */
    public int getThreadStatus(long threadID) {
        CommandPacket commandPacket = new CommandPacket(
                JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
                JDWPCommands.ThreadReferenceCommandSet.StatusCommand);
        commandPacket.setNextValueAsThreadID(threadID);
        ReplyPacket replyPacket = checkReply(performCommand(commandPacket));
        return replyPacket.getNextValueAsInt();
    }
View Full Code Here

     *
     * @return name of thread group
     */
    public String getThreadGroupName(long groupID) {
        // Create new command packet
        CommandPacket commandPacket = new CommandPacket(
                JDWPCommands.ThreadGroupReferenceCommandSet.CommandSetID,
                JDWPCommands.ThreadGroupReferenceCommandSet.NameCommand);
        commandPacket.setNextValueAsReferenceTypeID(groupID);
        ReplyPacket replyPacket = checkReply(performCommand(commandPacket));
        return replyPacket.getNextValueAsString();
    }
View Full Code Here

     * @param classID
     * @param methodID
     * @return method name
     */
    public String getMethodName(long classID, long methodID) {
        CommandPacket packet = new CommandPacket(
                JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
                JDWPCommands.ReferenceTypeCommandSet.MethodsCommand);
        packet.setNextValueAsReferenceTypeID(classID);
        ReplyPacket reply = performCommand(packet);

        int declared = reply.getNextValueAsInt();
        long mID;
        String value = null;
View Full Code Here

    }

    private Location getTopFrameLocation(long threadID) {

        // 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);
        debuggeeWrapper.vmMirror.checkReply(reply);

        // assert that only one top frame is returned
        int framesCount = reply.getNextValueAsInt();
View Full Code Here

     *            event to set request for
     * @return ReplyPacket for setting request
     */
    public ReplyPacket setEvent(Event event) {
        // Create new command packet
        CommandPacket commandPacket = new CommandPacket(
                JDWPCommands.EventRequestCommandSet.CommandSetID,
                JDWPCommands.EventRequestCommandSet.SetCommand);

        // Set eventKind
        commandPacket.setNextValueAsByte(event.eventKind);
        // Set suspendPolicy
        commandPacket.setNextValueAsByte(event.suspendPolicy);

        // Set modifiers
        commandPacket.setNextValueAsInt(event.modifiers);

        for (int i = 0; i < event.modifiers; i++) {

            commandPacket.setNextValueAsByte(event.mods[i].modKind);

            switch (event.mods[i].modKind) {
            case EventMod.ModKind.Count: {
                // Case Count
                commandPacket.setNextValueAsInt(event.mods[i].count);
                break;
            }
            case EventMod.ModKind.Conditional: {
                // Case Conditional
                commandPacket.setNextValueAsInt(event.mods[i].exprID);
                break;
            }
            case EventMod.ModKind.ThreadOnly: {
                // Case ThreadOnly
                commandPacket.setNextValueAsThreadID(event.mods[i].thread);
                break;
            }
            case EventMod.ModKind.ClassOnly: {
                // Case ClassOnly
                commandPacket
                        .setNextValueAsReferenceTypeID(event.mods[i].clazz);
                break;
            }
            case EventMod.ModKind.ClassMatch: {
                // Case ClassMatch
                commandPacket.setNextValueAsString(event.mods[i].classPattern);
                break;
            }
            case EventMod.ModKind.ClassExclude: {
                // Case ClassExclude
                commandPacket.setNextValueAsString(event.mods[i].classPattern);
                break;
            }
            case EventMod.ModKind.LocationOnly: {
                // Case LocationOnly
                commandPacket.setNextValueAsLocation(event.mods[i].loc);
                break;
            }
            case EventMod.ModKind.ExceptionOnly:
                // Case ExceptionOnly
                commandPacket
                        .setNextValueAsReferenceTypeID(event.mods[i].exceptionOrNull);
                commandPacket.setNextValueAsBoolean(event.mods[i].caught);
                commandPacket.setNextValueAsBoolean(event.mods[i].uncaught);
                break;
            case EventMod.ModKind.FieldOnly: {
                // Case FieldOnly
                commandPacket
                        .setNextValueAsReferenceTypeID(event.mods[i].declaring);
                commandPacket.setNextValueAsFieldID(event.mods[i].fieldID);
                break;
            }
            case EventMod.ModKind.Step: {
                // Case Step
                commandPacket.setNextValueAsThreadID(event.mods[i].thread);
                commandPacket.setNextValueAsInt(event.mods[i].size);
                commandPacket.setNextValueAsInt(event.mods[i].depth);
                break;
            }
            case EventMod.ModKind.InstanceOnly: {
                // Case InstanceOnly
                commandPacket.setNextValueAsObjectID(event.mods[i].instance);
                break;
            }
            }
        }

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.