This is the mail archive of the gdb-patches@sources.redhat.com 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] replace SYMBOL_SOURCE_NAME by SYMBOL_PRINT_NAME


On Tue, 4 Feb 2003 22:06:31 -0500, Daniel Jacobowitz <drow@mvista.com> said:
> On Tue, Feb 04, 2003 at 06:00:34PM -0800, David Carlton wrote:

>> Here's a patch to begin dealing with the issue.  It renames
>> SYMBOL_SOURCE_NAME to SYMBOL_PRINT_NAME and adds a comment making it
>> clear that it's only suitable for output.

> I still don't understand why you want to rename it.  Why not just
> clarify the comment?

Some reasons:

1) The current name is inaccurate.  Sometimes it gives the source name
   of the symbol in question, sometimes it doesn't.  Functions or
   macros should have accurate names: we shouldn't depend on people
   actually reading comments any more than we have to.

2) Some people seem to be under the impression that SYMBOL_SOURCE_NAME
   always gives the demangled name (if there is one); it was used that
   way in an e-mail thread a month or so ago, for example.  Such
   people might well use it incorrectly when working on GDB, unless
   the macro is actually removed.  It's the same theory as Andrew's
   adding 'deprecated' to the names of things he doesn't like.

3) No matter what happens to SYMBOL_SOURCE_NAME, it's definitely
   necessary to introduce a macro that actually gives the source code
   name of a symbol.  It'll be a lot easier to remember to use
   SYMBOL_NATURAL_NAME (or whatever we end up calling it) if there's
   not a macro around called SYMBOL_SOURCE_NAME to compete with it in
   our fallible memories.

David Carlton
carlton@math.stanford.edu


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