You can extend the set of debugger commands by defining aliases.
When the debugger is tokenizing a command line, it expands aliases and then retokenizes the expansion.
alias_command
: alias [ alias_name ]
| alias alias_name [ ( argument_name, ...) ] string
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);
No warning is given if the alias_name already has a definition as an alias. The old definition will be replaced by the new one.
Use the unalias command followed by an alias name to delete the specified alias.