From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22878 invoked by alias); 12 Aug 2009 19:18:55 -0000 Received: (qmail 22060 invoked by uid 48); 12 Aug 2009 19:18:39 -0000 Date: Wed, 12 Aug 2009 19:18:00 -0000 Subject: [Bug debug/41048] New: bad DW_AT_data_member_location from g++ X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "tromey at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-08/txt/msg01057.txt.bz2 This example came from the gdb list: #include "stdio.h" class Blah { public: Blah(): mFlag(0) {} void setFlag( int value ) { mFlag = value; } void printFlag() { printf( "Flag value is %d\n", mFlag ); } private: int mHugeArray[0x08000001]; int mFlag; }; int main( int argc, char* argv[] ) { Blah* foo = new Blah(); foo->setFlag(1); foo->printFlag(); return 0; } I compiled this using today's svn trunk g++. Then readelf shows: <2><8e>: Abbrev Number: 7 (DW_TAG_member) <8f> DW_AT_name : (indirect string, offset: 0x9f): 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) Both fields the same DW_AT_data_member_location. -- Summary: bad DW_AT_data_member_location from g++ Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tromey at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41048