Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Andrew Volkov <Andrew.Volkov@transas.com>,
	Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA/RFC] blockframe.c Fix errorneous addr check
Date: Fri, 28 Jun 2002 09:26:00 -0000	[thread overview]
Message-ID: <1020628162645.ZM25955@localhost.localdomain> (raw)
In-Reply-To: Andrew Volkov <Andrew.Volkov@transas.com> "RE: [RFA/RFC] blockframe.c Fix errorneous addr check" (Jun 28, 12:41pm)

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 + <addr sizeof>;
> >> >> 
> >> >> 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


  reply	other threads:[~2002-06-28 16:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-28  1:41 Andrew Volkov
2002-06-28  9:26 ` Kevin Buettner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-27 11:58 Andrew Volkov
2002-06-27 12:18 ` Kevin Buettner
2002-06-27 11:08 Andrew Volkov
2002-06-27 11:39 ` Kevin Buettner
2002-06-27 10:13 Andrew Volkov
2002-06-27 10:18 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1020628162645.ZM25955@localhost.localdomain \
    --to=kevinb@redhat.com \
    --cc=Andrew.Volkov@transas.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox