From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 317 invoked by alias); 17 Dec 2007 00:01:51 -0000 Received: (qmail 305 invoked by uid 22791); 17 Dec 2007 00:01:51 -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; Mon, 17 Dec 2007 00:01:39 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id AD13F98129; Mon, 17 Dec 2007 00:01:37 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 8DF789811F; Mon, 17 Dec 2007 00:01:37 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1J43QO-00038M-Qw; Sun, 16 Dec 2007 19:01:36 -0500 Date: Mon, 17 Dec 2007 00:44:00 -0000 From: Daniel Jacobowitz To: Douglas Evans Cc: gdb-patches@sourceware.org Subject: Re: RFC: example fix to pr 2360 Message-ID: <20071217000136.GA9212@caradoc.them.org> Mail-Followup-To: Douglas Evans , gdb-patches@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00245.txt.bz2 On Thu, Nov 15, 2007 at 03:55:41PM -0800, Douglas Evans wrote: > To make things more concrete to what I was refering to in > http://sourceware.org/ml/gdb/2007-11/msg00138.html I've filed pr 2360, > and attached is an example fix. > > I'm not sufficiently happy with it that I'd submit it RFA, but that's > mostly because of perceived objections to the use of xfullpath. Maybe > the thing to do is write a canonicalizer like what is done in > cli-cmds.c:cd_command (and presumably move it to a more generic > place). > > Suggestions? Why should we canonicalize paths at all? Definitely the use of xfullpath is suspect on anything read from debug information. Those are paths on some system where the program was compiled, not paths on the system where GDB is running; there are a variety of commands like "dir" and "set substitute-path" designed to map the one to the other, and this goes behind their back to look at the filesystem. The root of the problem seems to me to be inconsistent information in the source file. Your debug information describes two files, e.g. /tmp/bug2.c and //tmp/bug2.c (one via DW_AT_comp_dir, the other via .debug_line). There's nothing like an inode in the DWARF, so GDB has reasonably assumed that they are different files. Then you say "bug2.c:2" and it happens to pick the one you didn't mean. Are there any examples of this without #line? -- Daniel Jacobowitz CodeSourcery