From f1e6e0721c5115e2e6c60359c9afbdfe927f0431 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 20 Mar 2013 18:33:05 +0000 Subject: 2013-03-20 Jan Kratochvil Tom Tromey PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) : Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) : New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) : Remove fields. : New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX. --- gdb/coffread.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'gdb/coffread.c') diff --git a/gdb/coffread.c b/gdb/coffread.c index 3cc14ce..c390880 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1529,6 +1529,10 @@ static const struct symbol_register_ops coff_register_funcs = { coff_reg_to_regnum }; +/* The "aclass" index for computed COFF symbols. */ + +static int coff_register_index; + static struct symbol * process_coff_symbol (struct coff_symbol *cs, union internal_auxent *aux, @@ -1558,7 +1562,7 @@ process_coff_symbol (struct coff_symbol *cs, lookup_function_type (decode_function_type (cs, cs->c_type, aux, objfile)); - SYMBOL_CLASS (sym) = LOC_BLOCK; + SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK; if (cs->c_sclass == C_STAT || cs->c_sclass == C_THUMBSTAT || cs->c_sclass == C_THUMBSTATFUNC) add_symbol_to_list (sym, &file_symbols); @@ -1575,14 +1579,14 @@ process_coff_symbol (struct coff_symbol *cs, break; case C_AUTO: - SYMBOL_CLASS (sym) = LOC_LOCAL; + SYMBOL_ACLASS_INDEX (sym) = LOC_LOCAL; add_symbol_to_list (sym, &local_symbols); break; case C_THUMBEXT: case C_THUMBEXTFUNC: case C_EXT: - SYMBOL_CLASS (sym) = LOC_STATIC; + SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC; SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value; SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -1592,7 +1596,7 @@ process_coff_symbol (struct coff_symbol *cs, case C_THUMBSTAT: case C_THUMBSTATFUNC: case C_STAT: - SYMBOL_CLASS (sym) = LOC_STATIC; + SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC; SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value; SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -1612,8 +1616,7 @@ process_coff_symbol (struct coff_symbol *cs, case C_GLBLREG: #endif case C_REG: - SYMBOL_CLASS (sym) = LOC_REGISTER; - SYMBOL_REGISTER_OPS (sym) = &coff_register_funcs; + SYMBOL_ACLASS_INDEX (sym) = coff_register_index; SYMBOL_VALUE (sym) = cs->c_value; add_symbol_to_list (sym, &local_symbols); break; @@ -1623,21 +1626,20 @@ process_coff_symbol (struct coff_symbol *cs, break; case C_ARG: - SYMBOL_CLASS (sym) = LOC_ARG; + SYMBOL_ACLASS_INDEX (sym) = LOC_ARG; SYMBOL_IS_ARGUMENT (sym) = 1; add_symbol_to_list (sym, &local_symbols); break; case C_REGPARM: - SYMBOL_CLASS (sym) = LOC_REGISTER; - SYMBOL_REGISTER_OPS (sym) = &coff_register_funcs; + SYMBOL_ACLASS_INDEX (sym) = coff_register_index; SYMBOL_IS_ARGUMENT (sym) = 1; SYMBOL_VALUE (sym) = cs->c_value; add_symbol_to_list (sym, &local_symbols); break; case C_TPDEF: - SYMBOL_CLASS (sym) = LOC_TYPEDEF; + SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF; SYMBOL_DOMAIN (sym) = VAR_DOMAIN; /* If type has no name, give it one. */ @@ -1693,7 +1695,7 @@ process_coff_symbol (struct coff_symbol *cs, case C_STRTAG: case C_UNTAG: case C_ENTAG: - SYMBOL_CLASS (sym) = LOC_TYPEDEF; + SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF; SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN; /* Some compilers try to be helpful by inventing "fake" @@ -2104,7 +2106,7 @@ coff_read_enum_type (int index, int length, int lastsym, SYMBOL_SET_LINKAGE_NAME (sym, obstack_copy0 (&objfile->objfile_obstack, name, strlen (name))); - SYMBOL_CLASS (sym) = LOC_CONST; + SYMBOL_ACLASS_INDEX (sym) = LOC_CONST; SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_VALUE (sym) = ms->c_value; add_symbol_to_list (sym, symlist); @@ -2207,4 +2209,7 @@ _initialize_coffread (void) coff_objfile_data_key = register_objfile_data_with_cleanup (NULL, coff_free_info); + + coff_register_index + = register_symbol_register_impl (LOC_REGISTER, &coff_register_funcs); } -- cgit v1.1