From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30059 invoked by alias); 29 Apr 2009 20:29:32 -0000 Received: (qmail 30050 invoked by uid 22791); 29 Apr 2009 20:29:31 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Apr 2009 20:29:25 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n3TKTLa2026117 for ; Wed, 29 Apr 2009 16:29:21 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3TKTKve015890 for ; Wed, 29 Apr 2009 16:29:20 -0400 Received: from host0.dyn.jankratochvil.net (sebastian-int.corp.redhat.com [172.16.52.221]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n3TKTIC3004281 for ; Wed, 29 Apr 2009 16:29:19 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n3TKTHKv006185; Wed, 29 Apr 2009 22:29:17 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n3TKTGcV006179; Wed, 29 Apr 2009 22:29:16 +0200 Date: Wed, 29 Apr 2009 20:29:00 -0000 From: Jan Kratochvil To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: [patch] Fix i386 memory-by-register access on amd64 Message-ID: <20090429202916.GA21831@host0.dyn.jankratochvil.net> References: <20090429102719.GA10117@host0.dyn.jankratochvil.net> <200904291904.n3TJ4X7m000790@brahms.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200904291904.n3TJ4X7m000790@brahms.sibelius.xs4all.nl> User-Agent: Mutt/1.5.19 (2009-01-05) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00794.txt.bz2 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 > > > > 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