aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1990-12-13 17:32:56 +0000
committerJohn Gilmore <gnu@cygnus>1990-12-13 17:32:56 +0000
commit0bed9994416b4232a032fdaea70a10ed90f4cc5c (patch)
treefecd3c62cb80bed64daa11056ecd8ea02b7091e2 /gdb
parentf222d23d3592f939bbce408686e523a91b0572e1 (diff)
downloadgdb-0bed9994416b4232a032fdaea70a10ed90f4cc5c.zip
gdb-0bed9994416b4232a032fdaea70a10ed90f4cc5c.tar.gz
gdb-0bed9994416b4232a032fdaea70a10ed90f4cc5c.tar.bz2
Merge directory changes from 1.3 with Laura's diffs in 1.4.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/doc/gdb.texinfo48
1 files changed, 25 insertions, 23 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index fe8dca9..6cae824 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -2151,57 +2151,59 @@ this command with as little as @samp{rev}.
@cindex source path
@cindex directories for source files
-Executable programs do not record the directories of the source files
-from which they were compiled, just the names. GDB remembers a list of
+Executable programs sometimes do not record the directories of the source files
+from which they were compiled, just the names. Even when they do, the
+directories could be moved between the compilation and your debugging
+session. GDB remembers a list of
directories to search for source files; this is called the @dfn{source
path}. Each time GDB wants a source file, it tries all the directories
in the list, in the order they are present in the list, until it finds a
file with the desired name. @b{Note that the executable search path is
@i{not} used for this purpose. Neither is the current working
-directory, unless it happens to be in the source path.}
+directory, unless it happens to be in the source path.}
+
+If it can't find a source file in the source path, and the object program
+records what directory it was compiled in, GDB tries that directory too.
+If the source path is empty, and there is no record of the compilation
+directory, GDB will, as a last resort, look in the current directory.
+
+Whenever you reset or rearrange the source path, GDB will clear out
+any information it has cached about where source files are found, where
+each line is in the file, etc.
@kindex directory
-When you start GDB, its source path contains just the current working
-directory. To add other directories, use the @samp{directory} command.
+When you start GDB, its source path is empty.
+To add other directories, use the @samp{directory} command.
@table @code
@item directory @var{dirnames...}
-Add directory @var{dirname} to the end of the source path. Several
+Add directory @var{dirname} to the front of the source path. Several
directory names may be given to this command, separated by whitespace or
-@samp{:}.
+@samp{:}. If a name is already in the source path, it is moved to the
+front of the path, so it will be searched sooner.
@item directory
-Reset the source path to just the current working directory of GDB.
-This requires confirmation.
-
-Since this command deletes directories from the search path, it may
-change the directory in which a previously read source file will be
-discovered. To make this work correctly, this command also clears out
-the tables GDB maintains about the source files it has already found.
+Reset the source path to empty again. This requires confirmation.
@item info directories
@kindex info directories
Print the source path: show which directories it contains.
@end table
-Because the @samp{directory} command adds to the end of the source path,
-it does not affect any file that GDB has already found. If the source
+Because the @samp{directory} command adds to the front of the source path,
+it can affect files that GDB has already found. If the source
path contains directories that you do not want, and these directories
contain misleading files with names matching your source files, the
way to correct the situation is as follows:
@enumerate
@item
-Choose the directory you want at the beginning of the source path.
-Use the @samp{cd} command to make that the current working directory.
-
-@item
-Use @samp{directory} with no argument to reset the source path to just
-that directory.
+Use @samp{directory} with no argument to reset the source path to empty.
@item
Use @samp{directory} with suitable arguments to add any other
-directories you want in the source path.
+directories you want in the source path. You can add all the directories
+in one command.
@end enumerate
@node Data, Symbols, Source, Top