summaryrefslogtreecommitdiff
path: root/gdb/symtab.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-04-08 20:18:10 +0000
committerTom Tromey <tromey@redhat.com>2013-04-08 20:18:10 +0000
commit98e1b3e3b904aca13666570f9480066f01984daf (patch)
tree91a9c776be313067db107af610f3a91f4971b36b /gdb/symtab.h
parent79b7922fc17b9346596842f51f44c2e68d8c661d (diff)
downloadgdb-98e1b3e3b904aca13666570f9480066f01984daf.tar.gz
PR symtab/8424:
* blockframe.c (find_pc_partial_function_gnu_ifunc): Check SYMBOL_SECTION, not SYMBOL_OBJ_SECTION. * breakpoint.c (resolve_sal_pc): Update. * elfread.c (elf_gnu_ifunc_record_cache): Update. * findvar.c (struct minsym_lookup_data) <objfile>: New field. (minsym_lookup_iterator_cb): Use it. (default_read_var_value): Update. * hppa-hpux-tdep.c (hppa64_hpux_in_solib_call_trampoline): Update. * infcmd.c (jump_command): Update. * linespec.c (minsym_found): Update. * maint.c (maintenance_translate_address): Update. * minsyms.c (lookup_minimal_symbol_by_pc_section_1): Update. (prim_record_minimal_symbol_full): Don't set SYMBOL_OBJ_SECTION. * parse.c (write_exp_msymbol): Update. * printcmd.c (address_info): Update. * psymtab.c (find_pc_sect_psymbol): Update. (fixup_psymbol_section): Check SYMBOL_SECTION, not SYMBOL_OBJ_SECTION. (add_psymbol_to_bcache): Correctly initialize SYMBOL_SECTION. Don't initialize SYMBOL_OBJ_SECTION. * spu-tdep.c (spu_catch_start): Update. * stabsread.c (define_symbol): Don't set SYMBOL_SECTION. * symmisc.c (dump_msymbols, print_symbol): Update. * symtab.c (fixup_section): Don't set 'obj_section'. Change how fallback section is computed. (fixup_symbol_section): Update. (find_pc_sect_symtab, find_function_start_sal, skip_prologue_sal): Update. (allocate_symbol, initialize_symbol, allocate_template_symbol): Initialize SYMBOL_SECTION. * symtab.h (struct general_symbol_info) <section>: Update comment. <obj_section>: Remove. (SYMBOL_OBJ_SECTION): Add 'objfile' argument. Rewrite. (SYMBOL_OBJFILE): New macro.
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r--gdb/symtab.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index a1da44be9cb..29a12ff5fe9 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -165,16 +165,9 @@ struct general_symbol_info
/* Which section is this symbol in? This is an index into
section_offsets for this objfile. Negative means that the symbol
- does not get relocated relative to a section.
- Disclaimer: currently this is just used for xcoff, so don't
- expect all symbol-reading code to set it correctly (the ELF code
- also tries to set it correctly). */
+ does not get relocated relative to a section. */
short section;
-
- /* The section associated with this symbol. It can be NULL. */
-
- struct obj_section *obj_section;
};
extern void symbol_set_demangled_name (struct general_symbol_info *,
@@ -202,7 +195,10 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *);
#define SYMBOL_VALUE_CHAIN(symbol) (symbol)->ginfo.value.chain
#define SYMBOL_LANGUAGE(symbol) (symbol)->ginfo.language
#define SYMBOL_SECTION(symbol) (symbol)->ginfo.section
-#define SYMBOL_OBJ_SECTION(symbol) (symbol)->ginfo.obj_section
+#define SYMBOL_OBJ_SECTION(objfile, symbol) \
+ (((symbol)->ginfo.section >= 0) \
+ ? (&(((objfile)->sections)[(symbol)->ginfo.section])) \
+ : NULL)
/* Initializes the language dependent portion of a symbol
depending upon the language for the symbol. */
@@ -731,6 +727,7 @@ extern const struct symbol_impl *symbol_impls;
#define SYMBOL_BLOCK_OPS(symbol) (SYMBOL_IMPL (symbol).ops_block)
#define SYMBOL_REGISTER_OPS(symbol) (SYMBOL_IMPL (symbol).ops_register)
#define SYMBOL_LOCATION_BATON(symbol) (symbol)->aux_value
+#define SYMBOL_OBJFILE(symbol) (SYMBOL_SYMTAB (symbol)->objfile)
extern int register_symbol_computed_impl (enum address_class,
const struct symbol_computed_ops *);