From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15265 invoked by alias); 14 Dec 2012 15:33:02 -0000 Received: (qmail 15256 invoked by uid 22791); 14 Dec 2012 15:33:01 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO,TW_BJ X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Dec 2012 15:32:54 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 8DEA42E3C5; Fri, 14 Dec 2012 10:32:53 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id gxCZXzmBFfE2; Fri, 14 Dec 2012 10:32:53 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 1B5982E3C2; Fri, 14 Dec 2012 10:32:53 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id D7175C14D6; Fri, 14 Dec 2012 19:32:43 +0400 (RET) Date: Fri, 14 Dec 2012 15:33:00 -0000 From: Joel Brobecker To: Yao Qi Cc: Pedro Alves , gdb-patches@sourceware.org Subject: Re: crash/regression with ia64 targets Message-ID: <20121214153243.GB3654@adacore.com> References: <1353404184-22073-1-git-send-email-yao@codesourcery.com> <50AFD573.1090601@gmail.com> <50B0ABF9.1080606@codesourcery.com> <20121213120528.GA19986@adacore.com> <50C9E23B.7010504@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50C9E23B.7010504@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-12/txt/msg00507.txt.bz2 > How about add an assert in init_entry_point_info? > > gdb_assert (objfile->section_offsets != NULL); I forgot about this one when I sent my patch. We could add one separately. But it feels a little strange to put it there, because it's not obvious why. If anything, I feel it should be right next to where the access is made, which might be a little difficult, given that it's in a macro and not a function. > >+ int num_sections = bfd_count_sections (objfile->obfd); > >+ size_t size = SIZEOF_N_SECTION_OFFSETS (num_offsets); > >+ > >+ objfile->num_sections = num_sections; > > Can we use 'num_offsets' here, because I see these two lines in some > lines below here, > > /* Just copy in the offset table directly as given to us. */ > objfile->num_sections = num_offsets; I do not think so. The lines you quote take into the fact that the function was passed a valid num_offsets. But this is not always the case: You can pass a section_addr_info insted, or even nothing. -- Joel