From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2513 invoked by alias); 27 Sep 2006 19:01:34 -0000 Received: (qmail 2490 invoked by uid 22791); 27 Sep 2006 19:01:31 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 27 Sep 2006 19:01:29 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k8RJ1Cfr011160; Wed, 27 Sep 2006 21:01:12 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.8/8.13.6) with ESMTP id k8RJ1Cee032388; Wed, 27 Sep 2006 21:01:12 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.8/8.13.8/Submit) id k8RJ1BD1030473; Wed, 27 Sep 2006 21:01:11 +0200 (CEST) Date: Wed, 27 Sep 2006 19:01:00 -0000 Message-Id: <200609271901.k8RJ1BD1030473@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: jan.kratochvil@redhat.com CC: gdb-patches@sourceware.org In-reply-to: <20060927161501.GA23340@host0.dyn.jankratochvil.net> (message from Jan Kratochvil on Wed, 27 Sep 2006 18:15:01 +0200) Subject: Re: [patch] Cut memory address width References: <20060927161501.GA23340@host0.dyn.jankratochvil.net> 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/msg00199.txt.bz2 > Date: Wed, 27 Sep 2006 18:15:01 +0200 > From: Jan Kratochvil > > 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