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] Fix i386 memory-by-register access on amd64
Date: Wed, 29 Apr 2009 19:05:00 -0000	[thread overview]
Message-ID: <200904291904.n3TJ4X7m000790@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <20090429102719.GA10117@host0.dyn.jankratochvil.net> (message 	from Jan Kratochvil on Wed, 29 Apr 2009 12:27:19 +0200)

> Date: Wed, 29 Apr 2009 12:27:19 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> 
> Hi,
> 
> original bugreport:
> 	https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=181390
> 
> (gdb) x/x $esp
> 0xffffce70:     0x00000001
> (gdb) x/x $ebx
> 0xffffce70:     Cannot access memory at address 0xffffce70
> (gdb) x/x 0xffffce70
> 0xffffce70:     0x00000001
> 
> One point is there should have been printed this error message instead:
> 0xffffffffffffce70:     Cannot access memory at address 0xffffffffffffce70
> but this problem is just a consequence of paddress() truncating the printed
> address width.  This printing issue is unrelated to the patch below.
> 
> The error happens because $ebx is considered signed while $esp unsigned, as
> initialized by i386_register_type (or also amd64_register_type).  Therefore
> the address width should be cut to the right size at the right point of
> processing, I hope I caught (one of) such points.

I'm not sure this is the right solution.  On 64-bit machines where
addresses are signed I think we actually want the sign extension to
happen.

> 2006-09-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	Fix signed 32bit inferior registers on 64bit GDB.
> 	* gdb/value.c (value_as_address): Make it static, rename it to ...
> 	(value_as_address1): ... this function.
> 	(value_as_address): New function.

What is your motiviation for using a wrapper function?


  reply	other threads:[~2009-04-29 19:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-29 10:27 Jan Kratochvil
2009-04-29 19:05 ` Mark Kettenis [this message]
2009-04-29 20:29   ` Jan Kratochvil
2009-04-29 20:45     ` Jan Kratochvil
2009-06-25 16:33     ` Tom Tromey
2009-07-06  8:19       ` Jan Kratochvil
2009-07-07 16:24         ` Ulrich Weigand
2009-07-07 16:54           ` Daniel Jacobowitz
2009-07-07 18:00           ` Mark Kettenis
2009-07-07 18:22             ` Jan Kratochvil
2009-07-07 18:43               ` Mark Kettenis
2009-07-08 13:20           ` [patch] /* */ for target_thread_architecture [Re: [patch] Fix i386 memory-by-register access on amd64] Jan Kratochvil
2009-07-09 12:51             ` Ulrich Weigand
2009-07-09 16:36               ` Jan Kratochvil
2009-07-08 14:42         ` [patch] Fix i386 memory-by-register access on amd64 Jan Kratochvil
2009-07-13 18:10           ` Ulrich Weigand
2009-07-13 19:42             ` Mark Kettenis
2009-07-13 20:32             ` Jan Kratochvil

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=200904291904.n3TJ4X7m000790@brahms.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