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
LOC_CONST_BYTES,
- /* Value is at SYMBOL_VALUE offset from the current value of
- register number SYMBOL_BASEREG. This exists mainly for the same
- things that LOC_LOCAL and LOC_ARG do; but we need to do this
- instead because on 88k DWARF gives us the offset from the
- frame/stack pointer, rather than the offset from the "canonical
- frame address" used by COFF, stabs, etc., and we don't know how
- to convert between these until we start examining prologues.
-
- Note that LOC_BASEREG is much less general than a DWARF expression.
- We don't need the generality (at least not yet), and storing a general
- DWARF expression would presumably take up more space than the existing
- scheme. */
-
- LOC_BASEREG,
-
- /* Same as LOC_BASEREG but it is an argument. */
-
- LOC_BASEREG_ARG,
-
/* Value is at fixed address, but the address of the variable has
to be determined from the minimal symbol table whenever the
variable is referenced.
/* 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? */
const struct symbol_ops *ops;
- /* Some symbols require additional information to be recorded on a
- per-symbol basis. Stash those values here. */
-
- union
- {
- /* Used by LOC_BASEREG and LOC_BASEREG_ARG. */
- short basereg;
- /* An arbitrary data pointer. 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
- 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
- code --- specifically, the location expression for the frame
- base for this function. */
- /* FIXME drow/2003-02-21: For the LOC_BLOCK case, it might be better
- to add a magic symbol to the block containing this information,
- or to have a generic debug info annotation slot for symbols. */
- void *ptr;
- }
- aux_value;
+ /* 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 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
+ code --- specifically, the location expression for the frame
+ base for this function. */
+ /* FIXME drow/2003-02-21: For the LOC_BLOCK case, it might be better
+ to add a magic symbol to the block containing this information,
+ or to have a generic debug info annotation slot for symbols. */
+
+ void *aux_value;
struct symbol *hash_next;
};
#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
-#define SYMBOL_BASEREG(symbol) (symbol)->aux_value.basereg
#define SYMBOL_OPS(symbol) (symbol)->ops
-#define SYMBOL_LOCATION_BATON(symbol) (symbol)->aux_value.ptr
+#define SYMBOL_LOCATION_BATON(symbol) (symbol)->aux_value
\f
/* A partial_symbol records the name, domain, and address class of
symbols whose types we have not parsed yet. For functions, it also