
D-14
Motorola DSP56000 Family Optimizing C Compiler User’s Manual
For More Information On This Product,
Go to: www.freescale.com
Motorola
Running Your Program Under GDB
D.5.3 Your Program’s Working Directory
Each time you start your program with ‘run’, it inherits its working directory from the
current working directory of GDB. GDB’s working directory is initially whatever it
inherited from its parent process (typically the shell), but you can specify a new working
directory in GDB with the ‘cd’ command.
The GDB working directory also serves as a default for the commands that specify files
for GDB to operate on as listed in Table D-3. See section Files.
D.5.4 Your Program’s Input and Output
By default, the program you run under GDB does input and output to the same terminal
that GDB uses.
Table D-2. Environment Variables
Variable
Description
info environment varname
Print the value of environment variable varname to be given to your
program when it is started. This command can be abbreviated ‘i env
varname’.
info environment
Print the names and values of all environment variables to be given
to your program when it is started. This command can be
abbreviated ‘i env’.
set environment varname value
set environment varname = value
Sets environment variable varname to value, 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. This command can
be abbreviated as short as ‘set e’.
For example, this command:
set env USER = foo
tells the program, when subsequently run, to assume it is being run
on behalf of the user named ‘foo’.
delete environment varname
unset environment varname
Remove variable varname from the environment to be passed to
your program. This is different from ‘set env varname =’ because
‘delete environment’ leaves the variable with no value, which is
distinguishable from an empty value. This command can be
abbreviated ‘d e’.
Table D-3. Working Directory Commands
Command
Description
cd directory
Set GDB’s working directory to directory.
pwd
Print GDB’s working directory.
F
Freescale Semiconductor, Inc.
n
.