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]

[PATCH] clarify SYMBOL_* macros


It was pointed out to me that it is not immediately obvious that you
still need macros like the SYMBOL_DEMANGLED_NAME, due to the need to
accept a parameter of different types. I hope this comment makes it
clearer.

Elena

2002-10-23  Elena Zannoni  <ezannoni@redhat.com>

	* symtab.h: Update comment.


Index: symtab.h
===================================================================
RCS file: /cvs/uberbaum/gdb/symtab.h,v
retrieving revision 1.48
diff -u -p -r1.48 symtab.h
--- symtab.h	23 Oct 2002 20:09:28 -0000	1.48
+++ symtab.h	23 Oct 2002 23:23:05 -0000
@@ -126,6 +126,14 @@ struct general_symbol_info
 
 extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *);
 
+/* Note that all the following SYMBOL_* macros are used with the
+   SYMBOL argument being either a partial symbol, a minimal symbol or
+   a full symbol.  All three types have a ginfo field.  In particular
+   the SYMBOL_INIT_LANGUAGE_SPECIFIC, SYMBOL_INIT_DEMANGLED_NAME,
+   SYMBOL_DEMANGLED_NAME macros cannot be entirely substituted by
+   functions, unless the callers are changed to pass in the ginfo
+   field only, instead of the SYMBOL parameter.  */
+
 #define SYMBOL_NAME(symbol)		(symbol)->ginfo.name
 #define SYMBOL_VALUE(symbol)		(symbol)->ginfo.value.ivalue
 #define SYMBOL_VALUE_ADDRESS(symbol)	(symbol)->ginfo.value.address


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