diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2009-06-04 12:28:39 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2009-06-04 12:28:39 +0000 |
commit | 768a979c31bbe51154e3363c1061c45aa9cd937f (patch) | |
tree | 8c5f21f3ae813fe4193b79e851fa6bef842f0d1c /gdb/symtab.h | |
parent | e36aef42209e57273a78919b81cc7ae62d32107a (diff) | |
download | gdb-768a979c31bbe51154e3363c1061c45aa9cd937f.zip gdb-768a979c31bbe51154e3363c1061c45aa9cd937f.tar.gz gdb-768a979c31bbe51154e3363c1061c45aa9cd937f.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r-- | gdb/symtab.h | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h index f7689f6..18304b3 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -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 |