Chapter 6. Running Programs Under gdb 27run with no arguments uses the same arguments used by the previous run, or those set by the setargs command.set argsSpecify the arguments to be used the next time your program is run. If set args has no argu-ments, run executes your program with no arguments. Once you have run your program witharguments, using set args before the next run is the only way to run it again without argu-ments.show argsShow the arguments to give your program when it is started.6.4. Your program’s environmentThe environment consists of a set of environment variables and their values. Environment variablesconventionally record such things as your user name, your home directory, your terminal type, andyour search path for programs to run. Usually you set up environment variables with the shell andthey are inherited by all the other programs you run. When debugging, it can be useful to try runningyour program with a modified environment without having to start gdb over again.path directoryAdd directory to the front of the PATH environment variable (the search path for executables)that will be passed to your program. The value of PATH used by gdb does not change. You mayspecify several directory names, separated by whitespace or by a system-dependent separatorcharacter (: on Unix, ; on MS-DOS and MS-Windows). If directory is already in the path, itis moved to the front, so it is searched sooner.You can use the string $cwd to refer to whatever is the current working directory at the time gdbsearches the path. If you use . instead, it refers to the directory where you executed the pathcommand. gdb replaces . in the directory argument (with the current path) before addingdirectory to the search path.show pathsDisplay the list of search paths for executables (the PATH environment variable).show environment [varname]Print the value of environment variable varname to be given to your program when it starts. Ifyou do not supply varname, print the names and values of all environment variables to be givento your program. You can abbreviate environment as env.set environment varname [=value]Set environment variable varname to value. The value changes for your program only, not forgdb itself. value may be any string; the values of environment variables are just strings, andany interpretation is supplied by your program itself. The value parameter is optional; if it iseliminated, the variable is set to a null value.For example, this command:set env USER = foo