From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3250 invoked by alias); 4 Jan 2008 12:52:01 -0000 Received: (qmail 3201 invoked by uid 22791); 4 Jan 2008 12:52:01 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 04 Jan 2008 12:51:41 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 5F56998121; Fri, 4 Jan 2008 12:51:40 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 429CD9801D; Fri, 4 Jan 2008 12:51:40 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1JAm1T-000789-At; Fri, 04 Jan 2008 07:51:39 -0500 Date: Fri, 04 Jan 2008 12:52:00 -0000 From: Daniel Jacobowitz To: Aleksandar Ristovski Cc: gdb@sourceware.org, Ryan Mansfield Subject: Re: gdb_realpath: dealing with ./ and ../ Message-ID: <20080104125139.GB27161@caradoc.them.org> Mail-Followup-To: Aleksandar Ristovski , gdb@sourceware.org, Ryan Mansfield References: <2F6320727174C448A52CEB63D85D11F40A41@nova.ott.qnx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2F6320727174C448A52CEB63D85D11F40A41@nova.ott.qnx.com> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00018.txt.bz2 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