From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15168 invoked by alias); 13 Apr 2004 05:26:56 -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 15160 invoked from network); 13 Apr 2004 05:26:55 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by sources.redhat.com with SMTP; 13 Apr 2004 05:26:55 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id F34E447D63; Mon, 12 Apr 2004 22:26:55 -0700 (PDT) Date: Tue, 13 Apr 2004 05:26:00 -0000 From: Joel Brobecker To: Elena Zannoni Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/dwarf-2] Fix for the null record problem Message-ID: <20040413052655.GB1173@gnat.com> References: <20040219140145.GB804@gnat.com> <16437.11835.435941.553479@localhost.redhat.com> <20040401011813.GE888@gnat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040401011813.GE888@gnat.com> User-Agent: Mutt/1.4i X-SW-Source: 2004-04/txt/msg00268.txt.bz2 Ping? The patch is quite tiny, seems almost obvious, and Elena seemed happy with it. But it didn't get in because she asked that a testcase be added first (on Feb 19): << the patch looks sensible, but I would like to see the testcase go in at the same time, or we'll forget. >> The new testcase has been checked in now, so I was wondering if somebody had a moment to have a look at it, and confirm Elena's first review? Thanks, > > > I have found the source of the problem, and suggest the attached patch. > > > The problem was that GDB was mistakenly deducing that the empry record > > > was only a stub because of the lack of fields, and was therefore tagging > > > it with TYPE_FLAG_STUB. This is not correct. Instead, the right > > > approach, I believe, is to check for the DW_AT_declaration attribute. > > > > > > 2004-02-19 J. Brobecker > > > > > > * dwarf2read.c (read_structure_scope): Identify stub types > > > using the DW_AT_declaration attribute. > > > > > > tested on x86-linux. No regression. Fixes the testcase that was > > > proposed by Andrew (even though it is not legal C) and the Ada > > > case. > > > > > > OK to apply? > > > > > > Thanks, > > > -- > > > Joel > > > > > > Index: dwarf2read.c > > > =================================================================== > > > RCS file: /cvs/src/src/gdb/dwarf2read.c,v > > > retrieving revision 1.130 > > > diff -u -p -r1.130 dwarf2read.c > > > --- dwarf2read.c 28 Jan 2004 18:43:06 -0000 1.130 > > > +++ dwarf2read.c 19 Feb 2004 13:58:42 -0000 > > > @@ -3077,6 +3077,9 @@ read_structure_scope (struct die_info *d > > > TYPE_LENGTH (type) = 0; > > > } > > > > > > + if (dwarf2_attr (die, DW_AT_declaration, cu) != NULL) > > > + 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. */ > > > @@ -3213,11 +3216,6 @@ read_structure_scope (struct die_info *d > > > new_symbol (die, type, cu); > > > > > > do_cleanups (back_to); > > > - } > > > - else > > > - { > > > - /* No children, must be stub. */ > > > - TYPE_FLAGS (type) |= TYPE_FLAG_STUB; > > > } > > > > > > processing_current_prefix = previous_prefix; -- Joel