Your Program's Environment - Red Hat ENTERPRISE LINUX 4 - DEBUGGING WITH GDB Manual

Debugging with gdb
Hide thumbs Also See for ENTERPRISE LINUX 4 - DEBUGGING WITH GDB:
Table of Contents

Advertisement

Chapter 6. Running Programs Under gdb
with no arguments uses the same arguments used by the previous
run
command.
args
set args
Specify the arguments to be used the next time your program is run. If
ments,
executes your program with no arguments. Once you have run your program with
run
arguments, using
ments.
show args
Show the arguments to give your program when it is started.

6.4. Your program's environment

The environment consists of a set of environment variables and their values. Environment variables
conventionally record such things as your user name, your home directory, your terminal type, and
your search path for programs to run. 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.
path
directory
Add
directory
that will be passed to your program. The value of
specify several directory names, separated by whitespace or by a system-dependent separator
character (
on Unix,
:
is moved to the front, so it is searched sooner.
You can use the string
searches the path. If you use
command. gdb replaces
to the search path.
directory
show paths
Display the list of search paths for executables (the
show environment [
Print the value of environment variable
you do not supply
to your program. You can abbreviate
set environment
Set environment variable
gdb itself.
value
any interpretation is supplied by your program itself. The
eliminated, the variable is set to a null value.
For example, this command:
set env USER = foo
before the next
set args
to the front of the
PATH
on MS-DOS and MS-Windows). If
;
to refer to whatever is the current working directory at the time gdb
$cwd
instead, it refers to the directory where you executed the
.
in the
.
directory
]
varname
, print the names and values of all environment variables to be given
varname
environment
[=
]
varname
value
to
varname
may be any string; the values of environment variables are just strings, and
is the only way to run it again without argu-
run
environment variable (the search path for executables)
used by gdb does not change. You may
PATH
argument (with the current path) before adding
environment variable).
PATH
to be given to your program when it starts. If
varname
as
env
. The value changes for your program only, not for
value
, or those set by the
run
set args
is already in the path, it
directory
.
parameter is optional; if it is
value
27
set
has no argu-
path

Advertisement

Table of Contents
loading

Table of Contents