Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sourceware.org
Subject: Re: [patch] Cut memory address width
Date: Thu, 05 Oct 2006 22:26:00 -0000	[thread overview]
Message-ID: <20061005222649.GA14087@nevyn.them.org> (raw)
In-Reply-To: <20060928172725.GA18498@host0.dyn.jankratochvil.net>

On Thu, Sep 28, 2006 at 07:27:25PM +0200, Jan Kratochvil wrote:
> Hi,
> 
> On Wed, 27 Sep 2006 21:01:11 +0200, Mark Kettenis wrote:
> ...
> > This should almost certainly be handled in value.c:value_as_address().
> > You could add an i386-specific integer_to_address(), that would
> > truncate the address to 32 bits.  But in fact, I can't think of a
> > reason why truncating to the size of a pointer shouldn't be the
> > default behaviour.
> 
> Made the default way, I also do not see the reason to keep larger addresses.
> There is some note about `ADDR_BITS_REMOVE' but I believe it is only about the
> lowest (0-2 or so) bits and the high bits should not hurt anyone.

Please see the other message in this thread where I explained about
MIPS; there, all 0x80000000 - 0xFFFFFFFF addresses will be sign
extended.  Suddenly printing out the extra eight F's would be really
ugly IMHO.  I tried to come up with a good solution to this today, but
I couldn't find one; the flag we need is associated with the BFD and
not easily accessible here.  Maybe there should be a gdbarch flag
for the property; only MIPS and sh64 set it, so duplicating the
knowledge here isn't a big deal.

As for the other half of the bug, Mark was talking about
integer_to_address, which is separate from value_to_address where your
patch tried to fix this.  I think that either inside the
implementations of that function, or at the one call site, is where we
should fix it.  That will avoid creating such addresses in the first
place. There are two options: ignore high bits, or complain if the high
bits would affect the address (e.g. if the integer was not properly
sign or value extended).  Mark liked truncate, I don't really care
which.

Oh, and please don't #if 0 things.  Either they're right, or they're
wrong.  If we need them again, there's CVS history.  Thanks in advance.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2006-10-05 22:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-27 16:15 Jan Kratochvil
2006-09-27 18:20 ` Michael Snyder
2006-09-27 18:22   ` Daniel Jacobowitz
2006-09-27 18:37     ` Jan Kratochvil
2006-09-27 18:55       ` Daniel Jacobowitz
2006-09-27 20:19         ` Jim Blandy
2006-09-27 19:01 ` Mark Kettenis
2006-09-28 17:27   ` Jan Kratochvil
2006-10-05 22:26     ` Daniel Jacobowitz [this message]
2006-09-27 19:23 ` 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=20061005222649.GA14087@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /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