* symtab.h: Rename SYMBOL_OPS to SYMBOL_COMPUTED_OPS.

* ax-gdb.c (gen_var_ref): Likewise.
	* findvar.c (read_var_value, symbol_read_needs_frame): Likewise.
	* printcmd.c (address_info): Likewise.
	* dwarf2loc.c (dwarf_expr_frame_base): Likewise.
	* dwarf2read.c (dwarf2_symbol_mark_computed): Likewise.
	* symtab.h: Rename struct symbol_ops to struct symbol_computed_ops.
	* dwarf2loc.h: Likewise.
	* dwarf2loc.c (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Likewise.

	* symtab.h: (struct symbol_register_ops): New struct definition.
	(struct symbol): Make "ops" member a union of symbol_computed_ops and
	symbol_register_ops callback pointers.
	(SYMBOL_REGISTER_OPS): New macro.
	* tracepoint.c: Include "objfiles.h".
	(scope_info, collect_symbol): Use SYMBOL_REGISTER_OPS register_number
	callback to retrieve register numbers.
	* ax-gdb.c (gen_var_ref): Likewise.
	* findvar.c (read_var_value): Likewise.
	* printcmd.c (address_info): Likewise.

	* coffread.c (coff_reg_to_regnum): New function.
	(coff_register_funcs): New static variable.
	(process_coff_symbol): Do not call gdbarch_sdb_reg_to_regnum.
	Install SYMBOL_REGISTER_OPS callbacks.
	* mdebugread.c (mdebug_reg_to_regnum): New function.
	(mdebug_register_funcs): New static variable.
	(parse_symbol): Do not call gdbarch_ecoff_reg_to_regnum.
	Install SYMBOL_REGISTER_OPS callbacks.
	* stabsread.c (stab_reg_to_regnum): New function.
	(stab_register_funcs): New static variable.
	(define_symbol): Do not call gdbarch_stab_reg_to_regnum.
	Install SYMBOL_REGISTER_OPS callbacks.
This commit is contained in:
Ulrich Weigand 2009-06-04 12:28:39 +00:00
parent e36aef4220
commit 768a979c31
12 changed files with 181 additions and 82 deletions

View file

@ -414,7 +414,11 @@ enum address_class
LOC_STATIC,
/* Value is in register. SYMBOL_VALUE is the register number.
/* Value is in register. SYMBOL_VALUE is the register number
in the original debug format. SYMBOL_REGISTER_OPS holds a
function that can be called to transform this into the
actual register number this represents in a specific target
architecture (gdbarch).
For some symbol formats (stabs, for some compilers at least),
the compiler generates two symbols, an argument and a register.
@ -488,16 +492,16 @@ enum address_class
LOC_OPTIMIZED_OUT,
/* The variable's address is computed by a set of location
functions (see "struct symbol_ops" below). */
functions (see "struct symbol_computed_ops" below). */
LOC_COMPUTED,
};
/* The methods needed to implement a symbol class. These methods can
/* The methods needed to implement LOC_COMPUTED. These methods can
use the symbol's .aux_value for additional per-symbol information.
At present this is only used to implement location expressions. */
struct symbol_ops
struct symbol_computed_ops
{
/* Return the value of the variable SYMBOL, relative to the stack
@ -527,6 +531,13 @@ struct symbol_ops
struct axs_value * value);
};
/* Functions used with LOC_REGISTER and LOC_REGPARM_ADDR. */
struct symbol_register_ops
{
int (*register_number) (struct symbol *symbol, struct gdbarch *gdbarch);
};
/* This structure is space critical. See space comments at the top. */
struct symbol
@ -571,7 +582,14 @@ struct symbol
/* Method's for symbol's of this class. */
/* NOTE: cagney/2003-11-02: See comment above attached to "aclass". */
const struct symbol_ops *ops;
union
{
/* Used with LOC_COMPUTED. */
const struct symbol_computed_ops *ops_computed;
/* Used with LOC_REGISTER and LOC_REGPARM_ADDR. */
const struct symbol_register_ops *ops_register;
} ops;
/* An arbitrary data pointer, allowing symbol readers to record
additional information on a per-symbol basis. Note that this data
@ -598,7 +616,8 @@ struct symbol
#define SYMBOL_TYPE(symbol) (symbol)->type
#define SYMBOL_LINE(symbol) (symbol)->line
#define SYMBOL_SYMTAB(symbol) (symbol)->symtab
#define SYMBOL_OPS(symbol) (symbol)->ops
#define SYMBOL_COMPUTED_OPS(symbol) (symbol)->ops.ops_computed
#define SYMBOL_REGISTER_OPS(symbol) (symbol)->ops.ops_register
#define SYMBOL_LOCATION_BATON(symbol) (symbol)->aux_value
/* A partial_symbol records the name, domain, and address class of