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


Java ReplyPacket.getNextValueAsMethodID方法代码示例

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


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

示例1: isSyntheticMethod

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
private static boolean isSyntheticMethod(VmMirror mirror, Location location) {
  // We must gather the modifiers of the method. This is only possible using
  // ReferenceType.Methods command which gather information about all methods in a class.
  ReplyPacket reply = mirror.getMethods(location.classID);
  int methodsCount = reply.getNextValueAsInt();
  for (int i = 0; i < methodsCount; ++i) {
    long methodId = reply.getNextValueAsMethodID();
    reply.getNextValueAsString();  // skip method name
    reply.getNextValueAsString();  // skip method signature
    int modifiers = reply.getNextValueAsInt();
    if (methodId == location.methodID &&
        ((modifiers & SYNTHETIC_FLAG) != 0)) {
      return true;
    }
  }
  return false;
}
 
开发者ID:inferjay,项目名称:r8,代码行数:18,代码来源:DebugTestBase.java

示例2: getMethodName

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * Returns method name for specified pair of classID and methodID.
 * 
 * @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;
    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;
        }
    }
    return value;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:31,代码来源:VmMirror.java

示例3: getMethodSignature

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * Returns JNI signature of method.
 * 
 * @param classID
 *            The reference type ID.
 * @param methodID
 *            The method ID.
 * @return JNI signature of method.
 */
public final String getMethodSignature(long classID, long methodID) {
    CommandPacket command = new CommandPacket(
            JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
            JDWPCommands.ReferenceTypeCommandSet.MethodsCommand);
    command.setNextValueAsReferenceTypeID(classID);
    ReplyPacket reply = checkReply(performCommand(command));
    int methods = reply.getNextValueAsInt();
    String value = null;
    for (int i = 0; i < methods; i++) {
        long mID = reply.getNextValueAsMethodID();
        reply.getNextValueAsString(); // name of the method; is not used
        String methodSign = reply.getNextValueAsString();
        reply.getNextValueAsInt();
        if (mID == methodID) {
            value = methodSign;
            value = value.replaceAll("/", ".");
            int lastRoundBracketIndex = value.lastIndexOf(")");
            value = value.substring(0, lastRoundBracketIndex + 1);
            break;
        }
    }

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

示例4: jdwpGetMethodsInfo

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
protected MethodInfo[] jdwpGetMethodsInfo(long classID) {
    
    CommandPacket packet = new CommandPacket(
            JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
            JDWPCommands.ReferenceTypeCommandSet.MethodsCommand);
    packet.setNextValueAsClassID(classID);
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);

    assertTrue(reply.getErrorCode() == JDWPConstants.Error.NONE);
    int declared = reply.getNextValueAsInt();
    
    MethodInfo[] methodsInfo = new MethodInfo[declared];
    for (int i = 0; i < declared; i++) {
        methodsInfo[i] = new MethodInfo(
            reply.getNextValueAsMethodID(),
            reply.getNextValueAsString(),
            reply.getNextValueAsString(),
            reply.getNextValueAsInt()
        );
    }
    return methodsInfo;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:23,代码来源:JDWPMethodTestCase.java

示例5: getMethodID

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * Helper for getting method ID of corresponding class and method name.
 * 
 * @param classID -
 *            class ID
 * @param methodName -
 *            method name
 * @return method ID
 */
protected long getMethodID(long classID, String methodName) {
    CommandPacket command = new CommandPacket(
            JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
            JDWPCommands.ReferenceTypeCommandSet.MethodsCommand);
    command.setNextValueAsClassID(classID);
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(command);
    checkReplyPacket(reply, "ReferenceType::Methods command");
    int methods = reply.getNextValueAsInt();
    for (int i = 0; i < methods; i++) {
        long methodID = reply.getNextValueAsMethodID();
        String name = reply.getNextValueAsString(); // method name
        reply.getNextValueAsString(); // method signature
        reply.getNextValueAsInt(); // method modifiers
        if (name.equals(methodName)) {
            return methodID;
        }
    }
    return -1;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:29,代码来源:JDWPTestCase.java

示例6: getMethodName

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * Helper for getting method name of corresponding class and method ID.
 * 
 * @param classID class id
 * @param methodID method id
 * @return String
 */
protected String getMethodName(long classID, long methodID) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
            JDWPCommands.ReferenceTypeCommandSet.MethodsCommand);
    packet.setNextValueAsClassID(classID);
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "ReferenceType::Methods command");
    int methods = reply.getNextValueAsInt();
    for (int i = 0; i < methods; i++) {
        long mid = reply.getNextValueAsMethodID();
        String name = reply.getNextValueAsString();
        reply.getNextValueAsString();
        reply.getNextValueAsInt();
        if (mid == methodID) {
            return name;
        }
    }
    return "unknown";
}
 
开发者ID:shannah,项目名称:cn1,代码行数:27,代码来源:JDWPTestCase.java

示例7: getMethodName

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
protected String getMethodName(long classID, long methodID) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
            JDWPCommands.ReferenceTypeCommandSet.MethodsCommand);
    packet.setNextValueAsClassID(classID);
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    if (!checkReplyPacketWithoutFail(reply, "ReferenceType::Methods command")) {
        throw new TestErrorException("Error during performing ReferenceType::Method command");
    }
    int methods = reply.getNextValueAsInt();
    for (int i = 0; i < methods; i++) {
        long mid = reply.getNextValueAsMethodID();
        String name = reply.getNextValueAsString();
        reply.getNextValueAsString();
        reply.getNextValueAsInt();
        if (mid == methodID) {
            return name;
        }
    }
    return "unknown";
}
 
开发者ID:shannah,项目名称:cn1,代码行数:22,代码来源:LaunchedDebugger.java

示例8: getMethodID

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
 * Gets Method ID for specified class and method name.
 * 
 * @param classID
 *            class to find method
 * @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;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:39,代码来源:VmMirror.java


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