* [rfa/mips] Fix reread.exp on mips-linux
@ 2004-03-25 1:53 Daniel Jacobowitz
2004-03-28 22:37 ` Andrew Cagney
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2004-03-25 1:53 UTC (permalink / raw)
To: gdb-patches; +Cc: cagney
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,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [rfa/mips] Fix reread.exp on mips-linux
2004-03-25 1:53 [rfa/mips] Fix reread.exp on mips-linux Daniel Jacobowitz
@ 2004-03-28 22:37 ` Andrew Cagney
2004-03-29 18:02 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2004-03-28 22:37 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
> 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?
Ok for mainline. For the moment sit on it for the branch.
> - priv = (struct mips_objfile_private *) sec->objfile->obj_private;
can something from this be ARIed?
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [rfa/mips] Fix reread.exp on mips-linux
2004-03-28 22:37 ` Andrew Cagney
@ 2004-03-29 18:02 ` Daniel Jacobowitz
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2004-03-29 18:02 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Sun, Mar 28, 2004 at 05:37:34PM -0500, Andrew Cagney wrote:
> >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?
>
> Ok for mainline. For the moment sit on it for the branch.
Committed both, with your later approval for the branch. Thanks.
> >- priv = (struct mips_objfile_private *) sec->objfile->obj_private;
> can something from this be ARIed?
Any reference to obj_private, I think. This was the last one outside
of HPPA/HPUX code:
drow@nevyn:/opt/src/gdb/src/gdb% grep -lr obj_private .
./hppa-tdep.c
./hpread.c
./pa64solib.c
./somread.c
./somsolib.c
./config/pa/tm-hppa.h
[And some changelogs, and the definition in objfiles.h]
If someone wants to fix that, we can then remove obj_private entirely.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-03-29 18:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-25 1:53 [rfa/mips] Fix reread.exp on mips-linux Daniel Jacobowitz
2004-03-28 22:37 ` Andrew Cagney
2004-03-29 18:02 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox