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: Wed, 07 Apr 2010 14:52:59 -0600
- Subject: Re: [RFC] Fix a bug in source file searching
- References: <4BB01CC6.3090402@codesourcery.com> <m3k4stsbi5.fsf@fleche.redhat.com> <4BB2E6F7.4020401@codesourcery.com>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Jie" == Jie Zhang <jie@codesourcery.com> writes:
Tom> Maybe the documentation is just wrong or misleading here. I say that
Tom> because the special entry `$cdir' expands to the compilation directory,
Tom> and you can control where this appears pretty easily.
Jie> Maybe I misunderstood the document. I thought
Jie> comp_dir = /usr/src/foo-1.0
Jie> filename = lib/foo.c
Jie> should be same as
Jie> comp_dir =
Jie> filename = /usr/src/foo-1.0/lib/foo.c
Jie> Obviously GDB treats them differently although I don't know why.
FWIW, I don't really understand the rationale behind why the code works
the way it does.
Further down in the info node it seems clear that it is intentional that
$cdir work this way, though.
If DWARF intends those two cases to be the same, then perhaps the fix
ought to be in dwarf2read.c. I am not sure.
Jie> And I don't know why GCC adds those dir commands in its .gdbinit. I
Jie> will ask on GCC mailing list.
I think adding "dir $cdir" at the end of the list of dir commands would
also get the behavior you want.
Tom