This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] set/unset/show substitute-path commands (take 2)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]