Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Michael Snyder <Michael.Snyder@palmsource.com>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [patch] Cut memory address width
Date: Wed, 27 Sep 2006 18:22:00 -0000	[thread overview]
Message-ID: <20060927182211.GB5635@nevyn.them.org> (raw)
In-Reply-To: <1159381222.9768.43.camel@localhost.localdomain>

On Wed, Sep 27, 2006 at 11:20:22AM -0700, Michael Snyder wrote:
> On Wed, 2006-09-27 at 18:15 +0200, Jan Kratochvil wrote:
> > Hi,
> > 
> > `x/x $ebx' on gdb/amd64 debugging inferior/i386 causes Cannot access memory at
> > address 0xffffce70 (or so) as $ebx is considered `int' and sign-extended to
> > 64-bit while the resulting address 0xffffffffffffce70 fails to be accessed.
> > 
> > $esp does not exhibit this problem as it is `builtin_type_void_data_ptr' not
> > `builtin_type_int' as $ebx is.  Therefore it gets extended as unsigned.
> > 
> > Simulate the part of paddress(); it is questionable how deep in the functions
> > calling stack the address width cut should be.
> 
> Yes, but I think the assumption is that esp is most commonly used 
> to hold an address, while ebx is most commonly used to hold an integer.
> Hence the default types.
> 
> I would tend to say that what the user should do is use an explicit
> cast.  As is, he is using an implicit cast and not getting what he
> expects.

What's interesting is why this behavior is different on x86_64 and
i386.  Where are we doing the sign extension - that's probably where it
should be fixed, if anywhere.


-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2006-09-27 18:22 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 [this message]
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
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=20060927182211.GB5635@nevyn.them.org \
    --to=drow@false.org \
    --cc=Michael.Snyder@palmsource.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@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