From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org, Paul Pluzhnikov <ppluzhnikov@google.com>
Subject: Re: [patch] Assertion for a regression by gdb_bfd_unref
Date: Mon, 10 Aug 2009 22:23:00 -0000 [thread overview]
Message-ID: <20090810221157.GA3109@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <m3ljlr77ma.fsf@fleche.redhat.com>
On Mon, 10 Aug 2009 22:10:21 +0200, Tom Tromey wrote:
> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
>
> Jan> 2009-08-09 Jan Kratochvil <jan.kratochvil@redhat.com>
> Jan> * objfiles.c (gdb_bfd_unref): Use the bfd_usrdata accessor.
> Jan> * solib.c (symbol_add_stub): Likewise.
> Jan> * symfile.c (symfile_bfd_open): Assert BFD_USRDATA is NULL.
>
> This is ok, thanks.
Checked-in:
http://sourceware.org/ml/gdb-cvs/2009-08/msg00055.html
The binutils go32-target patches are now also checked-in:
http://sourceware.org/ml/binutils/2009-08/threads.html#00155
Thanks,
Jan
--- src/gdb/ChangeLog 2009/08/10 20:14:13 1.10794
+++ src/gdb/ChangeLog 2009/08/10 22:09:22 1.10795
@@ -1,3 +1,9 @@
+2009-08-10 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * objfiles.c (gdb_bfd_unref): Use the bfd_usrdata accessor.
+ * solib.c (symbol_add_stub): Likewise.
+ * symfile.c (symfile_bfd_open): Assert BFD_USRDATA is NULL.
+
2009-08-10 Paul Pluzhnikov <ppluzhnikov@google.com>
* objfiles.c (qsort_cmp): Remove assert.
--- src/gdb/objfiles.c 2009/08/10 20:14:14 1.90
+++ src/gdb/objfiles.c 2009/08/10 22:09:22 1.91
@@ -1070,7 +1070,7 @@
if (abfd == NULL)
return;
- p_refcount = abfd->usrdata;
+ p_refcount = bfd_usrdata (abfd);
/* Valid range for p_refcount: NULL (single owner), or a pointer
to int counter, which has a value of 1 (single owner) or 2 (shared). */
@@ -1083,7 +1083,7 @@
return;
}
xfree (p_refcount);
- abfd->usrdata = NULL; /* Paranoia. */
+ bfd_usrdata (abfd) = NULL; /* Paranoia. */
name = bfd_get_filename (abfd);
if (!bfd_close (abfd))
--- src/gdb/solib.c 2009/08/04 18:46:05 1.123
+++ src/gdb/solib.c 2009/08/10 22:09:22 1.124
@@ -459,7 +459,7 @@
so->objfile = symbol_file_add_from_bfd (so->abfd, flags, sap, OBJF_SHARED);
p_refcount = xmalloc (sizeof (*p_refcount));
*p_refcount = 2; /* Both solib and objfile refer to this abfd. */
- so->abfd->usrdata = p_refcount;
+ bfd_usrdata (so->abfd) = p_refcount;
free_section_addr_info (sap);
--- src/gdb/symfile.c 2009/08/03 17:00:34 1.240
+++ src/gdb/symfile.c 2009/08/10 22:09:22 1.241
@@ -1638,6 +1638,9 @@
bfd_errmsg (bfd_get_error ()));
}
+ /* bfd_usrdata exists for applications and libbfd must not touch it. */
+ gdb_assert (bfd_usrdata (sym_bfd) == NULL);
+
return sym_bfd;
}
next prev parent reply other threads:[~2009-08-10 22:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-09 21:46 Jan Kratochvil
2009-08-10 8:51 ` Paul Pluzhnikov
2009-08-10 20:16 ` Tom Tromey
2009-08-10 22:23 ` Jan Kratochvil [this message]
2009-08-10 22:26 ` Paul Pluzhnikov
2009-08-10 23:49 ` Jan Kratochvil
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=20090810221157.GA3109@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=ppluzhnikov@google.com \
--cc=tromey@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