This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: gdb_realpath: dealing with ./ and ../
- From: Daniel Jacobowitz <drow at false dot org>
- To: Aleksandar Ristovski <ARistovski at qnx dot com>
- Cc: gdb at sourceware dot org, Ryan Mansfield <RMansfield at qnx dot com>
- Date: Fri, 4 Jan 2008 07:51:39 -0500
- Subject: Re: gdb_realpath: dealing with ./ and ../
- References: <2F6320727174C448A52CEB63D85D11F40A41@nova.ott.qnx.com>
On Thu, Jan 03, 2008 at 01:25:55PM -0500, Aleksandar Ristovski wrote:
> 1. Problem one - relative NAME and absolute subfile->name case not covered:
I think you're right, but I can't tell for sure.
> 2. Problem two - one physical file is specified with two pathnames.
>
> This is the case I was talking about. To fix it, I would try a combination
> of guessing/normalizing, by inserting code for "second-best" match using
> normalized path (in the same loop) if FILENAME_CMP fails to match and then
> if no perfect match is found, use the second-best match. Not sure what
> happens if there are more than one second-best matches (you say it's going
> to be very rare)... probably at least issue a warning and behave as if no
> match was found? Or resort to getting the first/last second-best match? On a
> second thought, if we go with the second-best match we will never get into a
> situation where two created subfile-s give more two second-best matches...
> it will always be either perfect match or the second-best... this should
> work.
The specific case that's important here is associating the main file
from a dwarf2 CU DIE with the right lines from .debug_line. When we
go to create that subfile we haven't created the other subfiles yet.
So what we need, I think, is to handle this in dwarf2read.c by walking
through the filename / directory table.
--
Daniel Jacobowitz
CodeSourcery