From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17008 invoked by alias); 16 Mar 2004 00:23:43 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 16988 invoked from network); 16 Mar 2004 00:23:42 -0000 Received: from unknown (HELO hawaii.kealia.com) (209.3.10.89) by sources.redhat.com with SMTP; 16 Mar 2004 00:23:42 -0000 Received: by hawaii.kealia.com (Postfix, from userid 2049) id 037E1C6BB; Mon, 15 Mar 2004 16:23:42 -0800 (PST) To: gdb Subject: gcc 3.4 regression in gdb.cp/namespace.exp Cc: Daniel Jacobowitz From: David Carlton Date: Tue, 16 Mar 2004 00:23:00 -0000 Message-ID: User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Reasonable Discussion, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-03/txt/msg00139.txt.bz2 I just ran the testsuite with g++ (GCC) 3.5.0 20040119 (experimental) (which is right after 3.4 branched), and I get a regression on gdb.cp/namespace.exp, on both mainline and 6.1. ptype CClass::NestedClass There is no field named NestedClass (gdb) FAIL: gdb.cp/namespace.exp: ptype CClass::NestedClass Just to double-check, I reverted my recent dwarf2read.c patch (I tested in with that GCC a week ago, but who knows), and it still fails. Daniel, might it be an issue with a recent patch of yours? (I have a more specific guess below.) Here's some more info: the classes in question are defined as follows: class CClass { public: int x; class NestedClass { public: int y; }; }; The debug info that I'm getting looks like this: .uleb128 0x17 # (DIE (0x480) DW_TAG_structure_type) .long 0x505 # DW_AT_sibling .long .LASF2 # DW_AT_name: "CClass" .byte 0x1 # DW_AT_declaration .uleb128 0x18 # (DIE (0x48a) DW_TAG_structure_type) .long .LASF1 # DW_AT_name: "NestedClass" .byte 0x4 # DW_AT_byte_size .byte 0x1 # DW_AT_decl_file .byte 0x5e # DW_AT_decl_line .uleb128 0x8 # (DIE (0x492) DW_TAG_member) .ascii "y\0" # DW_AT_name .byte 0x1 # DW_AT_decl_file .byte 0x60 # DW_AT_decl_line .long 0x19e # DW_AT_type .byte 0x2 # DW_AT_data_member_location .byte 0x23 # DW_OP_plus_uconst .uleb128 0x0 (Rest of CClass::NestedClass definition omitted.) Then, later on, we see: .uleb128 0x7 # (DIE (0x6ec) DW_TAG_structure_type) .long 0x75d # DW_AT_sibling .long 0x480 # DW_AT_specification .byte 0x4 # DW_AT_byte_size .byte 0x1 # DW_AT_decl_file .byte 0x5b # DW_AT_decl_line .uleb128 0x8 # (DIE (0x6f8) DW_TAG_member) .ascii "x\0" # DW_AT_name .byte 0x1 # DW_AT_decl_file .byte 0x5d # DW_AT_decl_line .long 0x19e # DW_AT_type .byte 0x2 # DW_AT_data_member_location .byte 0x23 # DW_OP_plus_uconst .uleb128 0x0 (Rest of CClass definition omitted.) So we have a die giving a declaration for CClass which in turn contains a die giving a definition for CClass::NestedClass. Which in turn suggests that the loop in process_structure_scope should be run even if the current DIE is a declaration. I'll fiddle around with an appropriate patch either later today or tommorow. I really hate the way we test our DWARF 2 reader - there's no way to generate the debug info by hand to give a particular scenario, so instead we have to hope that we can find the magic version of GCC and magic way of writing a test case to trigger the bug in question. Sigh. David Carlton carlton@kealia.com