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)


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


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