Commands

Much of the functionality of JSwat lies in two places: the graphical user interface and the command interface. The command interface is accessible both in JSwat's "console" mode and in its default graphical mode. In graphical mode, the command interface is made up of the "Messages" text area and the "Command" text field. Commands are entered in the text field and the results are displayed in the messages area.

To get familiar with the many JSwat commands, I recommend running the help command after starting JSwat. This will present you with various categories of commands and let you browse through the categories. You can learn what commands are used for manipulating breakpoints, single-stepping, and many other debugging-related operations.

History

Commands are stored in a "history chain" and can be invoked using the !<prefix> and !! operators. Earlier commands can be recalled using the up and down cursor keys (or Ctrl-p and Ctrl-n keys) to move backward and forward through the command history. (Note, this feature is not available in console mode.)

Aliases

Commands can be aliased to other names, offering you the ability to make the interface more convenient. Both a command and its arguments can be stored as an alias. The alias is invoked by the alias name, and may include additional arguments to the original command. Use the alias and unalias commands to manage aliases.

Macros

Commands can be grouped into a command macro, to save typing of frequently used commands. Invoking the macro will result in execution of the commands stored in the macro. Macros can use any commands, aliases, or other macros, but cannot use the ! or !! operators.

Startup File

JSwat processes what is often called a startup file. That is, when JSwat is started, it looks for a file with a particular name and processes it. This file may contain JSwat commands to be executed when JSwat starts. The file is called .jswat/jswatrc and lives in your home directory. JSwat also looks for a file named .jswatrc in the current directory, and each parent directory until it reaches of the root of the file system, processing the files in the order they are found.

Here is an example of a startup file.

#
# Lines starting with the # character are ignored.
#

# Create some useful command aliases.
alias   go              resume
alias   cont            resume
alias   quit            exit
alias   finish          step out

# Set the path where jswat looks for source files.
sourcepath /usr/java/src