f78
Your program's environment
Usually you set up environment variables with the shell and they are inherited
by all the other programs you run.
When debugging, it can be useful to try running your program with a modified
environment without having to start GDB over again.
You can use the string
Warning:
Add directory to the front of the PATH environment variable (the search path for executables), for both GDB and your
program. You may specify several directory names, separated by : or a whitespace. If directory is already in the path, it is moved to the front, so it is searched sooner.
Display the list of search paths for executables (the PATH environment variable).
Print the value of environment variable varname to be given to your program when it starts. If you do not supply varname, print the names and values of all environment variables to be given to your
program. You can abbreviate environment as env.
Set environment variable varname to value. The value changes for your program only, not for GDB itself. value may be any string; the values of environment variables are just strings, and
any interpretation is supplied by your program itself. The value parameter is optional; if it is eliminated, the variable is set to a null
value. For example, the command, set env USER = foo, tells a Unix program, when run, that its user is named foo. (The spaces around = are used for clarity here; they are not actually required.)
Remove variable, varname, from the environment to be passed to your program. This is different from set env varname =; unset environment removes the variable from the environment, rather than assigning it an empty
value.
GDB runs your program using the shell indicated by your