This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Fix a bug in source file searching


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]