define

This command enables you to derive new user-defined commands from existing commands. User-defined commands accept arguments separated by whitespace. You can use the arguments in expressions by using $arg0...$argn, for example:

print 4+$arg0      # add 4 to the first argument and print result

Show/hideSyntax

define cmd
   ...
end

Where:

cmd

Specifies the command name followed by one or more debugger commands.

Enter each debbuger command on a new line and terminate the define command by using the end command.

Note

Be aware that existing commands can be redefined if you specify a command name cmd that exists already.

Show/hideExample

Example 17. define

# Define add-args command to print sum of first 3 arguments
define add-args
    print $arg0+$arg1+$arg2
end

Show/hideSee also

Copyright © 2010, 2011 ARM. All rights reserved.ARM DUI 0452D
Non-ConfidentialID011411