本文整理汇总了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;
}
示例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;
}