Define an alias for one or more commands.
alias [alias_name] alias [alias_name [(argument)] "string"]
alias_name |
Name of the alias to display or define. |
argument |
An argument for the alias. |
string |
Value to assign to the alias. |
This command defines an alias for one or more commands, or displays one or all existing aliases.
To display all existing aliases and their definitions, enter this command without any parameters.
To display the definition of a specific alias, specify the alias_name parameter.
To define a new alias, or redefine an existing alias, use the string parameter, and optionally include an argument in the alias with the argument parameter.
The definition can contain:
The name of another alias, if the nested alias is the first identifier in the definition.
A quoted string, specified with backslashes before the quotation marks. Two quotation marks cannot be together; they must be separated by a space or at least one character.
The debugger does not give a warning if the alias_name already has a definition as an alias. The new definition replaces the old one.
Invoke the alias by entering the alias name.
The following example shows how to define and use an alias:
(idb) alias cs alias cs is not defined (idb) alias cs "stop at 186; run" (idb) cs [#1: stop at "x_list.cxx":186 ] [1] stopped at [int main(void):186 0x120002420] 186 IntNode* newNode = new IntNode(1);
The following example further modifies the cs alias to specify the breakpoint's line number when you enter the cs command:
(idb) alias cs (x) "stop at x; run" (idb) cs(186) [#2: stop at "x_list.cxx":186 ] Process has exited [2] stopped at [int main(void):186 0x120002420] 186 IntNode* newNode = new IntNode(1);
The following example demonstrates defining an alias with and without an argument, nesting an alias, and invoking an alias with an argument:
(idb) alias begin "stop in main; run"# Define the alias "begin" to set a breakpoint in main, then run the application. (idb) alias pv(x) "begin; print(x)"# Define the alias "pv" to invoke "begin", then print an argument. (idb) pv(i) # Invoke "pv" with i as an argument.
The following two examples define aliases with definitions that contain quoted strings, and then display the definitions:
(idb) alias ada "ignore sigalrm; ignore sigfpe; set $lang=\"Ada\";" (idb) alias ada ada ignore sigalrm; ignore sigfpe; set $lang="Ada"; (idb) alias x "set $lang=\"C++\" " (idb) alias x x set $lang="C++"
Notice that in the first example there is a semicolon between the last two quotation marks. In the second example there is a space. The two quotation marks cannot be together. They must be separated by a space or character.
Copyright © 1996-2010, Intel Corporation. All rights reserved.