From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7739 invoked by alias); 3 Jan 2007 22:21:06 -0000 Received: (qmail 7713 invoked by uid 22791); 3 Jan 2007 22:21:03 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 03 Jan 2007 22:20:59 +0000 Received: (qmail 6743 invoked from network); 3 Jan 2007 22:20:58 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 Jan 2007 22:20:58 -0000 To: Joel Brobecker Cc: gdb@sourceware.org Subject: Re: Ada testsuite failures References: <20061231194604.GA23919@nevyn.them.org> <20070102113903.GH3434@adacore.com> <20070102143926.GA10771@nevyn.them.org> <20070102163108.GJ3434@adacore.com> <20070102163302.GL3434@adacore.com> <20070102164044.GA14566@nevyn.them.org> <20070103140514.GA19241@adacore.com> From: Jim Blandy Date: Wed, 03 Jan 2007 22:21:00 -0000 In-Reply-To: <20070103140514.GA19241@adacore.com> (Joel Brobecker's message of "Wed, 3 Jan 2007 18:05:14 +0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2007-01/txt/msg00042.txt.bz2 Joel Brobecker writes: > The guards cited above have been there since version 1.1 of dwarf2read.c. > I don't know how relevant they are now - presumably today's compilers > would rather use a declaration attribute rather than empty structs. > Strictly speaking, the guard as implemented is wrong. So I propose to > simply remove it. > > 2006-02-03 Joel Brobecker > > * dwarf2read.c (add_partial_symbol): Update copyright year. > Do not skip struct, union and enum types with no children. > > 2006-02-03 Joel Brobecker > > * gdb.base/nofield.c: New file. > * gdb.base/nofield.exp: New testcase. > > Tested on x86_64-linux. No regression. Nofield.exp has two FAILs before > the patch, and is all PASS after. The change to process_structure_type is almost right, but I'm pretty sure the change to add_partial_symbol isn't. The partial symtab scan shouldn't create psymbols for incomplete struct types, since we don't want to read in this compilation unit when the user enters a reference to the type. So the test in add_partial_symbol should use the criteria in the DWARF spec for recognizing incomplete structure types; section 5.6.1 "Structure, Union, and Class Type Entries", says "An incomplete structure, union or class type is represented by a structure, union or class entry that does not have a byte size attribute and that has a DW_AT_declaration attribute." At the moment, there's nothing in 'struct partial_die_info' that would tell you if the die has a size, but it looks easy enough to add. In process_structure_scope, we should drop the child test, as your patch does, but also check for the presence of DW_AT_byte_size.