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

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


        // 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 fieldName
     *            field name
     * @return received FieldID
     */
    public long getFieldID(long classID, String fieldName) {
        ReplyPacket reply = getFieldsInClass(classID);
        return getFieldID(reply, fieldName);
    }
View Full Code Here

     * @param methodName
     *            method name
     * @return received MethodID
     */
    public long getMethodID(long classID, String methodName) {
        ReplyPacket reply;
        int declared = 0;
        String method = null;
        long methodID = -1;

        // Get Method reference ID
        reply = getMethods(classID);

        // Get methodID from received packet
        declared = reply.getNextValueAsInt();
        for (int i = 0; i < declared; i++) {
            methodID = reply.getNextValueAsMethodID();
            method = reply.getNextValueAsString();
            if (methodName.equals(method)) {
                // If this method name is the same as requested
                reply.getNextValueAsString();
                reply.getNextValueAsInt();
                break;
            } else {
                // If this method name is not the requested one
                reply.getNextValueAsString();
                reply.getNextValueAsInt();
                methodID = -1;
                method = null;
            }
        }
        return methodID;
View Full Code Here

    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;
        String methodName = "";
        for (int i = 0; i < declared; i++) {
            mID = reply.getNextValueAsMethodID();
            methodName = reply.getNextValueAsString();
            reply.getNextValueAsString();
            reply.getNextValueAsInt();
            if (mID == methodID) {
                value = methodName;
                break;
            }
        }
View Full Code Here

     * @return ReplyPacket if breakpoint is set
     * @throws ReplyErrorCodeException
     */
    public ReplyPacket setFieldAccess(String classSignature, byte classTypeTag,
            String fieldName) throws ReplyErrorCodeException {
        ReplyPacket request = null;
        long typeID = -1;
        long fieldID = -1;

        // Request referenceTypeID for class
        typeID = getClassID(classSignature);
View Full Code Here

     * @return ReplyPacket for corresponding command
     * @throws ReplyErrorCodeException
     */
    public ReplyPacket setFieldModification(String classSignature,
            byte classTypeTag, String fieldName) throws ReplyErrorCodeException {
        ReplyPacket request = null;
        long typeID = -1;
        long fieldID = -1;

        // Request referenceTypeID for class
        typeID = getClassID(classSignature);
View Full Code Here

     *            Command packet to be sent
     * @return received ReplyPacket
     */
    public ReplyPacket performCommand(CommandPacket command)
            throws TestErrorException {
        ReplyPacket replyPacket = null;
        try {
            replyPacket = packetDispatcher.performCommand(command);
        } catch (IOException e) {
            throw new TestErrorException(e);
        } catch (InterruptedException e) {
View Full Code Here

    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

    public final List getAllThreadFrames(long threadID) {
        if (!isThreadSuspended(threadID)) {
            return new ArrayList(0);
        }

        ReplyPacket reply = getThreadFrames(threadID, 0, -1);
        int framesCount = reply.getNextValueAsInt();
        if (framesCount == 0) {
            return new ArrayList(0);
        }

        ArrayList frames = new ArrayList(framesCount);
        for (int i = 0; i < framesCount; i++) {
            Frame frame = new Frame();
            frame.setThreadID(threadID);
            frame.setID(reply.getNextValueAsFrameID());
            frame.setLocation(reply.getNextValueAsLocation());
            frames.add(frame);
        }

        return frames;
    }
View Full Code Here

                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) {
            return null;
        }

        checkReply(reply);

        reply.getNextValueAsInt(); // argCnt, is not used
        int slots = reply.getNextValueAsInt();
        if (slots == 0) {
            return null;
        }

        ArrayList vars = new ArrayList(slots);
        for (int i = 0; i < slots; i++) {
            Variable var = new Frame().new Variable();
            var.setCodeIndex(reply.getNextValueAsLong());
            var.setName(reply.getNextValueAsString());
            var.setSignature(reply.getNextValueAsString());
            var.setLength(reply.getNextValueAsInt());
            var.setSlot(reply.getNextValueAsInt());
            vars.add(var);
        }

        return vars;
    }
View Full Code Here

TOP

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

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.