alias
Creates or views pseudonyms for commands
Format:
Creates a new user-defined pseudonym for a command
alias alias-name defn-body
Views previously defined aliases
alias [ alias-name ]
Arguments:
alias-name
The name of the command pseudonym being defined.
defn-body
The text that Tcl will substitute when it encounters alias-name.
Description:
The alias command associates a name you specify with text that you define. This text can contain one or more commands. After you create an alias, you can use it in the same way as a native TotalView or Tcl command. In addition, you can include an alias as part of a definition of another alias.
If you just do not enter an alias-name argument, the CLI displays the names and definitions of all aliases. If you just specify an alias-name argument, the CLI displays the definition of the alias.
Because the alias command can contain Tcl commands, you must ensure that defn-body complies with all Tcl expansion, substitution, and quoting rules.
TotalView's global startup file, tvdinit.tvd, defines a set of default aliases. All the common commands have one- or two-letter aliases. (You can obtain a list of these commands by typing alias--being sure not to use an argument--in the CLI window.)
You cannot use an alias to redefine the name of a CLI-defined command. You can, however, redefine a built-in CLI command by creating your own Tcl procedure. For example, here is a procedure that disables the built-in dwatch command. When a user types dwatch, the CLI executes this code instead of the built-in CLI code:
proc dwatch {} {
puts "The dwatch command is disabled"
}
The CLI does not parse defn-body (the command's definition) until it is used. Thus, you can create aliases that are nonsensical or incorrect. The CLI only detects errors when it tries to execute your alias.
When you obtain help for a command, the help text includes information for TotalView's predefined aliases.
Examples:
alias nt dnext
Defines a command called nt that executes the dnext command.
alias nt
Displays the definition of the nt alias.
alias
Displays the definitions of all aliases.
alias m {dlist main}
Defines an alias called m that lists the source code of function main.
alias step2 {dstep; dstep}
Defines an alias called step2 that does two dstep commands. This new command will apply to the focus that exists when someone uses this alias.
alias step2 {s ; s}
Creates an alias that performs the same operations as the one in the previous example. It differs in that it uses the alias for dstep. Note that you could also create an alias that does the same thing as follows: alias step2 {s 2}.
alias step1 {f p1. dstep}
Defines an alias called step1 that steps the first user thread in process 1. Note that all other threads in the process run freely while TotalView steps the current line in your program.