Index: doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.340 diff -u -p -r1.340 gdb.texinfo --- doc/gdb.texinfo 21 Jun 2006 13:57:21 -0000 1.340 +++ doc/gdb.texinfo 7 Jul 2006 04:51:00 -0000 @@ -5033,6 +5033,23 @@ To add other directories, use the @code{ The search path is used to find both program source files and @value{GDBN} script files (read using the @samp{-command} option and @samp{source} command). +In addition to the source path, @value{GDBN} provides a set of commands +that manage a source path substitution rule. Instead of attempting to +locate the source file using the original source path as described above, +it will first apply the substitution rule to that source path, and use +the resulting path instead. By default, there is no substitution rule +defined, but this can be very useful in the case when your source tree +has been moved to a different location from the one where the sources +were compiled. To define a source path substitution rule, use the +@code{set substitute-path} command. + +Using the previous example, suppose the @file{foo-1.0} tree has been +moved from @file{/usr/src} to @file{/mnt/cross}, then you can tell +GDB to replace @file{/usr/src} in all source path names with +@file{/mnt/cross}. The first lookup will then be +@file{/mnt/cross/foo-1.0/lib/foo.c} in place of the original location +of @file{/usr/src/foo-1.0/lib/foo.c}. + @table @code @item directory @var{dirname} @dots{} @item dir @var{dirname} @dots{} @@ -5068,6 +5085,21 @@ Reset the source path to its default val @item show directories @kindex show directories Print the source path: show which directories it contains. + +@item set substitute-path @var{FROM} @var{TO} +@kindex set substitute-path +Define a source path substitution rule. The new substitution rule +replaces any rule previously defined. + +@item unset substitute-path +@kindex unset substitute-path +If a source path substitution rule is active, then cancel it. +This command has no effect otherwise. + +@item show substitute-path +@kindex show substitute-path +Print the source path substitution rule if defined. + @end table If your source path is cluttered with directories that are no longer of