Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: jan.kratochvil@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Cut memory address width
Date: Wed, 27 Sep 2006 19:01:00 -0000	[thread overview]
Message-ID: <200609271901.k8RJ1BD1030473@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <20060927161501.GA23340@host0.dyn.jankratochvil.net> (message 	from Jan Kratochvil on Wed, 27 Sep 2006 18:15:01 +0200)

> Date: Wed, 27 Sep 2006 18:15:01 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> 
> 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.

We could change it into an unsigned type, but then "x /x -1" would
still fail, and a think the signed type is a bit more useful than an
unsigned type here.

> Simulate the part of paddress(); it is questionable how deep in the functions
> calling stack the address width cut should be.

Well, your proposed fix is defenitely the wrong place to do it.

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.

Mark


  parent reply	other threads:[~2006-09-27 19:01 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 [this message]
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=200609271901.k8RJ1BD1030473@elgar.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --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