Class SetVMCommand
java.lang.Object
com.ibm.j9ddr.tools.ddrinteractive.Command
com.ibm.j9ddr.vm29.tools.ddrinteractive.commands.SetVMCommand
- All Implemented Interfaces:
ICommand
-
Nested Class Summary
Nested classes/interfaces declared in class Command
Command.CommandDescription -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrun(String command, String[] args, Context context, PrintStream out) Runs the !Methods declared in class Command
addCommand, addSubCommand, dbgFindPatternInRange, getCommandDescriptions, getCommandNames, printDetailedHelp, recognisesModifier and TypeMethodDescriptionaddCommand(String name, String argDescription, String helpDescription) voidaddSubCommand(Command.CommandDescription command, String name, String argDescription, String helpDescription) protected longdbgFindPatternInRange(Context context, byte[] pattern, int patternAlignment, long startSearchFrom, BigInteger bytesToSearch) voidThis prints the detailed help for the command by listing all the names that this command can be invoked by and also any sub commands that have been defined.booleanrecognises(String command, Context context) Method used by the DDR Interactive engine to decide whether this command matches the command passed in by the user
-
Constructor Details
-
SetVMCommand
public SetVMCommand()Constructor. It adds the command info into !j9help menu
-
-
Method Details
-
run
public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException Runs the !setvm command. 1. Checks whether correct number of args passed which is 1. 2. If condition 1 is successful, checks whether the passed arg is a valid integer, decimal or hexadecimal. 3. If condition 2 is successful, checks whether the address (only arg) is a valid J9JavaVM address. 4. If condition 3 is unsuccessful, checks whether the address is a valid J9VMThread address. If any of the condition 3 or 4 succeeds, then cachedVM is set to new address. Otherwise, it prints error msg.- Parameters:
command- DDR extension command which is setVM for this extension.args- arguments passed with the commandcontext- current context that DDR is running on.out- PrintStream to print the user messages.- Throws:
DDRInteractiveCommandException- If there is any problem running the command (incorrect usage, CorruptData etc.)
-