From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5715 invoked by alias); 12 Aug 2009 13:47:33 -0000 Received: (qmail 5650 invoked by uid 22791); 12 Aug 2009 13:47:32 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Aug 2009 13:47:25 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 1E8E110707; Wed, 12 Aug 2009 13:47:23 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 0BEE610706; Wed, 12 Aug 2009 13:47:22 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MbEAk-0001Cl-24; Wed, 12 Aug 2009 09:47:22 -0400 Date: Wed, 12 Aug 2009 13:47:00 -0000 From: Daniel Jacobowitz To: David Plumb Cc: gdb@sourceware.org Subject: Re: incorrect address of class member Message-ID: <20090812134722.GA4399@caradoc.them.org> Mail-Followup-To: David Plumb , gdb@sourceware.org References: <5630E8542965844685CBA4EB1C4785048EA900@cdnpostal.Intellon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5630E8542965844685CBA4EB1C4785048EA900@cdnpostal.Intellon.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00083.txt.bz2 On Wed, Aug 12, 2009 at 09:35:38AM -0400, David Plumb wrote: > The following code illustrates the problem. The expected output of this > little program is the string "Flag value is 1" being printed in the > terminal. It works but when I debug it with gdb, I see unexpected > things. It appears as if gdb is getting confused about how the memory is > being allocated for the Blah class object. The address of the mFlag > member is reported by gdb to be 0xd7ffb00c when it should be 0xf7ffb00c. > If gdb is using the wrong address for the mFlag member, it explains why > the gdb print command is returning the wrong value for the mFlag member. Could you try a CVS snapshot of GDB? If this still happens, file a bug. -- Daniel Jacobowitz CodeSourcery