| |||
| Home > RealView Debugger Commands > Alphabetical command reference > ARGUMENTS | |||
The ARGUMENTS command enables you to specify the command-line arguments for the application. These are used for each subsequent run on this connection.
ARGUMENTS [{,delete
| ,prompt}]
ARGUMENTS [,default] string
where:
deleteDelete the currently set ARGUMENTS list,
so the argv list for the next run of a program
is only the program filename.
defaultMake the defined arguments the default, so they apply to new connections created in this session.
promptDisplay a dialog to prompt you for the arguments when the ARGUMENTS command is executed.
stringDefines the command line that the application sees
when it inspects the argv[] array, or equivalent.
The ARGUMENTS command enables you to specify arguments that the target application might require when it starts execution. The specified string is made available to ARM applications through the semihosting mechanism. Any previous argument definition is overwritten.
If a literal double-quote character is required in the arguments, you must escape it using the backslash character and embed it in single quotes, for example:
ARGUMENTS "-f ’\"my file.c\"’
If you enter this command without any parameters, the current argument definition is displayed.
You can also specify arguments as part of the LOAD command.
If you unload an image that requires arguments, any arguments defined with this command are not used by the image when you next reload it. After reloading the image, enter this command again to specify the arguments before running the image.
The following examples show how to use ARGUMENTS:
ARGUMENTS
"-f file.c -o file.o"Sets the command
line so that, if the line is parsed in the normal way by _main(),
the argv[] array contains:
target program
filename, for example: com.axf
-f
file.c
-o
file.o
NULL
ARGUMENTS "-f ’\"my file.c\"’
-o ’\"my file.o\"’"Sets the command
line so that, if the line is parsed in the normal way by _main(),
the argv[] array contains:
target program
filename, for example: "com.axf"
-f
"my file.c"
-o
"my file.o"
NULL
load /pd/r ’com.axf;;-f
file.c -o file.o’ go arguments "-f '\"my file.c\"' -o '\"my file.o\"'"
restart goChanges the arguments without unloading the image. Table 2.15 shows the argument assignments in the original LOAD command, and the new assignments specified by the ARGUMENTS command.