From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11993 invoked by alias); 25 Jan 2006 20:00:12 -0000 Received: (qmail 11974 invoked by uid 22791); 25 Jan 2006 20:00:11 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 25 Jan 2006 20:00:05 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F1qoC-0004mq-Vj; Wed, 25 Jan 2006 15:00:01 -0500 Date: Thu, 26 Jan 2006 00:41:00 -0000 From: Daniel Jacobowitz To: PAUL GILLIAM Cc: gdb@sources.redhat.com Subject: Re: strange dereferencing behavior in gdb expressions Message-ID: <20060125200000.GA18352@nevyn.them.org> Mail-Followup-To: PAUL GILLIAM , gdb@sources.redhat.com References: <1138218150.1423.36.camel@dufur.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1138218150.1423.36.camel@dufur.beaverton.ibm.com> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00255.txt.bz2 On Wed, Jan 25, 2006 at 11:42:30AM -0800, PAUL GILLIAM wrote: > This seems inconsistent: GDB says it can't access memory at an address, > but when given that address explicitly, it works fine. > > GDB was configured like this: CC='gcc -m64' ../src/configure > (i.e. GDB > is a 64-bit application) > > The target application is a 32-bit 'C' program. > > (gdb) show version > GNU gdb 6.4.50.20060124-cvs > ... > This GDB was configured as "powerpc64-unknown-linux-gnu". > (gdb) p/x *(*(0xffffc4a0)+4) > Cannot access memory at address 0xffffc504 > (gdb) p/x *(int*)((*(int*)0xffffc4a0)+4) > $42 = 0xfd7e67c > (gdb) p/x *(0xffffc4a0)+4 > $43 = 0xffffc504 > (gdb) p/x *($43) > Cannot access memory at address 0xffffc504 > (gdb) p/x *(0xffffc504) > $44 = 0xfd7e67c > (gdb) > > Anyone what to hazard a guess as to what is going on? I've had this happen when memory_error truncates the address; might want to set a breakpoint there, and see if one of them is sign extended differently than the other due to their different types. -- Daniel Jacobowitz CodeSourcery