From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30071 invoked by alias); 28 Jun 2002 16:26:50 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30060 invoked from network); 28 Jun 2002 16:26:48 -0000 Received: from unknown (HELO potter.sfbay.redhat.com) (205.180.83.107) by sources.redhat.com with SMTP; 28 Jun 2002 16:26:48 -0000 Received: from romulus.sfbay.redhat.com (remus.sfbay.redhat.com [172.16.27.252]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g5SGS7Q30612; Fri, 28 Jun 2002 09:28:07 -0700 Received: (from kev@localhost) by romulus.sfbay.redhat.com (8.11.6/8.11.6) id g5SGQkF25956; Fri, 28 Jun 2002 09:26:46 -0700 Date: Fri, 28 Jun 2002 09:26:00 -0000 From: Kevin Buettner Message-Id: <1020628162645.ZM25955@localhost.localdomain> In-Reply-To: Andrew Volkov "RE: [RFA/RFC] blockframe.c Fix errorneous addr check" (Jun 28, 12:41pm) References: <2E74F312D6980D459F3A05492BA40F8D0101CF84@clue.transas.com> To: Andrew Volkov , Kevin Buettner Subject: Re: [RFA/RFC] blockframe.c Fix errorneous addr check Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-06/txt/msg00568.txt.bz2 On Jun 28, 12:41pm, Andrew Volkov wrote: > >On Jun 27, 10:58pm, Andrew Volkov wrote: > > > >> >> current_source_end_addr = start_addr + size; > >> >> > >> >> but must be: > >> >> > >> >> current_source_end_addr = start_addr + size + ; > >> >> > >> >> As I understand, since machine address size is not known at > >> >time of parsing > >> >> coff file, then we have big trouble :(. > >> > > >> >Could you explain why you need to add in the size of an address? > >> > >> It's not necessarily must be addr sizeof, it may be 1, but, I think, > >> will be better, if current_source_end_addr will contain correct > >> value for target. > > > >What I'd like to understand is why (start_addr + size) is insufficient. > >I.e, why do we need to add 1 or some other small value to compute the > >correct ending address? > > Because start_addr + size is last_addr in block, hence all gdb parts, wich > assume that highpc is first addr after block, will work improperly. According to the comment just prior to complete_symtab(), ``size'' is the number of bytes of text. If that's really the case, then start_addr + size should be the first address beyond the section in question. > Ex. this check always failed: > > if (addr >= lowpc && addr < highpc) > .... > > when addr = last_addr_in_block. I see. I think we need to look elsewhere for the bug though. I think ``size'' is being computed incorrectly earlier on. While it's possible that the bug is in gdb or bfd, I'm now suspicious of the value obtained from the object file. > While I bump with this problem when work with h8300 coff file. Can you post the output of ``objdump -h'' on one of these coff files? Take a look at the size that it reports for .text and let us know if it appears too small to you. If it is too small, then the bug is in some other part of the toolchain, possibly the linker. Kevin