From 8d5f9dcb37b90814ac723d46d5b93169da19e391 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Mon, 29 Mar 2004 17:58:05 +0000 Subject: [PATCH] * mips-tdep.c (mips_pdr_data): New. (non_heuristic_proc_desc): Use objfile_data and set_objfile_data. (_initialize_mips_tdep): Initialize mips_pdr_data. --- gdb/ChangeLog | 6 ++++++ gdb/mips-tdep.c | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9d631d71ce9..1713275f33a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2004-03-29 Daniel Jacobowitz + + * mips-tdep.c (mips_pdr_data): New. + (non_heuristic_proc_desc): Use objfile_data and set_objfile_data. + (_initialize_mips_tdep): Initialize mips_pdr_data. + 2004-03-29 Corinna Vinschen * minsyms.c (install_minimal_symbols): Move dropping leading diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index cf1eddc7663..95a0063611a 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -54,6 +54,8 @@ #include "frame-base.h" #include "trad-frame.h" +static const struct objfile_data *mips_pdr_data; + static void set_reg_offset (CORE_ADDR *saved_regs, int regnum, CORE_ADDR off); static struct type *mips_register_type (struct gdbarch *gdbarch, int regnum); @@ -2298,7 +2300,7 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr) sec = find_pc_section (pc); if (sec != NULL) { - priv = (struct mips_objfile_private *) sec->objfile->obj_private; + priv = (struct mips_objfile_private *) objfile_data (sec->objfile, mips_pdr_data); /* Search the ".pdr" section generated by GAS. This includes most of the information normally found in ECOFF PDRs. */ @@ -2316,7 +2318,7 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr) priv = obstack_alloc (&sec->objfile->objfile_obstack, sizeof (struct mips_objfile_private)); priv->size = 0; - sec->objfile->obj_private = priv; + set_objfile_data (sec->objfile, mips_pdr_data, priv); } else if (priv == NULL) { @@ -2344,7 +2346,7 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr) else priv->size = 0; - sec->objfile->obj_private = priv; + set_objfile_data (sec->objfile, mips_pdr_data, priv); } the_bfd = NULL; @@ -6104,6 +6106,8 @@ _initialize_mips_tdep (void) gdbarch_register (bfd_arch_mips, mips_gdbarch_init, mips_dump_tdep); + mips_pdr_data = register_objfile_data (); + /* Add root prefix command for all "set mips"/"show mips" commands */ add_prefix_cmd ("mips", no_class, set_mips_command, "Various MIPS specific commands.", -- 2.30.2