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


Java CommandPacket.getNextValueAsInt方法代碼示例

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


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

示例1: waitEvent

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //導入方法依賴的package包/類
protected long waitEvent(int requestID) {
    long targetThreadID = 0;

    CommandPacket event = debuggeeWrapper.vmMirror
            .receiveCertainEvent(JDWPConstants.EventKind.METHOD_ENTRY);
    byte suspendPolicy = event.getNextValueAsByte();
    int events = event.getNextValueAsInt();
    logWriter.println(" EVENT_THREAD event: suspendPolicy=" + suspendPolicy
            + " events=" + events);
    for (int i = 0; i < events; i++) {
        byte eventKind = event.getNextValueAsByte();
        int newRequestID = event.getNextValueAsInt();
        long threadID = event.getNextValueAsThreadID();
        //Location location =
            event.getNextValueAsLocation();
        logWriter.println("  EVENT_THREAD event " + i + ": eventKind="
                + eventKind + " requestID=" + newRequestID + " threadID="
                + threadID);
        if (newRequestID == requestID) {
            targetThreadID = threadID;
        }
    }
    assertAllDataRead(event);
    assertTrue("targetThreadID must be != 0", targetThreadID != 0);
    return targetThreadID;
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:27,代碼來源:InvokeMethodTest.java

示例2: waitForBreakpoint

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //導入方法依賴的package包/類
/**
 * Waits for stop on breakpoint and gets id of thread where it stopped.
 * 
 * @param requestID
 *            id of request for breakpoint
 * @return threadID id of thread, where we stop on breakpoint
 */
public long waitForBreakpoint(long requestID) {
    // receive event
    CommandPacket event = null;
    event = receiveEvent();

    event.getNextValueAsByte();
    // suspendPolicy - is not used here

    // int numberOfEvents =
    event.getNextValueAsInt();

    long breakpointThreadID = 0;
    ParsedEvent[] eventParsed = ParsedEvent.parseEventPacket(event);

    if (eventParsed.length != 1) {
        throw new TestErrorException("Received " + eventParsed.length
                + " events instead of 1 BREAKPOINT_EVENT");
    }

    // check if received event is for breakpoint
    if (eventParsed[0].getEventKind() == JDWPConstants.EventKind.BREAKPOINT) {
        breakpointThreadID = ((ParsedEvent.Event_BREAKPOINT) eventParsed[0])
                .getThreadID();

    } else {
        throw new TestErrorException(
                "Kind of received event is not BREAKPOINT_EVENT: "
                        + eventParsed[0].getEventKind());

    }

    if (eventParsed[0].getRequestID() != requestID) {
        throw new TestErrorException(
                "Received BREAKPOINT_EVENT with another requestID: "
                        + eventParsed[0].getRequestID());
    }

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


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