From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14785 invoked by alias); 15 Apr 2004 20:43:41 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 14722 invoked from network); 15 Apr 2004 20:43:39 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (209.53.16.45) by sources.redhat.com with SMTP; 15 Apr 2004 20:43:39 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id ABCCD47D63; Thu, 15 Apr 2004 13:43:38 -0700 (PDT) Date: Thu, 15 Apr 2004 20:43:00 -0000 From: Joel Brobecker To: Jim Blandy Cc: Daniel Jacobowitz , Elena Zannoni , gdb-patches@sources.redhat.com Subject: Re: [RFA/dwarf-2] Fix for the null record problem Message-ID: <20040415204338.GE1564@gnat.com> References: <20040219140145.GB804@gnat.com> <16437.11835.435941.553479@localhost.redhat.com> <20040401011813.GE888@gnat.com> <20040413052655.GB1173@gnat.com> <20040414174729.GA612@nevyn.them.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nVMJ2NtxeReIH9PS" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-SW-Source: 2004-04/txt/msg00326.txt.bz2 --nVMJ2NtxeReIH9PS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 823 Hello Jim, Good catch about the is_declaration() case. > Joel, how about dropping the DW_AT_specification test from > die_is_declaration, and then using it in the new test in your patch? Based on Jason's answer, it looks like the DW_AT_specification check was indeed necessary. I have added a comment in that respect in the little cleanup patch you suggested earlier. See: http://sources.redhat.com/ml/gdb-patches/2004-04/msg00325.html Here a new version of the initial patch that follows your suggestion of using die_is_declaration(). It's indeed more correct, and even easier to read. 2004-04-15 Joel Brobecker * dwarf2read.c (read_structure_scope): Identify stub types using die_is_declaration() only. Tested on x86-linux, no regression. OK to apply? Thanks, -- Joel --nVMJ2NtxeReIH9PS Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dwarf2read.c.null-record.diff" Content-length: 764 --- dwarf2read.c.cleanup 2004-04-15 13:23:39.000000000 -0700 +++ dwarf2read.c 2004-04-15 13:36:10.000000000 -0700 @@ -3144,6 +3144,9 @@ read_structure_type (struct die_info *di TYPE_LENGTH (type) = 0; } + if (die_is_declaration (die, cu)) + TYPE_FLAGS (type) |= TYPE_FLAG_STUB; + /* We need to add the type field to the die immediately so we don't infinitely recurse when dealing with pointers to the structure type within the structure itself. */ @@ -3240,11 +3243,6 @@ read_structure_type (struct die_info *di do_cleanups (back_to); } - else - { - /* No children, must be stub. */ - TYPE_FLAGS (type) |= TYPE_FLAG_STUB; - } processing_current_prefix = previous_prefix; if (back_to != NULL) --nVMJ2NtxeReIH9PS--