From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21491 invoked by alias); 12 Aug 2009 14:23:16 -0000 Received: (qmail 21319 invoked by uid 22791); 12 Aug 2009 14:23:15 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Aug 2009 14:23:05 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7CEMx4u029534; Wed, 12 Aug 2009 10:22:59 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7CEMv5U026895; Wed, 12 Aug 2009 10:22:58 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7CEMnNB009598; Wed, 12 Aug 2009 10:22:54 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 11B643782C5; Wed, 12 Aug 2009 08:22:48 -0600 (MDT) To: "David Plumb" Cc: Subject: Re: incorrect address of class member References: <5630E8542965844685CBA4EB1C4785048EA900@cdnpostal.Intellon.com> From: Tom Tromey Reply-To: tromey@redhat.com Date: Wed, 12 Aug 2009 14:23:00 -0000 In-Reply-To: <5630E8542965844685CBA4EB1C4785048EA900@cdnpostal.Intellon.com> (David Plumb's message of "Wed\, 12 Aug 2009 09\:35\:38 -0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00084.txt.bz2 >>>>> "David" == David Plumb writes: David> I'm sorry if this is the wrong mailing list. I am having a problem with David> gdb but I don't know if it falls into the category of a bug report yet. No problem :) David> If gdb is using the wrong address for the mFlag member, it explains why David> the gdb print command is returning the wrong value for the mFlag member. For this sort of thing, I think you can't tell if it is a gcc bug or a gdb bug without digging below the surface. I compiled your program with a somewhat newer gcc (I don't have 3.4 around any more), and I was still able to reproduce it. I think it is a gcc bug, because readelf shows: <2><8e>: Abbrev Number: 7 (DW_TAG_member) <8f> DW_AT_name : (indirect string, offset: 0xc8): mHugeArray <93> DW_AT_decl_file : 1 <94> DW_AT_decl_line : 13 <95> DW_AT_type : <0xf2> <99> DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst: 0) <9c> DW_AT_accessibility: 3 (private) <2><9d>: Abbrev Number: 7 (DW_TAG_member) <9e> DW_AT_name : (indirect string, offset: 0x0): mFlag DW_AT_decl_file : 1 DW_AT_decl_line : 14 DW_AT_type : <0x53> DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst: 0) DW_AT_accessibility: 3 (private) ... which, if I am reading this correctly, puts both mHugeArray and mFlag at offset 0 -- see those DW_AT_data_member_location attributes. Tom