本文整理汇总了Java中org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket.setNextValueAsInt方法的典型用法代码示例。如果您正苦于以下问题:Java CommandPacket.setNextValueAsInt方法的具体用法?Java CommandPacket.setNextValueAsInt怎么用?Java CommandPacket.setNextValueAsInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket
的用法示例。
在下文中一共展示了CommandPacket.setNextValueAsInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: perform
import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
@Override
public void perform(JUnit3Wrapper testBase) {
Optional<Variable> localVar =
getVariableAt(testBase.getMirror(), testBase.debuggeeState.getLocation(), localName);
Assert.assertTrue("No local '" + localName + "'", localVar.isPresent());
CommandPacket setValues = new CommandPacket(StackFrameCommandSet.CommandSetID,
StackFrameCommandSet.SetValuesCommand);
setValues.setNextValueAsThreadID(testBase.getDebuggeeState().getThreadId());
setValues.setNextValueAsFrameID(testBase.getDebuggeeState().getFrameId());
setValues.setNextValueAsInt(1);
setValues.setNextValueAsInt(localVar.get().getSlot());
setValues.setNextValueAsValue(newValue);
ReplyPacket replyPacket = testBase.getMirror().performCommand(setValues);
testBase.checkReplyPacket(replyPacket, "StackFrame.SetValues");
}
示例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: getObjectReferenceValues
import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
* Returns the value of one or more instance fields.
*
* @param objectID
* The object ID
* @param fieldIDs
* IDs of fields to get
* @return An array of Value objects representing each field's value
*/
public final Value[] getObjectReferenceValues(long objectID, long[] fieldIDs) {
int fieldsCount = fieldIDs.length;
if (fieldsCount == 0) {
return null;
}
CommandPacket command = new CommandPacket(
JDWPCommands.ObjectReferenceCommandSet.CommandSetID,
JDWPCommands.ObjectReferenceCommandSet.GetValuesCommand);
command.setNextValueAsReferenceTypeID(objectID);
command.setNextValueAsInt(fieldsCount);
for (int i = 0; i < fieldsCount; i++) {
command.setNextValueAsFieldID(fieldIDs[i]);
}
ReplyPacket reply = checkReply(performCommand(command));
reply.getNextValueAsInt(); // fields returned, is not used
Value[] values = new Value[fieldsCount];
for (int i = 0; i < fieldsCount; i++) {
values[i] = reply.getNextValueAsValue();
}
return values;
}
示例5: getReferenceTypeValues
import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
* Returns the value of one or more static fields of the reference type
*
* @param refTypeID
* The reference type ID.
* @param fieldIDs
* IDs of fields to get
* @return An array of Value objects representing each field's value
*/
public final Value[] getReferenceTypeValues(long refTypeID, long[] fieldIDs) {
int fieldsCount = fieldIDs.length;
if (fieldsCount == 0) {
return null;
}
CommandPacket command = new CommandPacket(
JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
JDWPCommands.ReferenceTypeCommandSet.GetValuesCommand);
command.setNextValueAsReferenceTypeID(refTypeID);
command.setNextValueAsInt(fieldsCount);
for (int i = 0; i < fieldsCount; i++) {
command.setNextValueAsFieldID(fieldIDs[i]);
}
ReplyPacket reply = checkReply(performCommand(command));
reply.getNextValueAsInt(); // fields returned, is not used
Value[] values = new Value[fieldsCount];
for (int i = 0; i < fieldsCount; i++) {
values[i] = reply.getNextValueAsValue();
}
return values;
}
示例6: getObjectID
import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
private long getObjectID() {
// Compose Instances command to get tested thread objectID
CommandPacket InstancesCommand = new CommandPacket(
JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
JDWPCommands.ReferenceTypeCommandSet.InstancesCommand);
long testThreadTypeID = getClassIDBySignature(testObjSignature);
InstancesCommand.setNextValueAsReferenceTypeID(testThreadTypeID);
InstancesCommand.setNextValueAsInt(1);
ReplyPacket checkedReply = debuggeeWrapper.vmMirror
.performCommand(InstancesCommand);
InstancesCommand = null;
// Get the number of instances that returned.
int objNum = checkedReply.getNextValueAsInt();
// Get the tagged-objectID
byte tag = checkedReply.getNextValueAsByte();
long objectID = checkedReply.getNextValueAsObjectID();
return objectID;
}
示例7: invokeInstanceMethod
import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
* Invokes a member method of the given object.
*
* @param objectID
* The object ID.
* @param threadID
* The thread ID.
* @param methodName
* The name of method for the invocation.
* @param args
* The arguments for the invocation.
* @param options
* The invocation options.
* @return ReplyPacket for corresponding command
*/
public final ReplyPacket invokeInstanceMethod(long objectID, long threadID,
String methodName, Value[] args, int options) {
long classID = getReferenceType(objectID);
long methodID = getMethodID(classID, methodName);
CommandPacket command = new CommandPacket(
JDWPCommands.ObjectReferenceCommandSet.CommandSetID,
JDWPCommands.ObjectReferenceCommandSet.InvokeMethodCommand);
command.setNextValueAsObjectID(objectID);
command.setNextValueAsThreadID(threadID);
command.setNextValueAsClassID(classID);
command.setNextValueAsMethodID(methodID);
command.setNextValueAsInt(args.length);
for (int i = 0; i < args.length; i++) {
command.setNextValueAsValue(args[i]);
}
command.setNextValueAsInt(options);
return checkReply(performCommand(command));
}
示例8: invokeStaticMethod
import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
* Invokes a static method of the given class.
*
* @param classID
* The class type ID.
* @param threadID
* The thread ID.
* @param methodName
* The name of method for the invocation.
* @param args
* The arguments for the invocation.
* @param options
* The invocation options.
* @return ReplyPacket for corresponding command
*/
public final ReplyPacket invokeStaticMethod(long classID, long threadID,
String methodName, Value[] args, int options) {
long methodID = getMethodID(classID, methodName);
CommandPacket command = new CommandPacket(
JDWPCommands.ClassTypeCommandSet.CommandSetID,
JDWPCommands.ClassTypeCommandSet.InvokeMethodCommand);
command.setNextValueAsClassID(classID);
command.setNextValueAsThreadID(threadID);
command.setNextValueAsMethodID(methodID);
command.setNextValueAsInt(args.length);
for (int i = 0; i < args.length; i++) {
command.setNextValueAsValue(args[i]);
}
command.setNextValueAsInt(options);
return checkReply(performCommand(command));
}
示例9: jdwpGetFrames
import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
protected FrameInfo[] jdwpGetFrames(long threadID, int startFrame, int length) {
CommandPacket packet = new CommandPacket(
JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
JDWPCommands.ThreadReferenceCommandSet.FramesCommand);
packet.setNextValueAsThreadID(threadID);
packet.setNextValueAsInt(startFrame);
packet.setNextValueAsInt(length);
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
checkReplyPacket(reply, "ThreadReference::FramesCommand command");
int frames = reply.getNextValueAsInt();
FrameInfo[] frameInfos = new FrameInfo[frames];
for (int i = 0; i < frames; i++) {
long frameID = reply.getNextValueAsLong();
Location location = reply.getNextValueAsLocation();
frameInfos[i] = new FrameInfo(frameID, location);
}
return frameInfos;
}
示例10: getFramesCount
import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
private int getFramesCount(long threadID) {
logWriter.println("getting frames of the thread");
short err;
// getting frames of the thread
CommandPacket packet = new CommandPacket(
JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
JDWPCommands.ThreadReferenceCommandSet.FramesCommand);
packet.setNextValueAsThreadID(threadID);
packet.setNextValueAsInt(0);
packet.setNextValueAsInt(-1);
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
err = reply.getErrorCode();
if ( err != JDWPConstants.Error.NONE) {
logWriter.println("\tthreadID=" + threadID
+ " - " + JDWPConstants.Error.getName(err));
return 0;
}
int framesCount = reply.getNextValueAsInt();
return framesCount;
}
示例11: 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;
}
示例12: checkArrayValues
import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
private void checkArrayValues(ArrayRegion valuesRegion, long classID,
long fieldID) {
CommandPacket packet = new CommandPacket(
JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
JDWPCommands.ReferenceTypeCommandSet.GetValuesCommand);
packet.setNextValueAsReferenceTypeID(classID);
packet.setNextValueAsInt(1);
packet.setNextValueAsFieldID(fieldID);
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
checkReplyPacket(reply, "ReferenceType::GetValues command");
assertEquals("GetValuesCommand returned invalid number of values,", 1, reply.getNextValueAsInt());
Value value = reply.getNextValueAsValue();
//System.err.println("value="+value);
long arrayID = value.getLongValue();
int length = valuesRegion.getLength();
checkArrayRegion(valuesRegion, arrayID, 0, length);
}
示例13: jdwpGetFrames
import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
protected FrameInfo[] jdwpGetFrames(long threadID, int startFrame, int length) {
CommandPacket packet = new CommandPacket(
JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
JDWPCommands.ThreadReferenceCommandSet.FramesCommand);
packet.setNextValueAsThreadID(threadID);
packet.setNextValueAsInt(startFrame);
packet.setNextValueAsInt(length);
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
if (!checkReplyPacketWithoutFail(reply, "ThreadReference::FramesCommand command")) {
throw new TestErrorException("Error during performing ThreadReference::Frames command");
}
int frames = reply.getNextValueAsInt();
FrameInfo[] frameInfos = new FrameInfo[frames];
for (int i = 0; i < frames; i++) {
long frameID = reply.getNextValueAsLong();
Location location = reply.getNextValueAsLocation();
frameInfos[i] = new FrameInfo(frameID, location);
}
return frameInfos;
}
示例14: exit
import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //导入方法依赖的package包/类
/**
* Exits debuggee VM process.
*
* @return ReplyPacket for corresponding command
*/
public ReplyPacket exit(int exitCode) {
// Create new command packet
CommandPacket commandPacket = new CommandPacket();
commandPacket
.setCommand(JDWPCommands.VirtualMachineCommandSet.ExitCommand);
commandPacket
.setCommandSet(JDWPCommands.VirtualMachineCommandSet.CommandSetID);
commandPacket.setNextValueAsInt(exitCode);
// Send packet
return checkReply(performCommand(commandPacket));
}
示例15: 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);
}