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