summaryrefslogtreecommitdiff
path: root/gdb/coffread.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-12-12 15:57:01 +0000
committerTom Tromey <tromey@redhat.com>2012-12-12 15:57:01 +0000
commitd2f4b8feb92563f328897af142d05e796cde26bd (patch)
treeb3fb6822baded1c0640c974c34536d975fdeb256 /gdb/coffread.c
parent6f112b1867d994eb26ba56c5a47400fb715f0214 (diff)
downloadbinutils-gdb-d2f4b8feb92563f328897af142d05e796cde26bd.tar.gz
* coffread.c (coff_symfile_init): Use set_objfile_data.
(coff_symfile_read): Use DBX_SYMFILE_INFO. * dbxread.c (dbx_objfile_data_key): New global. (dbx_symfile_init): Use set_objfile_data. (dbx_symfile_finish): Don't free deprecated_sym_stab_info. (dbx_free_symfile_info): New function. (coffstab_build_psymtabs, elfstab_build_psymtabs): Use DBX_SYMFILE_INFO. (stabsect_build_psymtabs): Use set_objfile_data. (_initialize_dbxreadb): Initialize dbx_objfile_data_key. * elfread.c (elf_symtab_read): Use DBX_SYMFILE_INFO, set_objfile_data. (free_elfinfo): Use DBX_SYMFILE_INFO. (elf_symfile_finish): Don't free deprecated_sym_stab_info. (elfstab_offset_sections): Use DBX_SYMFILE_INFO. * gdb-stabs.h (dbx_objfile_data_key): Declare. (DBX_SYMFILE_INFO): Rewrite to use objfile_data. * objfiles.h (struct objfile) <deprecated_sym_stab_info>: Remove. * somread.c (som_symfile_finish): Don't free deprecated_sym_stab_info.
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r--gdb/coffread.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 37899953e90..94d0554dab5 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -450,12 +450,11 @@ record_minimal_symbol (struct coff_symbol *cs, CORE_ADDR address,
static void
coff_symfile_init (struct objfile *objfile)
{
- /* Allocate struct to keep track of stab reading. */
- objfile->deprecated_sym_stab_info = (struct dbx_symfile_info *)
- xmalloc (sizeof (struct dbx_symfile_info));
+ struct dbx_symfile_info *dbx;
- memset (objfile->deprecated_sym_stab_info, 0,
- sizeof (struct dbx_symfile_info));
+ /* Allocate struct to keep track of stab reading. */
+ dbx = XCNEW (struct dbx_symfile_info);
+ set_objfile_data (objfile, dbx_objfile_data_key, dbx);
/* Allocate struct to keep track of the symfile. */
objfile->deprecated_sym_private
@@ -528,7 +527,7 @@ coff_symfile_read (struct objfile *objfile, int symfile_flags)
int stabstrsize;
info = (struct coff_symfile_info *) objfile->deprecated_sym_private;
- dbxinfo = objfile->deprecated_sym_stab_info;
+ dbxinfo = DBX_SYMFILE_INFO (objfile);
symfile_bfd = abfd; /* Kludge for swap routines. */
/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */