This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[rfa/mips] Fix reread.exp on mips-linux
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sources dot redhat dot com
- Cc: cagney at gnu dot org
- Date: Wed, 24 Mar 2004 20:53:17 -0500
- Subject: [rfa/mips] Fix reread.exp on mips-linux
My goof, from two years or so ago. This is allocated on the objfile
obstack, and we stashed it in obj_private; but obj_private doesn't get
cleared. If we put it in the new objfile_data machinery like a good little
interface user, then it gets cleared at the right time. This prevents
segfaulting as soon as the executable changes.
OK for head/6.1?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2004-03-24 Daniel Jacobowitz <drow@mvista.com>
* 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.
Index: mips-tdep.c
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/mips-tdep.c,v
retrieving revision 1.285
diff -u -p -r1.285 mips-tdep.c
--- mips-tdep.c 23 Mar 2004 14:47:56 -0000 1.285
+++ mips-tdep.c 25 Mar 2004 01:47:54 -0000
@@ -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, C
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, C
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, C
else
priv->size = 0;
- sec->objfile->obj_private = priv;
+ set_objfile_data (sec->objfile, mips_pdr_data, priv);
}
the_bfd = NULL;
@@ -6101,6 +6103,8 @@ _initialize_mips_tdep (void)
internal_error (__FILE__, __LINE__, "mips_abi_strings out of sync");
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,