From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sources.redhat.com
Cc: cagney@gnu.org
Subject: [rfa/mips] Fix reread.exp on mips-linux
Date: Thu, 25 Mar 2004 01:53:00 -0000 [thread overview]
Message-ID: <20040325015317.GA10143@nevyn.them.org> (raw)
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,
next reply other threads:[~2004-03-25 1:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-25 1:53 Daniel Jacobowitz [this message]
2004-03-28 22:37 ` Andrew Cagney
2004-03-29 18:02 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040325015317.GA10143@nevyn.them.org \
--to=drow@false.org \
--cc=cagney@gnu.org \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox