Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew STUBBS <andrew.stubbs@st.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] set/unset/show substitute-path commands (take 2)
Date: Mon, 17 Jul 2006 09:29:00 -0000	[thread overview]
Message-ID: <44BB586E.7040107@st.com> (raw)
In-Reply-To: <20060715054902.GD1393@adacore.com>

Joel Brobecker wrote:
> +  /* If the list of rules are empty, then insert the new rule
> +     at the head of the list.  */
> +
> +  if (substitute_path_rules == NULL)
> +    {
> +      substitute_path_rules = rule;
> +      return;
> +    }
> +
> +  /* 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.

> +  /* 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.

Andrew


  parent reply	other threads:[~2006-07-17  9:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-15  5:49 Joel Brobecker
2006-07-17  9:19 ` Andrew STUBBS
2006-07-17  9:29 ` Andrew STUBBS [this message]
2006-07-17 17:09   ` Joel Brobecker
2006-07-17 17:32     ` Daniel Jacobowitz
2006-07-17 17:46     ` Andrew STUBBS
2006-07-19 18:15 ` Joel Brobecker
2006-07-24 20:25   ` Daniel Jacobowitz
2006-07-25 16:28     ` Joel Brobecker
2006-07-25 16:38       ` Daniel Jacobowitz
2006-08-08 22:19         ` Joel Brobecker

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=44BB586E.7040107@st.com \
    --to=andrew.stubbs@st.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sources.redhat.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