From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26184 invoked by alias); 10 Aug 2009 22:12:12 -0000 Received: (qmail 26171 invoked by uid 22791); 10 Aug 2009 22:12:11 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Aug 2009 22:12:03 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7AMC1Oh027235 for ; Mon, 10 Aug 2009 18:12:01 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7AMC0ul006175; Mon, 10 Aug 2009 18:12:00 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7AMBwfF030836; Mon, 10 Aug 2009 18:11:59 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n7AMBwDF004544; Tue, 11 Aug 2009 00:11:58 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n7AMBvAl004541; Tue, 11 Aug 2009 00:11:57 +0200 Date: Mon, 10 Aug 2009 22:23:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org, Paul Pluzhnikov Subject: Re: [patch] Assertion for a regression by gdb_bfd_unref Message-ID: <20090810221157.GA3109@host0.dyn.jankratochvil.net> References: <20090809213710.GA14354@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00156.txt.bz2 On Mon, 10 Aug 2009 22:10:21 +0200, Tom Tromey wrote: > >>>>> "Jan" == Jan Kratochvil writes: > > Jan> 2009-08-09 Jan Kratochvil > 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 + + * 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 * 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; }