From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7733 invoked by alias); 15 Apr 2013 19:48:28 -0000 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 Received: (qmail 7724 invoked by uid 89); 15 Apr 2013 19:48:28 -0000 X-Spam-SWARE-Status: No, score=-8.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 15 Apr 2013 19:48:27 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3FJmQj0026979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Apr 2013 15:48:26 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3FJmPka007584; Mon, 15 Apr 2013 15:48:25 -0400 Message-ID: <516C5988.8070507@redhat.com> Date: Tue, 16 Apr 2013 07:52:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: RFC: fix PR gdb/15538 References: <87obdfbn8n.fsf@fleche.redhat.com> In-Reply-To: <87obdfbn8n.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-04/txt/msg00446.txt.bz2 On 04/15/2013 08:35 PM, Tom Tromey wrote: > This fixes PR 15538, an assertion failure when reading a certain file. Bugzilla says 15538 does not exist. > > The bug is that dwarf2_record_block_ranges asserts that the ranges > section has been read in -- but it can be called without this occurring. Can you show the backtrace for the archives? > > The fix is to simply read in the section in dwarf2_record_block_ranges. > > I didn't know how to make a test case, so I haven't provided one. > If this is an issue I will try harder to figure it out. > > Built and regtested on x86-64 Fedora 18. > The bug reporter also tested it. > > Tom > > PR gdb/15538: > * dwarf2read.c (dwarf2_record_block_ranges): Ensure that the > ranges section has been read. > > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index 8947f8f..64fc7da 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -10458,7 +10458,7 @@ dwarf2_record_block_ranges (struct die_info *die, struct block *block, > address range list in the .debug_ranges section. */ > unsigned long offset = (DW_UNSND (attr) > + (need_ranges_base ? cu->ranges_base : 0)); > - const gdb_byte *buffer = dwarf2_per_objfile->ranges.buffer + offset; > + const gdb_byte *buffer; > > /* For some target architectures, but not others, the > read_address function sign-extends the addresses it returns. > @@ -10477,7 +10477,7 @@ dwarf2_record_block_ranges (struct die_info *die, struct block *block, > CORE_ADDR base = cu->base_address; > int base_known = cu->base_known; > > - gdb_assert (dwarf2_per_objfile->ranges.readin); > + dwarf2_read_section (objfile, &dwarf2_per_objfile->ranges); > if (offset >= dwarf2_per_objfile->ranges.size) > { > complaint (&symfile_complaints, > @@ -10485,6 +10485,7 @@ dwarf2_record_block_ranges (struct die_info *die, struct block *block, > offset); > return; > } > + buffer = dwarf2_per_objfile->ranges.buffer + offset; > > for (;;) > { > -- Pedro Alves