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:
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.

I'm not sure that follows the principle of least surprise. You've already written the code to find and delete entries.


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.

I can just imagine myself having a script which deliberately clears the list, but then dies because it was already clear. FWIW, the 'directory' command does not complain if you try to reinitialise an empty source path.


(I suppose the workaround would be to define an arbitrary rule and then clear them all).

Andrew


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