This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] set/unset/show substitute-path commands (take 2)
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Andrew STUBBS <andrew dot stubbs at st dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Mon, 17 Jul 2006 10:09:33 -0700
- Subject: Re: [RFA] set/unset/show substitute-path commands (take 2)
- References: <20060715054902.GD1393@adacore.com> <44BB586E.7040107@st.com>
> >+ /* Otherwise, skip to the last rule in our list and then append
> >+ the new rule. */
> >+
> >+ last = substitute_path_rules;
> >+ while (last->next != NULL)
> >+ last = last->next;
> >+
> >+ last->next = rule;
>
> What if the user tries to substitute the same path twice? I think it
> should delete the old rule (maybe query) and add the new one to the end.
I think we are getting dragged into over-engineering this feature.
If documentation is clear enough that it just adds, then he knows
he has to remove the previous rule before he introduces the new one.
That's plenty good enough in my opinion.
> >+ /* If no rule matching the argument was found, then print an error
> >+ message to the user. */
> >+
> >+ if (!rule_found)
> >+ {
> >+ if (from != NULL)
> >+ error (_("No substitution rule defined for `%s'"), from);
> >+ else
> >+ error (_("No substitution rule defined"));
>
> Is the latter case really an error? I would have thought not, since
> there's no way for a script to check the status before giving the command.
I personally think so, but I don't have a strong opinion on this.
The error can be removed if this is the consensus.
--
Joel