[rfa] replace SYMBOL_SOURCE_NAME by SYMBOL_PRINT_NAME
Daniel Jacobowitz
drow@mvista.com
Wed Feb 5 03:06:00 GMT 2003
On Tue, Feb 04, 2003 at 06:00:34PM -0800, David Carlton wrote:
> Right now, GDB has a macro called SYMBOL_SOURCE_NAME that gives you
> the demangled name of a symbol if 'demangle' is true, and the mangled
> name if 'demangle' is false.
>
> It's mostly used in output routines; its use there is entirely
> appropriate. It's sometimes used for internal purposes instead; its
> use there is not nearly as appropriate. (E.g. what if you sort or
> hash a table when demangle is false and then look up something in a
> table when demangle is true?) The internal uses should all be
> replaced by a different macro (to appear in a future use) which
> doesn't depend on the value of demangle.
>
> 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. It changes all occurrences
> of the macro in a completely mechanical way; in a later patch, I'll go
> through all the occurrences to see if they look appropriate or not.
>
> The only part of the patch worth looking at is the symtab.h part,
> which I've listed first; the rest should (I hope!) be purely
> mechanical.
>
> Tested on i686-pc-linux-gnu/GCC3.1/DWARF-2, and should be obviously
> correct if you accept the underlying idea (and if I didn't screw up
> with my keyboard macros in Emacs). OK to commit?
I still don't understand why you want to rename it. Why not just
clarify the comment?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
More information about the Gdb-patches
mailing list