当前位置: 首页>>代码示例>>Java>>正文


Java ReplyPacket.getNextValueAsLong方法代码示例

本文整理汇总了Java中org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket.getNextValueAsLong方法的典型用法代码示例。如果您正苦于以下问题:Java ReplyPacket.getNextValueAsLong方法的具体用法?Java ReplyPacket.getNextValueAsLong怎么用?Java ReplyPacket.getNextValueAsLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket的用法示例。


在下文中一共展示了ReplyPacket.getNextValueAsLong方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLineNumber

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * Returns a source line number according to a corresponding line code index
 * in a method's line table.
 * 
 * @param classID
 *            The class object ID.
 * @param methodID
 *            The method ID.
 * @param codeIndex
 *            The line code index.
 * @return An integer line number.
 */
public final int getLineNumber(long classID, long methodID, long codeIndex) {
    int lineNumber = -1;
    ReplyPacket reply = getLineTable(classID, methodID);
    if (reply.getErrorCode() != JDWPConstants.Error.NONE) {
        return lineNumber;
    }

    reply.getNextValueAsLong(); // start line index, is not used
    reply.getNextValueAsLong(); // end line index, is not used
    int lines = reply.getNextValueAsInt();
    for (int i = 0; i < lines; i++) {
        long lineCodeIndex = reply.getNextValueAsLong();
        lineNumber = reply.getNextValueAsInt();
        if (lineCodeIndex == codeIndex) {
            break;
        }

        if (lineCodeIndex > codeIndex) {
            --lineNumber;
            break;
        }
    }

    return lineNumber;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:38,代码来源:VmMirror.java

示例2: getLineCodeIndex

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * Returns a line code index according to a corresponding line number in a
 * method's line table.
 * 
 * @param classID
 *            The class object ID.
 * @param methodID
 *            The method ID.
 * @param lineNumber
 *            A source line number.
 * @return An integer representing the line code index.
 */
public final long getLineCodeIndex(long classID, long methodID,
        int lineNumber) {
    ReplyPacket reply = getLineTable(classID, methodID);
    if (reply.getErrorCode() != JDWPConstants.Error.NONE) {
        return -1L;
    }

    reply.getNextValueAsLong(); // start line index, is not used
    reply.getNextValueAsLong(); // end line index, is not used
    int lines = reply.getNextValueAsInt();
    for (int i = 0; i < lines; i++) {
        long lineCodeIndex = reply.getNextValueAsLong();
        if (lineNumber == reply.getNextValueAsInt()) {
            return lineCodeIndex;
        }
    }

    return -1L;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:32,代码来源:VmMirror.java

示例3: jdwpGetFrames

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
protected FrameInfo[] jdwpGetFrames(long threadID, int startFrame, int length) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
            JDWPCommands.ThreadReferenceCommandSet.FramesCommand);
    packet.setNextValueAsThreadID(threadID);
    packet.setNextValueAsInt(startFrame);
    packet.setNextValueAsInt(length);
    
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "ThreadReference::FramesCommand command");
           
    int frames = reply.getNextValueAsInt();
    FrameInfo[] frameInfos = new FrameInfo[frames];
    for (int i = 0; i < frames; i++) {
        long frameID = reply.getNextValueAsLong();
        Location location = reply.getNextValueAsLocation();
        frameInfos[i] = new FrameInfo(frameID, location);
    }
    return frameInfos;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:21,代码来源:JDWPStackFrameTestCase.java

示例4: jdwpGetVariableTable

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
protected VarInfo[] jdwpGetVariableTable(long classID, long methodID) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.MethodCommandSet.CommandSetID,
            JDWPCommands.MethodCommandSet.VariableTableCommand);
    packet.setNextValueAsClassID(classID);
    packet.setNextValueAsMethodID(methodID);

    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "Method::VariableTable command");
    
    reply.getNextValueAsInt();
    int varNumber = reply.getNextValueAsInt();
    
    VarInfo[] varInfos = new VarInfo[varNumber];
    for (int i = 0; i < varNumber; i++) {
        reply.getNextValueAsLong();
        String name = reply.getNextValueAsString();
        String sign = reply.getNextValueAsString();
        reply.getNextValueAsInt();

        int slot = reply.getNextValueAsInt();
        varInfos[i] = new VarInfo(name, slot, sign);
    }
    return varInfos;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:26,代码来源:JDWPStackFrameTestCase.java

示例5: jdwpGetAllThreads

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
protected long[] jdwpGetAllThreads() {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.VirtualMachineCommandSet.CommandSetID,
            JDWPCommands.VirtualMachineCommandSet.AllThreadsCommand);
    
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "VirtualMachine::AllThreads command");
    
    int frames = reply.getNextValueAsInt();
    
    long[] frameIDs = new long[frames]; 
    for (int i = 0; i < frames; i++) {
        frameIDs[i] = reply.getNextValueAsLong();
    }
    
    return frameIDs;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:18,代码来源:JDWPStackFrameTestCase.java

示例6: jdwpGetFrames

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
protected FrameInfo[] jdwpGetFrames(long threadID, int startFrame, int length) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
            JDWPCommands.ThreadReferenceCommandSet.FramesCommand);
    packet.setNextValueAsThreadID(threadID);
    packet.setNextValueAsInt(startFrame);
    packet.setNextValueAsInt(length);
    
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    if (!checkReplyPacketWithoutFail(reply, "ThreadReference::FramesCommand command")) {
        throw new TestErrorException("Error during performing ThreadReference::Frames command");
    }
           
    int frames = reply.getNextValueAsInt();
    FrameInfo[] frameInfos = new FrameInfo[frames];
    for (int i = 0; i < frames; i++) {
        long frameID = reply.getNextValueAsLong();
        Location location = reply.getNextValueAsLocation();
        frameInfos[i] = new FrameInfo(frameID, location);
    }
    return frameInfos;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:23,代码来源:LaunchedDebugger.java

示例7: getMethodStartCodeIndex

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
long getMethodStartCodeIndex(long classID, String methodName) {
    long methodID = debuggeeWrapper.vmMirror.getMethodID(classID, methodName);
    if ( methodID == -1 ) {
        logWriter.println
        ("## 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;
    }
    long methodStartCodeIndex = lineTableReply.getNextValueAsLong();
    return methodStartCodeIndex;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:23,代码来源:CombinedEventsTestCase.java

示例8: getMethodEndCodeIndex

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
@SuppressWarnings("unused")
long getMethodEndCodeIndex(long classID, String methodName) {
    long methodID = debuggeeWrapper.vmMirror.getMethodID(classID, methodName);
    if ( methodID == -1 ) {
        logWriter.println
        ("## 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;
    }
    long methodStartCodeIndex = lineTableReply.getNextValueAsLong();
    long methodEndCodeIndex = lineTableReply.getNextValueAsLong();
    return methodEndCodeIndex;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:25,代码来源:CombinedEventsTestCase.java

示例9: getMethodFirstCodeIndex

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
private long getMethodFirstCodeIndex(long classId, long breakpointMethodId) {
  ReplyPacket replyPacket = getMirror().getLineTable(classId, breakpointMethodId);
  checkReplyPacket(replyPacket, "Failed to get method line table");
  replyPacket.getNextValueAsLong(); // start
  replyPacket.getNextValueAsLong(); // end
  int linesCount = replyPacket.getNextValueAsInt();
  if (linesCount == 0) {
    return -1;
  } else {
    // Read only the 1st line because code indices are in ascending order
    return replyPacket.getNextValueAsLong();
  }
}
 
开发者ID:inferjay,项目名称:r8,代码行数:14,代码来源:DebugTestBase.java

示例10: setBreakpointAtMethodBegin

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * Sets breakpoint at the beginning of method with name <i>methodName</i>.
 * 
 * @param classID
 *            id of class with required method
 * @param methodName
 *            name of required method
 * @return requestID id of request
 */
public long setBreakpointAtMethodBegin(long classID, String methodName) {
    long requestID;

    long methodID = getMethodID(classID, methodName);

    ReplyPacket lineTableReply = getLineTable(classID, methodID);
    if (lineTableReply.getErrorCode() != JDWPConstants.Error.NONE) {
        throw new TestErrorException(
                "Command getLineTable returned error code: "
                        + lineTableReply.getErrorCode()
                        + " - "
                        + JDWPConstants.Error.getName(lineTableReply
                                .getErrorCode()));
    }

    lineTableReply.getNextValueAsLong();
    // Lowest valid code index for the method

    lineTableReply.getNextValueAsLong();
    // Highest valid code index for the method

    // int numberOfLines =
    lineTableReply.getNextValueAsInt();

    long lineCodeIndex = lineTableReply.getNextValueAsLong();

    // set breakpoint inside checked method
    Location breakpointLocation = new Location(JDWPConstants.TypeTag.CLASS,
            classID, methodID, lineCodeIndex);

    ReplyPacket reply = setBreakpoint(breakpointLocation);
    checkReply(reply);

    requestID = reply.getNextValueAsInt();

    return requestID;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:47,代码来源:VmMirror.java

示例11: getReferenceType

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * Returns the runtime type of the object
 * 
 * @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();
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:VmMirror.java

示例12: testLineTableTest001

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * This testcase exercises Method.LineTable command.
 * <BR>It runs MethodDebuggee, receives methods of debuggee. 
 * For each received method sends Method.LineTable command
 * and prints returned LineTable.
 */
public void testLineTableTest001() throws UnsupportedEncodingException {
    logWriter.println("testLineTableTest001 started");
    synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);

    long classID = getClassIDBySignature("L"+getDebuggeeClassName().replace('.', '/')+";");

    MethodInfo[] methodsInfo = jdwpGetMethodsInfo(classID);
    assertFalse("Invalid number of methods: 0", methodsInfo.length == 0);

    for (int i = 0; i < methodsInfo.length; i++) {
        logWriter.println(methodsInfo[i].toString());

        // get variable table for this class
        ReplyPacket reply = getLineTable(classID, methodsInfo[i].getMethodID());

        long start = reply.getNextValueAsLong();
        logWriter.println("start = " + start);
        long end = reply.getNextValueAsLong();
        logWriter.println("end = " + end);

        int lines = reply.getNextValueAsInt();
        logWriter.println("lines = "+lines);

        for (int j = 0; j < lines; j++) {
            long lineCodeIndex = reply.getNextValueAsLong();
            logWriter.println("lineCodeIndex = "+lineCodeIndex);
            int lineNumber = reply.getNextValueAsInt();
            logWriter.println("lineNumber = "+lineNumber);
        }
    }

    synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:40,代码来源:LineTableTest.java

示例13: printMethodLineTable

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
void printMethodLineTable(long classID, String className /* may be null */, String methodName) {
    long methodID = debuggeeWrapper.vmMirror.getMethodID(classID, methodName);
    if ( methodID == -1 ) {
        logWriter.println
        ("## 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 ) {
        logWriter.println("=== Line Table for method: " + methodName + " ===");
    } else {
        logWriter.println("=== Line Table for method: " + methodName + " of class: " 
                + className + " ===");
    }
    long methodStartCodeIndex = lineTableReply.getNextValueAsLong();
    logWriter.println("==> Method Start Code Index = " + methodStartCodeIndex);
    long methodEndCodeIndex = lineTableReply.getNextValueAsLong();
    logWriter.println("==> Method End Code Index = " + methodEndCodeIndex);
    
    int linesNumber = lineTableReply.getNextValueAsInt();
    logWriter.println("==> Number of lines = " + linesNumber);
    for (int i=0; i < linesNumber; i++) {
        long lineCodeIndex = lineTableReply.getNextValueAsLong();
        int lineNumber = lineTableReply.getNextValueAsInt();
        logWriter.println("====> Line Number " + lineNumber + " : Initial code index = " + lineCodeIndex);
    }
    logWriter.println("=== End of Line Table " + methodName + " ===");
}
 
开发者ID:shannah,项目名称:cn1,代码行数:39,代码来源:CombinedEventsTestCase.java

示例14: getMethodEntryLocation

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
protected Location getMethodEntryLocation(long classID, String methodName) {
    long methodID = debuggeeWrapper.vmMirror.getMethodID(classID, methodName);
    if ( methodID == -1 ) {
        logWriter.println
        ("## 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;
    }
    long methodStartCodeIndex = reply.getNextValueAsLong();
    Location location = new Location();
    location.tag = JDWPConstants.TypeTag.CLASS;
    location.classID =  classID;
    location.methodID = methodID;
    location.index = methodStartCodeIndex;
    return location;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:28,代码来源:CombinedEventsTestCase.java

示例15: getMethodEndLocation

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
@SuppressWarnings("unused")
protected Location getMethodEndLocation(long classID, String methodName) {
    long methodID = debuggeeWrapper.vmMirror.getMethodID(classID, methodName);
    if ( methodID == -1 ) {
        logWriter.println
        ("## 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;
    }
    long methodStartCodeIndex = reply.getNextValueAsLong();
    long methodEndCodeIndex = reply.getNextValueAsLong();
    Location location = new Location();
    location.tag = JDWPConstants.TypeTag.CLASS;
    location.classID =  classID;
    location.methodID = methodID;
    location.index = methodEndCodeIndex;
    return location;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:30,代码来源:CombinedEventsTestCase.java


注:本文中的org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket.getNextValueAsLong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。