This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Fix a bug in source file searching
- From: Tom Tromey <tromey at redhat dot com>
- To: Jie Zhang <jie at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 30 Mar 2010 16:14:26 -0600
- Subject: Re: [RFC] Fix a bug in source file searching
- References: <4BB01CC6.3090402@codesourcery.com>
- Reply-to: tromey at redhat dot com
>>>>> "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.
Tom