This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Assertion for a regression by gdb_bfd_unref
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;
}