"Jie" == Jie Zhang<jie@codesourcery.com> writes:
Jie> I found this bug when debugging GCC. (Actually I don't know if this is
Jie> a bug in GDB code or documentation.) I prepared a patch so you can
Jie> easily comment.
Thanks.
Jie> And .gdbinit file in GCC build directory has
Jie> dir ../../../svn/trunk/gcc/fortran
Jie> So it looked GDB searched pathes added by dir command first.
Jie> But the GDB documentation says in "9.5 Specifying Source Directories":
Jie> [quote]
Jie> For example, suppose an executable references the file
Jie> /usr/src/foo-1.0/lib/foo.c, and our source path is /mnt/cross. The
Jie> file is first looked up literally; if this fails,
Jie> /mnt/cross/usr/src/foo-1.0/lib/foo.c is tried; if this fails,
Jie> /mnt/cross/foo.c is opened; if this fails, an error message is
Jie> printed.
Jie> [/quote]
Maybe the documentation is just wrong or misleading here. I say that
because the special entry `$cdir' expands to the compilation directory,
and you can control where this appears pretty easily.