Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: PAUL GILLIAM <pgilliam@us.ibm.com>
Cc: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] New substitute-path commands
Date: Thu, 06 Jul 2006 16:30:00 -0000	[thread overview]
Message-ID: <20060706162952.GB24631@nevyn.them.org> (raw)
In-Reply-To: <1152198199.6282.63.camel@dufur.beaverton.ibm.com>

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 [<path>]
> 		If this variable is set, <path> is a colon-separated
> 		list of <from>,<to> pairs.  When a full path that
> 		has been encoded in the debug information is processed,
> 		each <from>,<to> pair is applied by searching the full
> 		path for the <from> string and replacing it by the <to>
> 		string.  If <path> is not used, then the substitute-path
> 		variable is un-set.
> 
> 	show substitute-path
> 		Display the current list of <from>,<to> 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


  reply	other threads:[~2006-07-06 16:30 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-05 21:58 Joel Brobecker
2006-07-05 22:49 ` Andreas Schwab
2006-07-05 23:01 ` Daniel Jacobowitz
2006-07-06  4:47   ` Joel Brobecker
2006-07-06 16:07     ` PAUL GILLIAM
2006-07-06 16:30       ` Daniel Jacobowitz [this message]
2006-07-06 21:28         ` Joel Brobecker
2006-07-07  5:22         ` Joel Brobecker
2006-07-07  9:40           ` Eli Zaretskii
2006-07-07 19:12             ` Joel Brobecker
2006-07-08 12:19               ` Eli Zaretskii
2006-07-10  5:40                 ` Joel Brobecker
2006-07-10 19:53                   ` Eli Zaretskii
2006-07-10 21:47                     ` Joel Brobecker
2006-07-10 21:51                       ` Daniel Jacobowitz
2006-07-10 21:56                         ` Joel Brobecker
2006-07-10 21:58                           ` Daniel Jacobowitz
2006-07-11  3:24                       ` Eli Zaretskii
2006-07-07 10:39           ` Andrew STUBBS
2006-07-07 16:12             ` Joel Brobecker
2006-07-07 16:45               ` Andrew STUBBS
2006-07-07 17:20                 ` Joel Brobecker
2006-07-11 12:47           ` Daniel Jacobowitz
2006-07-11 20:30             ` Joel Brobecker
2006-07-11 20:33               ` Daniel Jacobowitz
2006-07-11 20:45                 ` Joel Brobecker
2006-07-11 22:25             ` Joel Brobecker
2006-07-11 22:31               ` Christopher Faylor
2006-07-11 22:50               ` Daniel Jacobowitz
2006-07-11 23:00                 ` Joel Brobecker
2006-07-12  3:22                 ` Eli Zaretskii
2006-07-12  3:47                   ` Daniel Jacobowitz
2006-07-12  4:50                     ` Joel Brobecker
2006-07-12 14:09                       ` Daniel Jacobowitz
2006-07-06  3:31 ` Eli Zaretskii
2006-07-06  4:46   ` Joel Brobecker
2006-07-06  9:36 ` Andrew STUBBS
2006-07-06 21:19 ` Jason Molenda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060706162952.GB24631@nevyn.them.org \
    --to=drow@false.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=pgilliam@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox