From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 448 invoked by alias); 6 Jul 2006 16:30:01 -0000 Received: (qmail 408 invoked by uid 22791); 6 Jul 2006 16:30:00 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 06 Jul 2006 16:29:58 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FyWjh-0006Sg-0Q; Thu, 06 Jul 2006 12:29:53 -0400 Date: Thu, 06 Jul 2006 16:30:00 -0000 From: Daniel Jacobowitz To: PAUL GILLIAM Cc: Joel Brobecker , gdb-patches@sources.redhat.com Subject: Re: [RFA] New substitute-path commands Message-ID: <20060706162952.GB24631@nevyn.them.org> Mail-Followup-To: PAUL GILLIAM , Joel Brobecker , gdb-patches@sources.redhat.com References: <20060705215606.GF3580@adacore.com> <20060705230129.GA1145@nevyn.them.org> <20060706044733.GC673@adacore.com> <1152198199.6282.63.camel@dufur.beaverton.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1152198199.6282.63.camel@dufur.beaverton.ibm.com> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes 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/msg00039.txt.bz2 On Thu, Jul 06, 2006 at 08:03:19AM -0700, PAUL GILLIAM wrote: > > Would you mind making a design proposal? I'm not sure to understand > > what you exactly you are thinking about. I think I understand the fact > > that you would like to have more than one rule because "add" doesn't > > suggest "replace", but I am not sure I get the rest :-/. Right. > How about something like this: > > set substitute-path [] > If this variable is set, is a colon-separated > list of , pairs. When a full path that > has been encoded in the debug information is processed, > each , pair is applied by searching the full > path for the string and replacing it by the > string. If is not used, then the substitute-path > variable is un-set. > > show substitute-path > Display the current list of , pairs. Well, I was thinking like this: (gdb) help set env Set environment variable value to give the program. Arguments are VAR VALUE where VAR is variable name and VALUE is value. VALUES of environment variables are uninterpreted strings. This does not affect the program until the next "run" command. (gdb) help unset env Cancel environment variable VAR for the program. This does not affect the program until the next "run" command. (gdb) help show env The environment to give the program, or one variable's value. With an argument VAR, prints the value of environment variable VAR to give the program being debugged. With no arguments, prints the entire environment to be given to the program. This isn't a list; it's more like a dictionary or hash table. But that ought to work too, right? I don't think we need to support ordered substitutions, like "map /foo/bar to /one but all other /foo to /two". If we need that, we should hook up a scripting language and say "pass all source paths to this python function and use the result". Which is actually a kind of nice idea, but overkill for the moment. There's already a "-gdb-show env", although its output is not very useful to a frontend. We could change that for MI3 if anyone cares. I don't think there's a -gdb-unset, but the parallel is fairly obvious, so we could add one readily. That gives us: set substitute-path FROM TO [We can make it use buildargv for uniform quoting of TO and FROM. I'd recommend that.] unset substitute-path FROM show substitute-path -- Daniel Jacobowitz CodeSourcery