Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Fix i386 memory-by-register access on amd64
Date: Wed, 29 Apr 2009 20:29:00 -0000	[thread overview]
Message-ID: <20090429202916.GA21831@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <200904291904.n3TJ4X7m000790@brahms.sibelius.xs4all.nl>

On Wed, 29 Apr 2009 21:04:33 +0200, Mark Kettenis wrote:
> 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.

While not trying to judge what is right or wrong:

I believe gdb.x86_64 debugging gdb.i386 inferior should behave exactly as
gdb.i386 debugging gdb.i386 inferior.

As gdb.i386 already has sizeof (CORE_ADDR) == 4 I find right that gdb.x86_64
with i386 inferior should cut CORE_ADDR whenever possible.

Otherwise we should fix gdb.i386 to also error on this (current behavior) case:
(gdb) x/x 0xfffffffff7ffcfc4
0xf7ffcfc4:	0x00020efc


> > 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?

As value_as_address is a long function with many `return' commands.  But I do
not have any strong opinion on it - would you like to fill a variable and
using a single exit path which would cut the result width?


Thanks,
Jan


  reply	other threads:[~2009-04-29 20:29 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
2009-04-29 20:29   ` Jan Kratochvil [this message]
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=20090429202916.GA21831@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /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