Execute a program using the
The command has the following form:
[ address ] [,count ] :r [ arguments ]
[ address ] [,count ] :R [ arguments ]
In the above command lines address gives the address at which to start execution. count is the number of breakpoints to be skipped before one is taken, and arguments are the command line arguments, such as filenames and options, to be passed to the program.
If no address is given, then the start of the program is used. Thus, to execute the program from the beginning, type:
:rIf a count is given, adb will ignore all breakpoints until the given number has been encountered. For example, the following command causes adb to skip the first 5 breakpoints:
,5:rTo specify arguments, separate each one by at least one space. The arguments are passed to the program in the same way the system shell passes command-line arguments to a program.
The :R command passes the command arguments through the shell before starting program execution. This allows the use of shell metacharacters in the arguments to refer to multiple files or other input values. The shell expands arguments containing metacharacters before passing them on to the program.
The :R command is especially useful if the program expects multiple filenames. For example, the following command passes the argument ``[a-z]*.s'' to the shell where it is expanded to a list of the corresponding filenames before being passed to the program:
:R [a-z]*.sThe :r and :R commands remove the contents of all registers and destroy the current stack before starting the program. This kills any previous copy of the program that may have been running.