From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11536 invoked by alias); 8 Feb 2008 00:31:00 -0000 Received: (qmail 11512 invoked by uid 22791); 8 Feb 2008 00:30:57 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 08 Feb 2008 00:30:40 +0000 Received: from zps19.corp.google.com (zps19.corp.google.com [172.25.146.19]) by smtp-out.google.com with ESMTP id m180UVPn008551 for ; Fri, 8 Feb 2008 00:30:32 GMT Received: from wa-out-1112.google.com (wafk17.prod.google.com [10.114.187.17]) by zps19.corp.google.com with ESMTP id m180UJDE000381 for ; Thu, 7 Feb 2008 16:30:30 -0800 Received: by wa-out-1112.google.com with SMTP id k17so84097waf.3 for ; Thu, 07 Feb 2008 16:30:30 -0800 (PST) Received: by 10.114.179.1 with SMTP id b1mr6123068waf.143.1202430630848; Thu, 07 Feb 2008 16:30:30 -0800 (PST) Received: by 10.114.13.5 with HTTP; Thu, 7 Feb 2008 16:30:30 -0800 (PST) Message-ID: Date: Fri, 08 Feb 2008 00:31:00 -0000 From: "Doug Evans" To: "Joel Brobecker" , gdb-patches@sourceware.org Subject: Re: [rfc] Use substitute-path for filename portion too In-Reply-To: <20080207181346.GA21484@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080207174645.GA19452@caradoc.them.org> <20080207175658.GB3907@adacore.com> <20080207181346.GA21484@caradoc.them.org> 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: 2008-02/txt/msg00141.txt.bz2 On Feb 7, 2008 10:13 AM, Daniel Jacobowitz wrote: > On Thu, Feb 07, 2008 at 09:56:58AM -0800, Joel Brobecker wrote: > > > + > > > + if (IS_ABSOLUTE_PATH (filename)) > > > { > > > - /* If dirname is NULL, chances are the path is embedded in > > > - the filename. Try the source path substitution on it. */ > > > + /* If filename is absolute path, try the source path > > > + substitution on it. */ > > > > Do we want to restrict this to filenames that are absolute paths? > > Imagine the filename was codesourcery/bar/bar.h and the rewrite was > > s/codesourcery/adacore/, do we want to attempt the rewrite then? > > I suppose we should wait to see a real example of such a situation > > before trying to support it... > > Are such rules supported? I couldn't work out from the manual > what FROM and TO had to be. There is one related issue that I'd like to get fixed. If there are two files foo.c, and I want to set a breakpoint in one of them, there is currently no robust way to do that. If DW_AT_name includes _some_ directory information then it can work, i.e. I can say break bar/foo.c:3 and it will only find bar/foo.c even if there is baz/foo.c. But this only works if DW_AT_name contains the requisite directory instead of DW_AT_comp_dir containing the entire directory. This can be achieved by specifying the path to gcc, e.g. gcc -c -g bar/foo.c -o bar/foo.o instead of (cd bar && gcc -c -g foo.c). I think what should happen is that if I say "break bar/foo.c:3" then gdb should do the appropriate searching even if DW_AT_name is only "foo.c". If there is a collision gdb should probably either give an error or give the user a choice - I can't imagine the user wanting to choose "all" but I suppose that could be an option. In conjunction with that I'd like to have emacs' "C-x space" set the breakpoint in the correct file, but I'm not sure how much work that would involve. [This would extend to other frontends too.]