This is the mail archive of the
mailing list for the GDB project.
Re: [RFA] New substitute-path commands
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb at sources dot redhat dot com
- Date: Thu, 13 Jul 2006 14:27:46 -0700
- Subject: Re: [RFA] New substitute-path commands
- References: <20060707052219.GA971@adacore.com> <firstname.lastname@example.org> <20060707191203.GD971@adacore.com> <email@example.com> <20060710054027.GF971@adacore.com> <firstname.lastname@example.org> <20060710214706.GA2390@adacore.com> <20060710215114.GA31444@nevyn.them.org> <20060710215630.GB2390@adacore.com> <20060710215839.GA31772@nevyn.them.org>
[moving back to GDB - summary: On gdb-patches, I was convinced by the
feedback that I received that I should spend the effort of implementing
multiple rewrite rules immediately. I have a question about that].
The interface is as follow:
(gdb) set substitute-path FROM TO
(gdb) unset substitute-path [FROM]
(gdb) show substitute-path
The "set" command will add a substitution rule.
My question is the following: When you enter a second rule, should it
take precedence over the first one you entered? More generally, should
the substitution rules entered last be used first, or the opposite?
I'm 50-50 on this:
. With first-entered/first-used, you enter the rules following the
logic "if blah, then replace with [...]; else if bloh, then replace
with [...]; else if [...], then [...]". In other words, you enter
the rules in the same order you would write a "program". It seems
. With last-entered/first-used, it's possible to override previous
entries without having to delete the previous rules. Not so natural
to "program", though.
Actually, as I'm writing this, I now favor first-entered/first-used.
One can delete a rule if he wants to override it. It's marginal anyway.
What do you guys think?