From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6992 invoked by alias); 11 Jul 2006 20:30:49 -0000 Received: (qmail 6983 invoked by uid 22791); 11 Jul 2006 20:30:48 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 11 Jul 2006 20:30:46 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id EA06048CEA6 for ; Tue, 11 Jul 2006 16:30:43 -0400 (EDT) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13471-01-9 for ; Tue, 11 Jul 2006 16:30:43 -0400 (EDT) Received: from takamaka.act-europe.fr (S0106000625ac85e1.vs.shawcable.net [70.71.27.110]) by nile.gnat.com (Postfix) with ESMTP id 6964E48CE4E for ; Tue, 11 Jul 2006 16:30:43 -0400 (EDT) Received: by takamaka.act-europe.fr (Postfix, from userid 507) id AC6CE47EFA; Tue, 11 Jul 2006 13:30:42 -0700 (PDT) Date: Tue, 11 Jul 2006 20:30:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: Re: [RFA] New substitute-path commands Message-ID: <20060711203042.GA1262@adacore.com> References: <20060705215606.GF3580@adacore.com> <20060705230129.GA1145@nevyn.them.org> <20060706044733.GC673@adacore.com> <1152198199.6282.63.camel@dufur.beaverton.ibm.com> <20060706162952.GB24631@nevyn.them.org> <20060707052219.GA971@adacore.com> <20060711124739.GA18324@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060711124739.GA18324@nevyn.them.org> User-Agent: Mutt/1.4i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00093.txt.bz2 Hi Daniel, > > +static char * > > +xrewrite_source_path (const char *path) > > Why the x? Is it because it allocates? I believe we actually use the > x to indicate replacements for system functionality which have a more > reliable error behavior; so please don't use it here. Oops, sorry, misunderstanding on my part. I just removed the x. I was confused because of xfullpath... > > + /* Search for the first occurence of SUBSTITUTE_PATH_FROM. > > + No substitution needed of not found. */ > > If not found. Fixed. Thanks for catching it. > > + from_start = strstr (path, substitute_path_from); > > This is the part of the patch I'm not sure about. I have two > questions. > > 1. Should the substitution rule be anchored to the beginning of the > pathname? > > 2. Should the end of the rule be anchored to end of string or > directory separator? > > I think #1 should be yes, and #2 should probably be yes, but I'm less > certain about it. What do you think? (1): Anchoring means that we replace from the start right, so no search within the path, just a strncmp, correct? It might be simpler, but on the other hand less flexible. I would personally prefer to have it non anchored, but it's only a mild preference and I don't know of any situation where having the replacement rule anchored would cause us any problem in practice. (2): I am personally not against this, and it would fit what we would do at AdaCore, but I don't see this as a necessary constraint that the debugger should check. Again, a mild preference. What do others think? I'm happy to implement whatever the group thinks is best. Thanks for the review Daniel, -- Joel