Re: [Patch] Improve path lookup of absolute source file

Tom Tromey
2009-04-24T14:52:39Z

>>>>> "Francois" == Francois Rigault <francois.rigault@amadeus.com> writes:

This particular problem has 3 pending patches... the one from this
thread, and also:

http://sourceware.org/ml/gdb-patches/2008-06/msg00027.html
http://sourceware.org/ml/gdb-patches/2009-01/msg00325.html

Of these I prefer the approach taken by the patch I'm replying to,
because it solves the symlink problem. The first patch also changes
lookup_symtab, so I'm not sure whether the patch I'm responding to is
sufficient.

Francois> In the patch below, the file name lookup is done in 2 times :
Francois> The first pass will try to resolve the file name only if basenames
Francois> match. The second pass will try to resolve the file name as before,
Francois> resolving all the files path from the symtab.

This sounds reasonable to me. It may change the order in which files
are found, but I don't think we provide any guarantees about that.

Do you have a copyright assignment on file? This patch is big enough
to require one.

The patch itself looks reasonable, though it has a number of
formatting nits to pick. We can work these out once the paperwork
issue is dealt with.

Alternatively, if one of the other patch submitters wants to rewrite
his patch to take the 2-pass approach, that would be fine too.

It seems to me that the 2-pass approach means that a typo in the
command will still make gdb pause for a long time while it searches
all the psymtabs (and fails). Perhaps the loop needs a QUIT? I don't
know if that is safe here or not, though the calls to make_cleanup
make me think that is probably is.

Tom