* 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

@@ -347,11 +347,11 @@ symbol_read_needs_frame (struct symbol *sym)
we failed to consider one. */
case LOC_COMPUTED:
/* FIXME: cagney/2004-01-26: It should be possible to
unconditionally call the SYMBOL_OPS method when available.
unconditionally call the SYMBOL_COMPUTED_OPS method when available.
Unfortunately DWARF 2 stores the frame-base (instead of the
function) location in a function's symbol. Oops! For the
moment enable this when/where applicable. */
return SYMBOL_OPS (sym)->read_needs_frame (sym);
return SYMBOL_COMPUTED_OPS (sym)->read_needs_frame (sym);
case LOC_REGISTER:
case LOC_ARG:
@@ -486,7 +486,8 @@ read_var_value (struct symbol *var, struct frame_info *frame)
case LOC_REGISTER:
case LOC_REGPARM_ADDR:
{
int regno = SYMBOL_VALUE (var);
int regno = SYMBOL_REGISTER_OPS (var)
->register_number (var, get_frame_arch (frame));
struct value *regval;
if (SYMBOL_CLASS (var) == LOC_REGPARM_ADDR)
@@ -514,11 +515,11 @@ read_var_value (struct symbol *var, struct frame_info *frame)
case LOC_COMPUTED:
/* FIXME: cagney/2004-01-26: It should be possible to
unconditionally call the SYMBOL_OPS method when available.
unconditionally call the SYMBOL_COMPUTED_OPS method when available.
Unfortunately DWARF 2 stores the frame-base (instead of the
function) location in a function's symbol. Oops! For the
moment enable this when/where applicable. */
return SYMBOL_OPS (var)->read_variable (var, frame);
return SYMBOL_COMPUTED_OPS (var)->read_variable (var, frame);
case LOC_UNRESOLVED:
{