From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19214 invoked by alias); 27 Sep 2006 19:23:51 -0000 Received: (qmail 19198 invoked by uid 22791); 27 Sep 2006 19:23:47 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 27 Sep 2006 19:23:46 +0000 Received: (qmail 10769 invoked from network); 27 Sep 2006 19:23:44 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 27 Sep 2006 19:23:44 -0000 To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch] Cut memory address width References: <20060927161501.GA23340@host0.dyn.jankratochvil.net> From: Jim Blandy Date: Wed, 27 Sep 2006 19:23:00 -0000 In-Reply-To: <20060927161501.GA23340@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Wed, 27 Sep 2006 18:15:01 +0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00201.txt.bz2 Jan Kratochvil writes: > `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. > > Simulate the part of paddress(); it is questionable how deep in the functions > calling stack the address width cut should be. Just as a sanity check: what does 'show architecture' say when you're debugging an i386 inferior on gdb/amd64? I'm guessing that x_command calls value_to_address, which passes the value of $ebx to to gdbarch_integer_to_address, which is where the conversion is happening. Is there some code there assuming that host == target?