Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Jim Blandy" <jimb@red-bean.com>
To: "Pedro Alves" <pedro_alves@portugalmail.pt>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: arm_addr_bits_remove
Date: Wed, 23 Jan 2008 19:22:00 -0000	[thread overview]
Message-ID: <8f2776cb0801231121r3fe9aea0q6f3c3d6887fcb251@mail.gmail.com> (raw)
In-Reply-To: <479752C8.8030201@portugalmail.pt>

On Jan 23, 2008 6:44 AM, Pedro Alves <pedro_alves@portugalmail.pt> wrote:
> With that you'll be certain that there is a symbol *before* the
> address you want to check, and you'll be sure about it's mode,
> and I'm sure that most of the times that mode will be the same as
> the mode of memaddr, but you can't be sure, can you?

I guess the thought was that if there is no symbol covering an
address, but there is a symbol whose range ends at that address, it's
a safe bet the address is some sort of endpoint (as it is in the case
at hand), and should be treated like the other addresses within the
range.

But you're right, it's a heuristic.

> The case I stumbled on the bug is a bit different from that
> case you mentioned, because the line info doesn't refer to a possible
> function which includes memaddr or ends before memaddr.  There was no
> real code at the address the lookup was being performed, because
> it refers to the end of the object file, where padding is being
> performed, but real code in a different mode could be there.  If
> there was code there, then the correct mode for it could be
> inferred, and it could be different from memaddr-1 -- at
> least that's my understanding.  I could be wrong though.  :-)

So the heuristic I suggested will often be wrong.  :(  I guess you're
right that one should be subtracting one from the address somewhere
earlier in the call stack.

Looking into this a bit more, I got even more confused.  (I don't want
to get in the way of getting a bug fixed, so take this if it's helpful
and ignore it if it's not.)  Why are we calling
gdbarch_addr_bits_remove in record_line at all?  Who sets the thumb
bit in line number info?  The thumb bit is only meaningful in ELF
symbols, and values derived from those.

It seems like the use of gdbarch_addr_bits_remove originated in 2001:

2001-04-06  Fernando Nasser  <fnasser@redhat.com>

	* buildsym.c (record_line): Turn off unused addr bits.

Could we try simply removing this?


  reply	other threads:[~2008-01-23 19:22 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-22 21:17 arm_addr_bits_remove Pedro Alves
2008-01-22 23:26 ` arm_addr_bits_remove Jim Blandy
2008-01-23 14:45   ` arm_addr_bits_remove Pedro Alves
2008-01-23 19:22     ` Jim Blandy [this message]
2008-01-23 19:29       ` arm_addr_bits_remove Daniel Jacobowitz
2008-01-23 21:12         ` arm_addr_bits_remove Jim Blandy
2008-01-24  4:54           ` arm_addr_bits_remove Pedro Alves
2008-01-24  7:35             ` arm_addr_bits_remove Jim Blandy
2008-01-24  6:30               ` arm_addr_bits_remove Jim Blandy
2008-01-24 13:39               ` arm_addr_bits_remove Pedro Alves
2008-01-24 14:45                 ` arm_addr_bits_remove Daniel Jacobowitz
2008-01-24 14:56                   ` arm_addr_bits_remove Pedro Alves
2008-01-24 16:53                     ` arm_addr_bits_remove Jim Blandy
2008-01-24 17:01                       ` arm_addr_bits_remove Pedro Alves
2008-01-24 22:19                   ` arm_addr_bits_remove Joel Brobecker
2008-01-25  0:11                     ` arm_addr_bits_remove Pedro Alves
2008-01-25  4:13                       ` arm_addr_bits_remove Joel Brobecker
2008-01-25  9:56                         ` arm_addr_bits_remove Carlos O'Donell
2008-01-25 21:24                           ` arm_addr_bits_remove John David Anglin
2008-01-25 22:14                             ` arm_addr_bits_remove Jim Blandy
2008-01-26 13:57                               ` arm_addr_bits_remove John David Anglin
2008-02-04 10:16                     ` arm_addr_bits_remove Maciej W. Rozycki
2008-02-04 13:41                       ` arm_addr_bits_remove Daniel Jacobowitz
2008-02-04 14:45                         ` arm_addr_bits_remove Maciej W. Rozycki
2008-02-04 14:51                           ` arm_addr_bits_remove Daniel Jacobowitz
2008-02-04 15:20                             ` arm_addr_bits_remove Maciej W. Rozycki
2008-01-24 17:18               ` arm_addr_bits_remove Mark Kettenis
2008-01-24 17:50                 ` arm_addr_bits_remove Joel Brobecker
2008-01-24 21:33                   ` arm_addr_bits_remove Jim Blandy

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=8f2776cb0801231121r3fe9aea0q6f3c3d6887fcb251@mail.gmail.com \
    --to=jimb@red-bean.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro_alves@portugalmail.pt \
    /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