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


Java CommandPacket.setCommand方法代碼示例

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


在下文中一共展示了CommandPacket.setCommand方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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));
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:31,代碼來源:VmMirror.java

示例2: ClearAllBreakpoints

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //導入方法依賴的package包/類
/**
 * Removes all breakpoints.
 * 
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket ClearAllBreakpoints() {

    // Create new command packet
    CommandPacket commandPacket = new CommandPacket();

    // Set command. "3" - is ID of ClearAllBreakpoints command in
    // EventRequest Command Set
    commandPacket
            .setCommand(JDWPCommands.EventRequestCommandSet.ClearAllBreakpointsCommand);

    // Set command set. "15" - is ID of EventRequest Command Set
    commandPacket
            .setCommandSet(JDWPCommands.EventRequestCommandSet.CommandSetID);

    // Send packet
    return checkReply(performCommand(commandPacket));
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:23,代碼來源:VmMirror.java

示例3: getMethods

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //導入方法依賴的package包/類
/**
 * Gets method reference by signature.
 * 
 * @param classReferenceTypeID
 *            class referenceTypeID.
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket getMethods(long classReferenceTypeID) {
    // Create new command packet
    CommandPacket commandPacket = new CommandPacket();

    // Set command. "5" - is ID of Methods command in ReferenceType Command
    // Set
    commandPacket
            .setCommand(JDWPCommands.ReferenceTypeCommandSet.MethodsCommand);

    // Set command set. "2" - is ID of ReferenceType Command Set
    commandPacket
            .setCommandSet(JDWPCommands.ReferenceTypeCommandSet.CommandSetID);

    // Set outgoing data
    // Set referenceTypeID
    commandPacket.setNextValueAsObjectID(classReferenceTypeID);

    // Send packet
    return checkReply(performCommand(commandPacket));
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:28,代碼來源:VmMirror.java

示例4: 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));
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:32,代碼來源:VmMirror.java

示例5: dispose

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //導入方法依賴的package包/類
/**
 * Disposes connection to debuggee VM.
 * 
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket dispose() {
    // Create new command packet
    CommandPacket commandPacket = new CommandPacket();
    commandPacket
            .setCommand(JDWPCommands.VirtualMachineCommandSet.DisposeCommand);
    commandPacket
            .setCommandSet(JDWPCommands.VirtualMachineCommandSet.CommandSetID);

    // Send packet
    return checkReply(performCommand(commandPacket));
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:17,代碼來源:VmMirror.java

示例6: 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));
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:18,代碼來源:VmMirror.java

示例7: capabilities

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //導入方法依賴的package包/類
/**
 * Requests debuggee VM capabilities. Function parses reply packet of
 * VirtualMachine::CapabilitiesNew command, creates and fills class
 * Capabilities with returned info.
 * 
 * @return ReplyPacket useless, already parsed reply packet.
 */
public ReplyPacket capabilities() {

    // Create new command packet
    CommandPacket commandPacket = new CommandPacket();

    // Set command. "17" - is ID of CapabilitiesNew command in
    // VirtualMachine Command Set
    commandPacket
            .setCommand(JDWPCommands.VirtualMachineCommandSet.CapabilitiesNewCommand);

    // Set command set. "1" - is ID of VirtualMachine Command Set
    commandPacket
            .setCommandSet(JDWPCommands.VirtualMachineCommandSet.CommandSetID);

    // Send packet
    ReplyPacket replyPacket = checkReply(performCommand(commandPacket));

    targetVMCapabilities = new Capabilities();

    // Set capabilities
    targetVMCapabilities.canWatchFieldModification = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canWatchFieldAccess = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canGetBytecodes = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canGetSyntheticAttribute = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canGetOwnedMonitorInfo = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canGetCurrentContendedMonitor = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canGetMonitorInfo = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canRedefineClasses = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canAddMethod = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.canUnrestrictedlyRedefineClasses = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canPopFrames = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.canUseInstanceFilters = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canGetSourceDebugExtension = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canRequestVMDeathEvent = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canSetDefaultStratum = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canGetInstanceInfo = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.reserved17 = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.canGetMonitorFrameInfo = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canUseSourceNameFilters = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.canGetConstantPool = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.canForceEarlyReturn = replyPacket
            .getNextValueAsBoolean();
    targetVMCapabilities.reserved22 = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.reserved23 = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.reserved24 = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.reserved25 = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.reserved26 = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.reserved27 = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.reserved28 = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.reserved29 = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.reserved30 = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.reserved31 = replyPacket.getNextValueAsBoolean();
    targetVMCapabilities.reserved32 = replyPacket.getNextValueAsBoolean();

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

示例8: adjustTypeLength

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; //導入方法依賴的package包/類
/**
 * Adjusts lengths for all VM-specific types.
 * 
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket adjustTypeLength() {
    // Create new command packet
    CommandPacket commandPacket = new CommandPacket();
    commandPacket
            .setCommand(JDWPCommands.VirtualMachineCommandSet.IDSizesCommand);
    commandPacket
            .setCommandSet(JDWPCommands.VirtualMachineCommandSet.CommandSetID);

    // Send packet
    ReplyPacket replyPacket = checkReply(performCommand(commandPacket));

    // Get FieldIDSize from ReplyPacket
    TypesLengths.setTypeLength(TypesLengths.FIELD_ID, replyPacket
            .getNextValueAsInt());

    // Get MethodIDSize from ReplyPacket
    TypesLengths.setTypeLength(TypesLengths.METHOD_ID, replyPacket
            .getNextValueAsInt());

    // Get ObjectIDSize from ReplyPacket
    TypesLengths.setTypeLength(TypesLengths.OBJECT_ID, replyPacket
            .getNextValueAsInt());

    // Get ReferenceTypeIDSize from ReplyPacket
    TypesLengths.setTypeLength(TypesLengths.REFERENCE_TYPE_ID, replyPacket
            .getNextValueAsInt());

    // Get FrameIDSize from ReplyPacket
    TypesLengths.setTypeLength(TypesLengths.FRAME_ID, replyPacket
            .getNextValueAsInt());

    // Adjust all other types lengths
    TypesLengths.setTypeLength(TypesLengths.ARRAY_ID, TypesLengths
            .getTypeLength(TypesLengths.OBJECT_ID));
    TypesLengths.setTypeLength(TypesLengths.STRING_ID, TypesLengths
            .getTypeLength(TypesLengths.OBJECT_ID));
    TypesLengths.setTypeLength(TypesLengths.THREAD_ID, TypesLengths
            .getTypeLength(TypesLengths.OBJECT_ID));
    TypesLengths.setTypeLength(TypesLengths.THREADGROUP_ID, TypesLengths
            .getTypeLength(TypesLengths.OBJECT_ID));
    TypesLengths.setTypeLength(TypesLengths.LOCATION_ID, TypesLengths
            .getTypeLength(TypesLengths.OBJECT_ID));
    TypesLengths.setTypeLength(TypesLengths.CLASS_ID, TypesLengths
            .getTypeLength(TypesLengths.OBJECT_ID));
    TypesLengths.setTypeLength(TypesLengths.CLASSLOADER_ID, TypesLengths
            .getTypeLength(TypesLengths.OBJECT_ID));
    TypesLengths.setTypeLength(TypesLengths.CLASSOBJECT_ID, TypesLengths
            .getTypeLength(TypesLengths.OBJECT_ID));
    return replyPacket;
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:56,代碼來源:VmMirror.java


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