User`s guide
14
Chapter 3: Examining Source Files
For example, consider debugging a program called look in /usr/local/bin, the
source for which resides in /usr/local/src/look.c. To debug this program, you
can invoke dbx from the /usr/local/bin directory by entering:
% dbx -I /usr/local/src look
Specifying Source Directories With
dbx
Commands
The dir and use commands allow you to specify a source directory list while
dbx is running.
dir [dir ...] If you provide one or more directories, dbx adds those
directories to the end of the source directory list.
If you do not provide any directories, dbx displays the
current source directory list.
use [dir ...] If you provide one or more directories, dbx replaces the
source directory list with the directories that you provide.
If you do not provide any options, dbx displays the current
source directory list.
Note: Both the dir and use commands recognize absolute and relative
pathnames (for example, ../src); however, they do not recognize C shell tilde
(~) syntax (for example, ~kim/src) or environment variables (for example,
$HOME/src).
Examples of
dir
and
use
Let’s debug the look program in /usr/local/bin. Recall that the source resides
in /usr/local/src/look.c. If you invoke dbx from the /usr/local/bin directory
without specifying /usr/local/src as a source directory, it will not initially
appear in the directory list:
(dbx) dir
.
However, you can add /usr/local/src with the dir command by entering:
(dbx) dir /usr/local/src
(dbx) dir
. /usr/local/src