當前位置: 首頁>>代碼示例>>Java>>正文


Java CommandPacket.setNextValueAsByte方法代碼示例

本文整理匯總了Java中org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket.setNextValueAsByte方法的典型用法代碼示例。如果您正苦於以下問題:Java CommandPacket.setNextValueAsByte方法的具體用法?Java CommandPacket.setNextValueAsByte怎麽用?Java CommandPacket.setNextValueAsByte使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket的用法示例。


在下文中一共展示了CommandPacket.setNextValueAsByte方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: clearBreakpoint

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //導入方法依賴的package包/類
/**
 * Removes breakpoint according to specified requestID.
 * 
 * @param requestID
 *            for given breakpoint
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket clearBreakpoint(int requestID) {

    // Create new command packet
    CommandPacket commandPacket = new CommandPacket();

    // Set command. "2" - is ID of Clear command in EventRequest Command Set
    commandPacket
            .setCommand(JDWPCommands.EventRequestCommandSet.ClearCommand);

    // Set command set. "15" - is ID of EventRequest Command Set
    commandPacket
            .setCommandSet(JDWPCommands.EventRequestCommandSet.CommandSetID);

    // Set outgoing data
    // Set eventKind
    commandPacket.setNextValueAsByte(JDWPConstants.EventKind.BREAKPOINT);

    // Set suspendPolicy
    commandPacket.setNextValueAsInt(requestID);

    // Send packet
    return checkReply(performCommand(commandPacket));
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:31,代碼來源:VmMirror.java

示例2: clearEvent

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //導入方法依賴的package包/類
/**
 * Clear an event request for specified request ID.
 * 
 * @param eventKind
 *            event type to clear
 * @param requestID
 *            request ID to clear
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket clearEvent(byte eventKind, int requestID) {
    // Create new command packet
    CommandPacket commandPacket = new CommandPacket();

    // Set command. "2" - is ID of Clear command in EventRequest Command Set
    commandPacket
            .setCommand(JDWPCommands.EventRequestCommandSet.ClearCommand);

    // Set command set. "15" - is ID of EventRequest Command Set
    commandPacket
            .setCommandSet(JDWPCommands.EventRequestCommandSet.CommandSetID);

    // Set outgoing data
    // Set event type to clear
    commandPacket.setNextValueAsByte(eventKind);

    // Set ID of request to clear
    commandPacket.setNextValueAsInt(requestID);

    // Send packet
    return checkReply(performCommand(commandPacket));
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:32,代碼來源:VmMirror.java

示例3: getFrameValues

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //導入方法依賴的package包/類
/**
 * Returns values of local variables in a given frame
 * 
 * @param frame
 *            Frame whose variables to get
 * @return An array of Value objects
 */
public final Value[] getFrameValues(Frame frame) {
    CommandPacket command = new CommandPacket(
            JDWPCommands.StackFrameCommandSet.CommandSetID,
            JDWPCommands.StackFrameCommandSet.GetValuesCommand);
    command.setNextValueAsThreadID(frame.getThreadID());
    command.setNextValueAsFrameID(frame.getID());
    int slots = frame.getVars().size();
    command.setNextValueAsInt(slots);
    Iterator it = frame.getVars().iterator();
    while (it.hasNext()) {
        Frame.Variable var = (Frame.Variable) it.next();
        command.setNextValueAsInt(var.getSlot());
        command.setNextValueAsByte(var.getTag());
    }

    ReplyPacket reply = checkReply(performCommand(command));
    reply.getNextValueAsInt(); // number of values , is not used
    Value[] values = new Value[slots];
    for (int i = 0; i < slots; i++) {
        values[i] = reply.getNextValueAsValue();
    }

    return values;
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:32,代碼來源:VmMirror.java

示例4: clearEvent

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //導入方法依賴的package包/類
/**
 * Removes breakpoint of the given event kind corresponding to the given
 * request id.
 * 
 * @param eventKind
 *            request event kind
 * @param requestID
 *            request id
 * @param verbose
 *            print or don't extra log info
 */
protected void clearEvent(byte eventKind, int requestID, boolean verbose) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.EventRequestCommandSet.CommandSetID,
            JDWPCommands.EventRequestCommandSet.ClearCommand);
    packet.setNextValueAsByte(eventKind);
    packet.setNextValueAsInt(requestID);
    if (verbose) {
        logWriter.println("Clearing event: "
                + JDWPConstants.EventKind.getName(eventKind) + ", id: "
                + requestID);
    }
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "EventRequest::Clear command");
    assertAllDataRead(reply);
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:27,代碼來源:JDWPTestCase.java

示例5: setEventRequest

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //導入方法依賴的package包/類
protected int setEventRequest() {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.EventRequestCommandSet.CommandSetID,
            JDWPCommands.EventRequestCommandSet.SetCommand);
    packet.setNextValueAsByte(JDWPConstants.EventKind.METHOD_ENTRY);
    packet.setNextValueAsByte(JDWPConstants.SuspendPolicy.ALL);
    packet.setNextValueAsInt(1);
    packet.setNextValueAsByte((byte) 5);
    packet.setNextValueAsString("*.InvokeMethodDebuggee");

    logWriter.println("\nSend EventRequest::Set command...");
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "EventRequest::Set command");
    
    int requestID = reply.getNextValueAsInt();
    logWriter.println(" EventRequest.Set: requestID=" + requestID);
    assertTrue(reply.isAllDataRead());
    return requestID;
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:20,代碼來源:InvokeMethodTest.java

示例6: clearEvent

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //導入方法依賴的package包/類
protected void clearEvent(int requestID) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.EventRequestCommandSet.CommandSetID,
            JDWPCommands.EventRequestCommandSet.ClearCommand);
    packet.setNextValueAsByte(JDWPConstants.EventKind.METHOD_ENTRY);
    packet.setNextValueAsInt(requestID);
    logWriter.println("\nSend EventRequest::Clear command...");
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "EventRequest::Clear command");
    assertAllDataRead(reply);
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:12,代碼來源:InvokeMethodTest.java


注:本文中的org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket.setNextValueAsByte方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。