aboutsummaryrefslogtreecommitdiff
path: root/gdb/mdebugread.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-06-04 12:28:39 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-06-04 12:28:39 +0000
commit768a979c31bbe51154e3363c1061c45aa9cd937f (patch)
tree8c5f21f3ae813fe4193b79e851fa6bef842f0d1c /gdb/mdebugread.c
parente36aef42209e57273a78919b81cc7ae62d32107a (diff)
downloadgdb-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/mdebugread.c')
-rw-r--r--gdb/mdebugread.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 109e0cf..78b92a0 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -528,6 +528,16 @@ add_pending (FDR *fh, char *sh, struct type *t)
SYMR's handled (normally one). */
static int
+mdebug_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
+{
+ return gdbarch_ecoff_reg_to_regnum (gdbarch, SYMBOL_VALUE (sym));
+}
+
+static const struct symbol_register_ops mdebug_register_funcs = {
+ mdebug_reg_to_regnum
+};
+
+static int
parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
struct section_offsets *section_offsets, struct objfile *objfile)
{
@@ -607,16 +617,16 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
goto data;
case stLocal: /* local variable, goes into current block */
+ b = top_stack->cur_block;
+ s = new_symbol (name);
+ SYMBOL_VALUE (s) = svalue;
if (sh->sc == scRegister)
{
class = LOC_REGISTER;
- svalue = gdbarch_ecoff_reg_to_regnum (current_gdbarch, svalue);
+ SYMBOL_REGISTER_OPS (s) = &mdebug_register_funcs;
}
else
class = LOC_LOCAL;
- b = top_stack->cur_block;
- s = new_symbol (name);
- SYMBOL_VALUE (s) = svalue;
data: /* Common code for symbols describing data */
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
@@ -649,7 +659,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
case scRegister:
/* Pass by value in register. */
SYMBOL_CLASS (s) = LOC_REGISTER;
- svalue = gdbarch_ecoff_reg_to_regnum (current_gdbarch, svalue);
+ SYMBOL_REGISTER_OPS (s) = &mdebug_register_funcs;
break;
case scVar:
/* Pass by reference on stack. */
@@ -658,7 +668,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
case scVarRegister:
/* Pass by reference in register. */
SYMBOL_CLASS (s) = LOC_REGPARM_ADDR;
- svalue = gdbarch_ecoff_reg_to_regnum (current_gdbarch, svalue);
+ SYMBOL_REGISTER_OPS (s) = &mdebug_register_funcs;
break;
default:
/* Pass by value on stack. */