From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24373 invoked by alias); 27 Sep 2006 18:37:25 -0000 Received: (qmail 24363 invoked by uid 22791); 27 Sep 2006 18:37:24 -0000 X-Spam-Check-By: sourceware.org Received: from 195.22.55.53.adsl.nextra.cz (HELO host0.dyn.jankratochvil.net) (195.22.55.53) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 27 Sep 2006 18:37:21 +0000 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.13.8/8.13.8) with ESMTP id k8RIbGfs013507; Wed, 27 Sep 2006 20:37:16 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.13.8/8.13.8/Submit) id k8RIbGDJ013506; Wed, 27 Sep 2006 20:37:16 +0200 Date: Wed, 27 Sep 2006 18:37:00 -0000 From: Jan Kratochvil To: Michael Snyder , gdb-patches@sourceware.org Subject: Re: [patch] Cut memory address width Message-ID: <20060927183716.GA13279@host0.dyn.jankratochvil.net> References: <20060927161501.GA23340@host0.dyn.jankratochvil.net> <1159381222.9768.43.camel@localhost.localdomain> <20060927182211.GB5635@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060927182211.GB5635@nevyn.them.org> User-Agent: Mutt/1.4.2.2i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00196.txt.bz2 On Wed, 27 Sep 2006 20:22:11 +0200, Daniel Jacobowitz wrote: > 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. ... > 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. In such case `paddress' should print full 64-bit addresses. Currently it is weird as it refuses to access memory while it will show you that you were accessing 0xffffce70 - the already cut form - it lies. If you type on i386 gdb that you want to `x/x 0xffffffffffffce70' it works - as it will cut the address automatically as even the native C compiler would do. With these two existing behaviors I was feeling it is more expected to cut the address even for the access. Still I like more the strict forbidding access and so I would rather like to remove the existing address-cut in `paddress' and also wherever it exists for the native i386. Still the current state is inconsistent, no matter which way to go is the right one. Regards, Jan