Contents|Index|Previous|Next
User-defined
commands
A user-defined
command is a sequence of GDB commands to which you assign a new name
as a command. This is done with the define
command. User commands may accept up to 10 arguments separated by whitespace.
Arguments are accessed within the user command via $arg0
...$arg9.
A trivial example is the following declaration.
define adder
print $arg0
+ $arg1 + $arg2
To execute the command use the
following declaration.
This defines the command adder,
which prints the sum of its three arguments.
The following documentation
discusses user-defined commands.
Note:
The arguments are text substitutions,
so they may reference variables, use complex expressions, or even perform
inferior functions calls.
Top|Contents|Index|Previous|Next