functions, unless the callers are changed to pass in the ginfo
field only, instead of the SYMBOL parameter. */
-#define DEPRECATED_SYMBOL_NAME(symbol) (symbol)->ginfo.name
#define SYMBOL_VALUE(symbol) (symbol)->ginfo.value.ivalue
#define SYMBOL_VALUE_ADDRESS(symbol) (symbol)->ginfo.value.address
#define SYMBOL_VALUE_BYTES(symbol) (symbol)->ginfo.value.bytes
extern void symbol_init_language_specific (struct general_symbol_info *symbol,
enum language language);
+/* Set just the linkage name of a symbol; do not try to demangle
+ it. Used for constructs which do not have a mangled name,
+ e.g. struct tags. Unlike SYMBOL_SET_NAMES, linkage_name must
+ be terminated and already on the objfile's obstack. */
+#define SYMBOL_SET_LINKAGE_NAME(symbol,linkage_name) \
+ (symbol)->ginfo.name = (linkage_name)
+
+/* Set the linkage and natural names of a symbol, by demangling
+ the linkage name. */
#define SYMBOL_SET_NAMES(symbol,linkage_name,len,objfile) \
symbol_set_names (&(symbol)->ginfo, linkage_name, len, objfile)
extern void symbol_set_names (struct general_symbol_info *symbol,
want to know what the linker thinks the symbol's name is. Use
SYMBOL_PRINT_NAME for output. Use SYMBOL_DEMANGLED_NAME if you
specifically need to know whether SYMBOL_NATURAL_NAME and
- SYMBOL_LINKAGE_NAME are different. Don't use
- DEPRECATED_SYMBOL_NAME at all: instances of that macro should be
- replaced by SYMBOL_NATURAL_NAME, SYMBOL_LINKAGE_NAME, or perhaps
- SYMBOL_PRINT_NAME. */
+ SYMBOL_LINKAGE_NAME are different. */
/* Return SYMBOL's "natural" name, i.e. the name that it was called in
the original source code. In languages like C++ where symbols may
/* Return SYMBOL's name from the point of view of the linker. In
languages like C++ where symbols may be mangled for ease of
manipulation by the linker, this is the mangled name; otherwise,
- it's the same as SYMBOL_NATURAL_NAME. This is currently identical
- to DEPRECATED_SYMBOL_NAME, but please use SYMBOL_LINKAGE_NAME when
- appropriate: it conveys the additional semantic information that
- you really have thought about the issue and decided that you mean
- SYMBOL_LINKAGE_NAME instead of SYMBOL_NATURAL_NAME. */
+ it's the same as SYMBOL_NATURAL_NAME. */
#define SYMBOL_LINKAGE_NAME(symbol) (symbol)->ginfo.name
that symbol. If no demangled name exists, return NULL. */
#define SYMBOL_DEMANGLED_NAME(symbol) \
(symbol_demangled_name (&(symbol)->ginfo))
-extern char *symbol_demangled_name (struct general_symbol_info *symbol);
+extern char *symbol_demangled_name (const struct general_symbol_info *symbol);
/* Macro that returns a version of the name of a symbol that is
suitable for output. In C++ this is the "demangled" form of the
LOC_STATIC,
- /* Value is in register. SYMBOL_VALUE is the register number. */
+ /* Value is in register. SYMBOL_VALUE is the register number.
+
+ For some symbol formats (stabs, for some compilers at least),
+ the compiler generates two symbols, an argument and a register.
+ In some cases we combine them to a single LOC_REGISTER in symbol
+ reading, but currently not for all cases (e.g. it's passed on the
+ stack and then loaded into a register). */
LOC_REGISTER,
LOC_REF_ARG,
- /* Value is in register number SYMBOL_VALUE. Just like LOC_REGISTER
- except this is an argument. Probably the cleaner way to handle
- this would be to separate address_class (which would include
- separate ARG and LOCAL to deal with the frame's arguments
- (get_frame_args_address) versus the frame's locals
- (get_frame_locals_address), and an is_argument flag.
-
- For some symbol formats (stabs, for some compilers at least),
- the compiler generates two symbols, an argument and a register.
- In some cases we combine them to a single LOC_REGPARM in symbol
- reading, but currently not for all cases (e.g. it's passed on the
- stack and then loaded into a register). */
-
- LOC_REGPARM,
-
- /* Value is in specified register. Just like LOC_REGPARM except the
+ /* Value is in specified register. Just like LOC_REGISTER except the
register holds the address of the argument instead of the argument
itself. This is currently used for the passing of structs and unions
on sparc and hppa. It is also used for call by reference where the
/* The variable's address is computed by a set of location
functions (see "struct symbol_ops" below). */
LOC_COMPUTED,
-
- /* Same as LOC_COMPUTED, but for function arguments. */
- LOC_COMPUTED_ARG
};
/* The methods needed to implement a symbol class. These methods can
ENUM_BITFIELD(address_class) aclass : 6;
+ /* Whether this is an argument. */
+
+ unsigned is_argument : 1;
+
/* Line number of definition. FIXME: Should we really make the assumption
that nobody will try to debug files longer than 64K lines? What about
machine generated programs? */
/* An arbitrary data pointer, allowing symbol readers to record
additional information on a per-symbol basis. Note that this data
must be allocated using the same obstack as the symbol itself. */
- /* So far it is only used by LOC_COMPUTED and LOC_COMPUTED_ARG to
+ /* So far it is only used by LOC_COMPUTED to
find the location information. For a LOC_BLOCK symbol
for a function in a compilation unit compiled with DWARF 2
information, this is information used internally by the DWARF 2
#define SYMBOL_DOMAIN(symbol) (symbol)->domain
#define SYMBOL_CLASS(symbol) (symbol)->aclass
+#define SYMBOL_IS_ARGUMENT(symbol) (symbol)->is_argument
#define SYMBOL_TYPE(symbol) (symbol)->type
#define SYMBOL_LINE(symbol) (symbol)->line
#define SYMBOL_SYMTAB(symbol) (symbol)->symtab