本文整理汇总了Java中org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket.getNextValueAsLong方法的典型用法代码示例。如果您正苦于以下问题:Java ReplyPacket.getNextValueAsLong方法的具体用法?Java ReplyPacket.getNextValueAsLong怎么用?Java ReplyPacket.getNextValueAsLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket
的用法示例。
在下文中一共展示了ReplyPacket.getNextValueAsLong方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLineNumber
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* Returns a source line number according to a corresponding line code index
* in a method's line table.
*
* @param classID
* The class object ID.
* @param methodID
* The method ID.
* @param codeIndex
* The line code index.
* @return An integer line number.
*/
public final int getLineNumber(long classID, long methodID, long codeIndex) {
int lineNumber = -1;
ReplyPacket reply = getLineTable(classID, methodID);
if (reply.getErrorCode() != JDWPConstants.Error.NONE) {
return lineNumber;
}
reply.getNextValueAsLong(); // start line index, is not used
reply.getNextValueAsLong(); // end line index, is not used
int lines = reply.getNextValueAsInt();
for (int i = 0; i < lines; i++) {
long lineCodeIndex = reply.getNextValueAsLong();
lineNumber = reply.getNextValueAsInt();
if (lineCodeIndex == codeIndex) {
break;
}
if (lineCodeIndex > codeIndex) {
--lineNumber;
break;
}
}
return lineNumber;
}
示例2: getLineCodeIndex
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* Returns a line code index according to a corresponding line number in a
* method's line table.
*
* @param classID
* The class object ID.
* @param methodID
* The method ID.
* @param lineNumber
* A source line number.
* @return An integer representing the line code index.
*/
public final long getLineCodeIndex(long classID, long methodID,
int lineNumber) {
ReplyPacket reply = getLineTable(classID, methodID);
if (reply.getErrorCode() != JDWPConstants.Error.NONE) {
return -1L;
}
reply.getNextValueAsLong(); // start line index, is not used
reply.getNextValueAsLong(); // end line index, is not used
int lines = reply.getNextValueAsInt();
for (int i = 0; i < lines; i++) {
long lineCodeIndex = reply.getNextValueAsLong();
if (lineNumber == reply.getNextValueAsInt()) {
return lineCodeIndex;
}
}
return -1L;
}
示例3: jdwpGetFrames
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的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;
}
示例4: jdwpGetVariableTable
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
protected VarInfo[] jdwpGetVariableTable(long classID, long methodID) {
CommandPacket packet = new CommandPacket(
JDWPCommands.MethodCommandSet.CommandSetID,
JDWPCommands.MethodCommandSet.VariableTableCommand);
packet.setNextValueAsClassID(classID);
packet.setNextValueAsMethodID(methodID);
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
checkReplyPacket(reply, "Method::VariableTable command");
reply.getNextValueAsInt();
int varNumber = reply.getNextValueAsInt();
VarInfo[] varInfos = new VarInfo[varNumber];
for (int i = 0; i < varNumber; i++) {
reply.getNextValueAsLong();
String name = reply.getNextValueAsString();
String sign = reply.getNextValueAsString();
reply.getNextValueAsInt();
int slot = reply.getNextValueAsInt();
varInfos[i] = new VarInfo(name, slot, sign);
}
return varInfos;
}
示例5: jdwpGetAllThreads
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
protected long[] jdwpGetAllThreads() {
CommandPacket packet = new CommandPacket(
JDWPCommands.VirtualMachineCommandSet.CommandSetID,
JDWPCommands.VirtualMachineCommandSet.AllThreadsCommand);
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
checkReplyPacket(reply, "VirtualMachine::AllThreads command");
int frames = reply.getNextValueAsInt();
long[] frameIDs = new long[frames];
for (int i = 0; i < frames; i++) {
frameIDs[i] = reply.getNextValueAsLong();
}
return frameIDs;
}
示例6: jdwpGetFrames
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的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;
}
示例7: getMethodStartCodeIndex
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
long getMethodStartCodeIndex(long classID, String methodName) {
long methodID = debuggeeWrapper.vmMirror.getMethodID(classID, methodName);
if ( methodID == -1 ) {
logWriter.println
("## getMethodStartCodeIndex(): Can NOT get methodID for classID = "
+ classID + "; Method name = " + methodName);
return -1;
}
CommandPacket packet = new CommandPacket(
JDWPCommands.MethodCommandSet.CommandSetID,
JDWPCommands.MethodCommandSet.LineTableCommand);
packet.setNextValueAsClassID(classID);
packet.setNextValueAsMethodID(methodID);
ReplyPacket lineTableReply = debuggeeWrapper.vmMirror.performCommand(packet);
if ( ! checkReplyPacketWithoutFail
(lineTableReply, "getMethodStartCodeIndex(): Method.LineTable command") ) {
return -1;
}
long methodStartCodeIndex = lineTableReply.getNextValueAsLong();
return methodStartCodeIndex;
}
示例8: getMethodEndCodeIndex
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
@SuppressWarnings("unused")
long getMethodEndCodeIndex(long classID, String methodName) {
long methodID = debuggeeWrapper.vmMirror.getMethodID(classID, methodName);
if ( methodID == -1 ) {
logWriter.println
("## getMethodEndCodeIndex(): Can NOT get methodID for classID = "
+ classID + "; Method name = " + methodName);
return -1;
}
CommandPacket packet = new CommandPacket(
JDWPCommands.MethodCommandSet.CommandSetID,
JDWPCommands.MethodCommandSet.LineTableCommand);
packet.setNextValueAsClassID(classID);
packet.setNextValueAsMethodID(methodID);
ReplyPacket lineTableReply = debuggeeWrapper.vmMirror.performCommand(packet);
if ( ! checkReplyPacketWithoutFail
(lineTableReply, "getMethodEndCodeIndex(): Method.LineTable command") ) {
return -1;
}
long methodStartCodeIndex = lineTableReply.getNextValueAsLong();
long methodEndCodeIndex = lineTableReply.getNextValueAsLong();
return methodEndCodeIndex;
}
示例9: getMethodFirstCodeIndex
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
private long getMethodFirstCodeIndex(long classId, long breakpointMethodId) {
ReplyPacket replyPacket = getMirror().getLineTable(classId, breakpointMethodId);
checkReplyPacket(replyPacket, "Failed to get method line table");
replyPacket.getNextValueAsLong(); // start
replyPacket.getNextValueAsLong(); // end
int linesCount = replyPacket.getNextValueAsInt();
if (linesCount == 0) {
return -1;
} else {
// Read only the 1st line because code indices are in ascending order
return replyPacket.getNextValueAsLong();
}
}
示例10: setBreakpointAtMethodBegin
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* Sets breakpoint at the beginning of method with name <i>methodName</i>.
*
* @param classID
* id of class with required method
* @param methodName
* name of required method
* @return requestID id of request
*/
public long setBreakpointAtMethodBegin(long classID, String methodName) {
long requestID;
long methodID = getMethodID(classID, methodName);
ReplyPacket lineTableReply = getLineTable(classID, methodID);
if (lineTableReply.getErrorCode() != JDWPConstants.Error.NONE) {
throw new TestErrorException(
"Command getLineTable returned error code: "
+ lineTableReply.getErrorCode()
+ " - "
+ JDWPConstants.Error.getName(lineTableReply
.getErrorCode()));
}
lineTableReply.getNextValueAsLong();
// Lowest valid code index for the method
lineTableReply.getNextValueAsLong();
// Highest valid code index for the method
// int numberOfLines =
lineTableReply.getNextValueAsInt();
long lineCodeIndex = lineTableReply.getNextValueAsLong();
// set breakpoint inside checked method
Location breakpointLocation = new Location(JDWPConstants.TypeTag.CLASS,
classID, methodID, lineCodeIndex);
ReplyPacket reply = setBreakpoint(breakpointLocation);
checkReply(reply);
requestID = reply.getNextValueAsInt();
return requestID;
}
示例11: getReferenceType
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* Returns the runtime type of the object
*
* @param objectID
* The object ID
* @return The runtime reference type.
*/
public final long getReferenceType(long objectID) {
CommandPacket command = new CommandPacket(
JDWPCommands.ObjectReferenceCommandSet.CommandSetID,
JDWPCommands.ObjectReferenceCommandSet.ReferenceTypeCommand);
command.setNextValueAsObjectID(objectID);
ReplyPacket reply = checkReply(performCommand(command));
reply.getNextValueAsByte();
return reply.getNextValueAsLong();
}
示例12: testLineTableTest001
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* This testcase exercises Method.LineTable command.
* <BR>It runs MethodDebuggee, receives methods of debuggee.
* For each received method sends Method.LineTable command
* and prints returned LineTable.
*/
public void testLineTableTest001() throws UnsupportedEncodingException {
logWriter.println("testLineTableTest001 started");
synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
long classID = getClassIDBySignature("L"+getDebuggeeClassName().replace('.', '/')+";");
MethodInfo[] methodsInfo = jdwpGetMethodsInfo(classID);
assertFalse("Invalid number of methods: 0", methodsInfo.length == 0);
for (int i = 0; i < methodsInfo.length; i++) {
logWriter.println(methodsInfo[i].toString());
// get variable table for this class
ReplyPacket reply = getLineTable(classID, methodsInfo[i].getMethodID());
long start = reply.getNextValueAsLong();
logWriter.println("start = " + start);
long end = reply.getNextValueAsLong();
logWriter.println("end = " + end);
int lines = reply.getNextValueAsInt();
logWriter.println("lines = "+lines);
for (int j = 0; j < lines; j++) {
long lineCodeIndex = reply.getNextValueAsLong();
logWriter.println("lineCodeIndex = "+lineCodeIndex);
int lineNumber = reply.getNextValueAsInt();
logWriter.println("lineNumber = "+lineNumber);
}
}
synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
}
示例13: printMethodLineTable
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
void printMethodLineTable(long classID, String className /* may be null */, String methodName) {
long methodID = debuggeeWrapper.vmMirror.getMethodID(classID, methodName);
if ( methodID == -1 ) {
logWriter.println
("## printMethodLineTable(): Can NOT get methodID for classID = "
+ classID + "; Method name = " + methodName);
return;
}
CommandPacket packet = new CommandPacket(
JDWPCommands.MethodCommandSet.CommandSetID,
JDWPCommands.MethodCommandSet.LineTableCommand);
packet.setNextValueAsClassID(classID);
packet.setNextValueAsMethodID(methodID);
ReplyPacket lineTableReply = debuggeeWrapper.vmMirror.performCommand(packet);
if ( ! checkReplyPacketWithoutFail(lineTableReply, "printMethodLineTable(): Method.LineTable command") ) {
return;
}
if ( className == null ) {
logWriter.println("=== Line Table for method: " + methodName + " ===");
} else {
logWriter.println("=== Line Table for method: " + methodName + " of class: "
+ className + " ===");
}
long methodStartCodeIndex = lineTableReply.getNextValueAsLong();
logWriter.println("==> Method Start Code Index = " + methodStartCodeIndex);
long methodEndCodeIndex = lineTableReply.getNextValueAsLong();
logWriter.println("==> Method End Code Index = " + methodEndCodeIndex);
int linesNumber = lineTableReply.getNextValueAsInt();
logWriter.println("==> Number of lines = " + linesNumber);
for (int i=0; i < linesNumber; i++) {
long lineCodeIndex = lineTableReply.getNextValueAsLong();
int lineNumber = lineTableReply.getNextValueAsInt();
logWriter.println("====> Line Number " + lineNumber + " : Initial code index = " + lineCodeIndex);
}
logWriter.println("=== End of Line Table " + methodName + " ===");
}
示例14: getMethodEntryLocation
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
protected Location getMethodEntryLocation(long classID, String methodName) {
long methodID = debuggeeWrapper.vmMirror.getMethodID(classID, methodName);
if ( methodID == -1 ) {
logWriter.println
("## getClassMethodEntryLocation(): Can NOT get methodID for classID = "
+ classID + "; Method name = " + methodName);
return null;
}
CommandPacket packet = new CommandPacket(
JDWPCommands.MethodCommandSet.CommandSetID,
JDWPCommands.MethodCommandSet.LineTableCommand);
packet.setNextValueAsClassID(classID);
packet.setNextValueAsMethodID(methodID);
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
if ( ! checkReplyPacketWithoutFail
(reply, "getMethodEntryLocation(): Method.LineTable command") ) {
return null;
}
long methodStartCodeIndex = reply.getNextValueAsLong();
Location location = new Location();
location.tag = JDWPConstants.TypeTag.CLASS;
location.classID = classID;
location.methodID = methodID;
location.index = methodStartCodeIndex;
return location;
}
示例15: getMethodEndLocation
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
@SuppressWarnings("unused")
protected Location getMethodEndLocation(long classID, String methodName) {
long methodID = debuggeeWrapper.vmMirror.getMethodID(classID, methodName);
if ( methodID == -1 ) {
logWriter.println
("## getClassMethodEndLocation(): Can NOT get methodID for classID = "
+ classID + "; Method name = " + methodName);
return null;
}
CommandPacket packet = new CommandPacket(
JDWPCommands.MethodCommandSet.CommandSetID,
JDWPCommands.MethodCommandSet.LineTableCommand);
packet.setNextValueAsClassID(classID);
packet.setNextValueAsMethodID(methodID);
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
if ( ! checkReplyPacketWithoutFail
(reply, "getMethodEndLocation(): Method.LineTable command") ) {
return null;
}
long methodStartCodeIndex = reply.getNextValueAsLong();
long methodEndCodeIndex = reply.getNextValueAsLong();
Location location = new Location();
location.tag = JDWPConstants.TypeTag.CLASS;
location.classID = classID;
location.methodID = methodID;
location.index = methodEndCodeIndex;
return location;
}